diff options
Diffstat (limited to 'Tests/CommandLineTest/CMakeLists.txt')
-rw-r--r-- | Tests/CommandLineTest/CMakeLists.txt | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/Tests/CommandLineTest/CMakeLists.txt b/Tests/CommandLineTest/CMakeLists.txt index 96aac10..a44fb39 100644 --- a/Tests/CommandLineTest/CMakeLists.txt +++ b/Tests/CommandLineTest/CMakeLists.txt @@ -2,58 +2,58 @@ cmake_minimum_required (VERSION 2.6) project(CommandLineTest) get_filename_component(CMAKE_BIN_DIR ${CMAKE_COMMAND} PATH) -macro(EXEC_CMAKE_COMMAND CMAKE_ARGS) - exec_program("${CMAKE_COMMAND}" ARGS "${CMAKE_ARGS}" RETURN_VALUE RET) +macro(EXEC_CMAKE_COMMAND) + execute_process(COMMAND "${CMAKE_COMMAND}" ${ARGN} RESULT_VARIABLE RET) if(${RET}) - message(SEND_ERROR "CMake command failed with arguments \"${CMAKE_ARGS}\"") + message(SEND_ERROR "CMake command failed with arguments \"${ARGN}\"") endif() endmacro() -EXEC_CMAKE_COMMAND("-E chdir \"${CMAKE_CURRENT_SOURCE_DIR}\" \"${CMAKE_COMMAND}\" -E echo \"Hello World\"") -EXEC_CMAKE_COMMAND("-E time \"${CMAKE_COMMAND} -N -L ${CommandLineTest_SOURCE_DIR}\"") -EXEC_CMAKE_COMMAND("-E time \"${CMAKE_COMMAND} -N -LA ${CommandLineTest_SOURCE_DIR}\"") -EXEC_CMAKE_COMMAND("-E time \"${CMAKE_COMMAND} -N -LH ${CommandLineTest_SOURCE_DIR}\"") -EXEC_CMAKE_COMMAND("-E time \"${CMAKE_COMMAND} -N -LAH ${CommandLineTest_SOURCE_DIR}\"") -EXEC_CMAKE_COMMAND("--help") -EXEC_CMAKE_COMMAND("--help-command-list") -EXEC_CMAKE_COMMAND("--help add_executable") -EXEC_CMAKE_COMMAND("--help-command add_executable") -EXEC_CMAKE_COMMAND("--help-full \"${CMAKE_CURRENT_BINARY_DIR}/cmake.txt\"") -EXEC_CMAKE_COMMAND("--help-man \"${CMAKE_CURRENT_BINARY_DIR}/cmake.man\"") -EXEC_CMAKE_COMMAND("--help-html \"${CMAKE_CURRENT_BINARY_DIR}/cmake.html\"") -EXEC_CMAKE_COMMAND("--copyright \"${CMAKE_CURRENT_BINARY_DIR}/Copyright.txt\"") -EXEC_CMAKE_COMMAND("--version \"${CMAKE_CURRENT_BINARY_DIR}/version.txt\"") +EXEC_CMAKE_COMMAND(-E chdir "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_COMMAND}" -E echo "Hello World") +EXEC_CMAKE_COMMAND(-E time "${CMAKE_COMMAND} -N -L ${CommandLineTest_SOURCE_DIR}") +EXEC_CMAKE_COMMAND(-E time "${CMAKE_COMMAND} -N -LA ${CommandLineTest_SOURCE_DIR}") +EXEC_CMAKE_COMMAND(-E time "${CMAKE_COMMAND} -N -LH ${CommandLineTest_SOURCE_DIR}") +EXEC_CMAKE_COMMAND(-E time "${CMAKE_COMMAND} -N -LAH ${CommandLineTest_SOURCE_DIR}") +EXEC_CMAKE_COMMAND(--help) +EXEC_CMAKE_COMMAND(--help-command-list) +EXEC_CMAKE_COMMAND(--help add_executable) +EXEC_CMAKE_COMMAND(--help-command add_executable) +EXEC_CMAKE_COMMAND(--help-full "${CMAKE_CURRENT_BINARY_DIR}/cmake.txt") +EXEC_CMAKE_COMMAND(--help-man "${CMAKE_CURRENT_BINARY_DIR}/cmake.man") +EXEC_CMAKE_COMMAND(--help-html "${CMAKE_CURRENT_BINARY_DIR}/cmake.html") +EXEC_CMAKE_COMMAND(--copyright "${CMAKE_CURRENT_BINARY_DIR}/Copyright.txt") +EXEC_CMAKE_COMMAND(--version "${CMAKE_CURRENT_BINARY_DIR}/version.txt") add_executable(CommandLineTest CommandLineTest.cxx) get_filename_component(CMAKE_COMMAND_PATH "${CMAKE_COMMAND}" PATH) set(CTEST_COMMAND "${CMAKE_COMMAND_PATH}/ctest") -macro(EXEC_CTEST_COMMAND CMAKE_ARGS) - exec_program("${CTEST_COMMAND}" ARGS "${CMAKE_ARGS}" RETURN_VALUE RET) +macro(EXEC_CTEST_COMMAND) + execute_process(COMMAND "${CTEST_COMMAND}" ${ARGN} RESULT_VARIABLE RET) if(${RET}) message(SEND_ERROR "CTest command failed with arguments \"${CMAKE_ARGS}\"") endif() endmacro() -macro(EXEC_CTEST_COMMAND_WITH_DIR DIR CMAKE_ARGS) - exec_program("${CTEST_COMMAND}" "${DIR}" ARGS "${CMAKE_ARGS}" RETURN_VALUE RET) +macro(EXEC_CTEST_COMMAND_WITH_DIR DIR) + execute_process(COMMAND "${CTEST_COMMAND}" ${ARGN} WORKING_DIRECTORY "${DIR}" RESULT_VARIABLE RET) if(${RET}) message(SEND_ERROR "CTest command failed with arguments \"${CMAKE_ARGS}\"") endif() endmacro() -EXEC_CTEST_COMMAND_WITH_DIR("${CMAKE_CURRENT_BINARY_DIR}/../.." "-N") -EXEC_CTEST_COMMAND_WITH_DIR("${CMAKE_CURRENT_BINARY_DIR}/../.." "-R complex -N") -EXEC_CTEST_COMMAND_WITH_DIR("${CMAKE_CURRENT_BINARY_DIR}/../.." "-E Simple -N") -EXEC_CTEST_COMMAND_WITH_DIR("${CMAKE_CURRENT_BINARY_DIR}/../.." "-E Simple -N") -EXEC_CTEST_COMMAND_WITH_DIR("${CMAKE_CURRENT_BINARY_DIR}/../.." "-N -I -10") -EXEC_CTEST_COMMAND_WITH_DIR("${CMAKE_CURRENT_BINARY_DIR}/../.." "-N -I 10-") -EXEC_CTEST_COMMAND_WITH_DIR("${CMAKE_CURRENT_BINARY_DIR}/../.." "-N -I 3,4") -EXEC_CTEST_COMMAND("--help") -EXEC_CTEST_COMMAND("--copyright") -EXEC_CTEST_COMMAND("--help-full \"${CMAKE_CURRENT_BINARY_DIR}/ctest.txt\"") -EXEC_CTEST_COMMAND("--help-man \"${CMAKE_CURRENT_BINARY_DIR}/ctest.man\"") -EXEC_CTEST_COMMAND("--help-html \"${CMAKE_CURRENT_BINARY_DIR}/ctest.html\"") -EXEC_CTEST_COMMAND("--version") +EXEC_CTEST_COMMAND_WITH_DIR("${CMAKE_CURRENT_BINARY_DIR}/../.." -N) +EXEC_CTEST_COMMAND_WITH_DIR("${CMAKE_CURRENT_BINARY_DIR}/../.." -R complex -N) +EXEC_CTEST_COMMAND_WITH_DIR("${CMAKE_CURRENT_BINARY_DIR}/../.." -E Simple -N) +EXEC_CTEST_COMMAND_WITH_DIR("${CMAKE_CURRENT_BINARY_DIR}/../.." -E Simple -N) +EXEC_CTEST_COMMAND_WITH_DIR("${CMAKE_CURRENT_BINARY_DIR}/../.." -N -I -10) +EXEC_CTEST_COMMAND_WITH_DIR("${CMAKE_CURRENT_BINARY_DIR}/../.." -N -I 10-) +EXEC_CTEST_COMMAND_WITH_DIR("${CMAKE_CURRENT_BINARY_DIR}/../.." -N -I 3,4) +EXEC_CTEST_COMMAND(--help) +EXEC_CTEST_COMMAND(--copyright) +EXEC_CTEST_COMMAND(--help-full "${CMAKE_CURRENT_BINARY_DIR}/ctest.txt") +EXEC_CTEST_COMMAND(--help-man "${CMAKE_CURRENT_BINARY_DIR}/ctest.man") +EXEC_CTEST_COMMAND(--help-html "${CMAKE_CURRENT_BINARY_DIR}/ctest.html") +EXEC_CTEST_COMMAND(--version) if(THIS_SHOULD_BE_SET) message(STATUS "***************************") |