CMake: clean up test setup

- Remove redundant searches for ECM and Qt::Test, move
   them to top-level.
main
Adriaan de Groot 6 years ago
parent a33b0c4f24
commit 7515386cf8

@ -237,6 +237,11 @@ set_package_properties(
find_package(ECM ${ECM_VERSION} NO_MODULE)
if( ECM_FOUND )
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_MODULE_PATH})
if ( BUILD_TESTING )
# ECM implies that we can build the tests, too
find_package( Qt5 COMPONENTS Test REQUIRED )
include( ECMAddTests )
endif()
endif()
find_package( KF5 COMPONENTS CoreAddons Crash )

@ -8,10 +8,7 @@ calamares_add_plugin( contextualprocess
SHARED_LIB
)
if( ECM_FOUND )
find_package( Qt5 COMPONENTS Test REQUIRED )
include( ECMAddTests )
if( ECM_FOUND AND BUILD_TESTING )
ecm_add_test(
Tests.cpp
ContextualProcessJob.cpp # Builds it a second time

@ -20,10 +20,7 @@ if ( KPMcore_FOUND )
SHARED_LIB
)
if( ECM_FOUND )
find_package( Qt5 COMPONENTS Test REQUIRED )
include( ECMAddTests )
if( ECM_FOUND AND BUILD_TESTING )
ecm_add_test(
Tests.cpp
TEST_NAME

@ -1,9 +1,3 @@
find_package(ECM ${ECM_VERSION} NO_MODULE)
if( ECM_FOUND AND BUILD_TESTING )
include( ECMAddTests )
find_package( Qt5 COMPONENTS Core Test REQUIRED )
endif()
# When debugging the timezone widget, add this debugging definition
# to have a debugging-friendly timezone widget, debug logging,
# and no intrusive timezone-setting while clicking around.

@ -1,6 +1,4 @@
find_package( Qt5 COMPONENTS Gui Test REQUIRED )
include( ECMAddTests )
find_package( Qt5 COMPONENTS Gui REQUIRED )
set( PartitionModule_SOURCE_DIR .. )
@ -23,6 +21,7 @@ include_directories(
${CMAKE_CURRENT_BINARY_DIR}
)
if( ECM_FOUND AND BUILD_TESTING )
ecm_add_test( ${partitionjobtests_SRCS}
TEST_NAME partitionjobtests
LINK_LIBRARIES
@ -33,3 +32,4 @@ ecm_add_test( ${partitionjobtests_SRCS}
)
set_target_properties( partitionjobtests PROPERTIES AUTOMOC TRUE )
endif()

@ -8,10 +8,7 @@ calamares_add_plugin( shellprocess
SHARED_LIB
)
if( ECM_FOUND )
find_package( Qt5 COMPONENTS Test REQUIRED )
include( ECMAddTests )
if( ECM_FOUND AND BUILD_TESTING )
ecm_add_test(
Tests.cpp
TEST_NAME

@ -1,9 +1,4 @@
find_package(ECM ${ECM_VERSION} NO_MODULE)
if( ECM_FOUND )
include( ECMAddTests )
endif()
find_package( Qt5 COMPONENTS Core Test REQUIRED )
find_package( Qt5 COMPONENTS Core REQUIRED )
find_package( Crypt REQUIRED )
# Add optional libraries here
@ -44,7 +39,7 @@ calamares_add_plugin( users
SHARED_LIB
)
if( ECM_FOUND )
if( ECM_FOUND AND BUILD_TESTING )
ecm_add_test(
PasswordTests.cpp
SetPasswordJob.cpp

Loading…
Cancel
Save