Move all KDE4_BUILD_TESTS to BUILD_TESTING

Also remove all duplicated add_definitions(-DCOMPILING_TESTS)
parent 31529bc8
......@@ -19,17 +19,6 @@ if(${CMAKE_VERSION} VERSION_GREATER 3.0.0)
cmake_policy(SET CMP0046 OLD)
endif()
# QT5TODO: remove KDE4_BUILD_TESTS post-3.0
# transitional forward compatibility:
# BUILD_TESTING is cmake standard, KDE4_BUILD_TESTS not used by ECM/KF5
# have BUILD_TESTING overrule KDE4_BUILD_TESTS if set
# slightly broken approach, if a cache exists then unsetting tests will need both
# BUILD_TESTING and KDE4_BUILD_TESTS to be set to FALSE
# better fixes welcome
if (BUILD_TESTING)
set(KDE4_BUILD_TESTS TRUE)
endif()
######################
#######################
## Constants defines ##
......@@ -258,8 +247,11 @@ else()
set(HAVE_X11 FALSE)
endif()
# only with this definition will the FOO_TEST_EXPORT macro do something
if(KDE4_BUILD_TESTS)
# only with this definition will all the FOO_TEST_EXPORT macro do something
# TODO: check if this can be moved to only those places which make use of it,
# to reduce global compiler definitions that would trigger a recompile of
# everything on a change (like adding/removing tests to/from the build)
if(BUILD_TESTING)
add_definitions(-DCOMPILING_TESTS)
endif()
......
......@@ -69,7 +69,7 @@ macro (CALLIGRA_ADD_BENCHMARK _test_NAME)
if (NOT MSVC_IDE) #not needed for the ide
# if the tests are EXCLUDE_FROM_ALL, add a target "buildtests" to build all tests
if (NOT KDE4_BUILD_TESTS)
if (NOT BUILD_TESTING)
get_directory_property(_buildtestsAdded BUILDTESTS_ADDED)
if(NOT _buildtestsAdded)
add_custom_target(buildtests)
......
......@@ -271,7 +271,7 @@ endmacro (KDE4_ADD_KDEINIT_EXECUTABLE)
# Add a unit test, which is executed when running make test .
# The targets are always created, but only built for the "all"
# target if the option KDE4_BUILD_TESTS is enabled. Otherwise the rules for the target
# target if the option BUILD_TESTING is enabled. Otherwise the rules for the target
# are created but not built by default. You can build them by manually building the target.
# The name of the target can be specified using TESTNAME <testname>, if it is not given
# the macro will default to the <name>
......@@ -334,14 +334,14 @@ macro (KDE4_ADD_UNIT_TEST _test_NAME)
if (NOT MSVC_IDE) #not needed for the ide
# if the tests are EXCLUDE_FROM_ALL, add a target "buildtests" to build all tests
if (NOT KDE4_BUILD_TESTS)
if (NOT BUILD_TESTING)
get_directory_property(_buildtestsAdded BUILDTESTS_ADDED)
if(NOT _buildtestsAdded)
add_custom_target(buildtests)
set_directory_properties(PROPERTIES BUILDTESTS_ADDED TRUE)
endif(NOT _buildtestsAdded)
add_dependencies(buildtests ${_test_NAME})
endif (NOT KDE4_BUILD_TESTS)
endif (NOT BUILD_TESTING)
endif (NOT MSVC_IDE)
endmacro (KDE4_ADD_UNIT_TEST)
......@@ -425,9 +425,9 @@ macro (KDE4_ADD_EXECUTABLE _target_NAME)
set(_add_executable_param)
endif (_nogui)
if (_test AND NOT KDE4_BUILD_TESTS)
if (_test AND NOT BUILD_TESTING)
set(_add_executable_param ${_add_executable_param} EXCLUDE_FROM_ALL)
endif (_test AND NOT KDE4_BUILD_TESTS)
endif (_test AND NOT BUILD_TESTING)
add_executable(${_target_NAME} ${_add_executable_param} ${_SRCS})
......
......@@ -2,11 +2,6 @@ project(flake)
include_directories(${FLAKE_INCLUDES} )
if(KDE4_BUILD_TESTS)
# only with this definition will the FLAKE_TEST_EXPORT macro do something
add_definitions(-DCOMPILING_TESTS)
endif()
add_subdirectory(styles)
add_subdirectory(tests)
add_subdirectory(pics)
......
......@@ -2,12 +2,6 @@ include_directories(
${KOPAGEAPP_INCLUDES}
)
if(KDE4_BUILD_TESTS)
# only with this definition will the KOPAGEAPP_TEST_EXPORT macro do something
add_definitions(-DCOMPILING_TESTS)
endif()
add_subdirectory(tests)
add_subdirectory(tools)
......
......@@ -5,7 +5,7 @@ set(koplugin_LIB_SRCS
)
# help plugin trader find installed plugins when run from uninstalled tests
if (KDE4_BUILD_TESTS)
if (BUILD_TESTING)
add_definitions(-DCMAKE_INSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}")
endif()
......
......@@ -2,7 +2,7 @@
add_subdirectory( hyphdicts )
if(KDE4_BUILD_TESTS)
if(BUILD_TESTING)
include_directories( ${KOMAIN_INCLUDES} )
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${KDE4_ENABLE_EXCEPTIONS}")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment