diff --git a/CMakeLists.txt b/CMakeLists.txt index dee83e92b..e9688a7ee 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -611,3 +611,23 @@ ADD_CUSTOM_TARGET(uninstall # The test suite. enable_testing() add_subdirectory(test_suite EXCLUDE_FROM_ALL) + +if(ENABLE_AUTOTESTING) + set(TEST_SUITE_COMMENT "Running the full FlightGear test suite.") + if(WIN32) + set(TEST_SUITE_COMMAND "run_test_suite.exe") + set(TEST_SUITE_WORKING_DIRECTORY "${TESTSUITE_OUTPUT_DIR}/${CMAKE_BUILD_TYPE}") + else() + set(TEST_SUITE_COMMAND "run_test_suite") + set(TEST_SUITE_WORKING_DIRECTORY "${TESTSUITE_OUTPUT_DIR}") + endif(WIN32) +else() + set(TEST_SUITE_COMMENT "Building the FlightGear test suite.") +endif(ENABLE_AUTOTESTING) + +add_custom_target(test_suite + ${TEST_SUITE_COMMAND} + DEPENDS run_test_suite + WORKING_DIRECTORY ${TEST_SUITE_WORKING_DIRECTORY} + COMMENT ${TEST_SUITE_COMMENT} +) diff --git a/test_suite/CMakeLists.txt b/test_suite/CMakeLists.txt index eb9c3902b..3fc040ba9 100644 --- a/test_suite/CMakeLists.txt +++ b/test_suite/CMakeLists.txt @@ -126,25 +126,6 @@ set_target_properties(run_test_suite PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${TESTSUITE_OUTPUT_DIR}" ) -if(ENABLE_AUTOTESTING) - set(TEST_SUITE_COMMENT "Running the full FlightGear test suite.") - if(WIN32) - set(TEST_SUITE_COMMAND "run_test_suite.exe") - set(TEST_SUITE_WORKING_DIRECTORY "${TESTSUITE_OUTPUT_DIR}/${CMAKE_BUILD_TYPE}") - else() - set(TEST_SUITE_COMMAND "run_test_suite") - set(TEST_SUITE_WORKING_DIRECTORY "${TESTSUITE_OUTPUT_DIR}") - endif(WIN32) -else() - set(TEST_SUITE_COMMENT "Building the FlightGear test suite.") -endif(ENABLE_AUTOTESTING) - -add_custom_target(test_suite - ${TEST_SUITE_COMMAND} - DEPENDS run_test_suite - WORKING_DIRECTORY ${TEST_SUITE_WORKING_DIRECTORY} - COMMENT ${TEST_SUITE_COMMENT} -) # Set up the target links. setup_fgfs_libraries(run_test_suite)