diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2010-12-17 15:23:54 (GMT) |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2010-12-17 15:23:54 (GMT) |
commit | d87bae7f742e5ea4d99dfd3691b6de335c6c0758 (patch) | |
tree | 108bbcc6129378580fbabeff6fa295edff485155 /Tests/TestsWorkingDirectory | |
parent | 992c74f3e0747e806c3fc7708fea68cb2c376247 (diff) | |
download | CMake-d87bae7f742e5ea4d99dfd3691b6de335c6c0758.zip CMake-d87bae7f742e5ea4d99dfd3691b6de335c6c0758.tar.gz CMake-d87bae7f742e5ea4d99dfd3691b6de335c6c0758.tar.bz2 |
Simplify the _default_cwd derivation
Diffstat (limited to 'Tests/TestsWorkingDirectory')
-rw-r--r-- | Tests/TestsWorkingDirectory/CMakeLists.txt | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/Tests/TestsWorkingDirectory/CMakeLists.txt b/Tests/TestsWorkingDirectory/CMakeLists.txt index c0e780c..d1c40d6 100644 --- a/Tests/TestsWorkingDirectory/CMakeLists.txt +++ b/Tests/TestsWorkingDirectory/CMakeLists.txt @@ -5,6 +5,8 @@ add_executable(WorkingDirectory main.cxx) enable_testing() +set(EXECUTABLE_OUTPUT_PATH "${CMAKE_BINARY_DIR}/bin") + add_test(NAME WorkingDirectory1 COMMAND WorkingDirectory) add_test(NAME WorkingDirectory2 COMMAND WorkingDirectory) add_test(WorkingDirectory3 WorkingDirectory) @@ -21,8 +23,7 @@ set_tests_properties(WorkingDirectory2 PROPERTIES PASS_REGULAR_EXPRESSION "Working directory: -->${_parent_dir}<--" ) -string(REGEX REPLACE "/[^/]*$" "" _wd_exe "${CMAKE_BINARY_DIR}") -get_filename_component(_default_cwd "${_wd_exe}" ABSOLUTE) +get_filename_component(_default_cwd "${EXECUTABLE_OUTPUT_PATH}" PATH) set_tests_properties(WorkingDirectory3 PROPERTIES PASS_REGULAR_EXPRESSION "Working directory: -->${_default_cwd}<--" @@ -42,9 +43,6 @@ set_tests_properties(WorkingDirectory5 PROPERTIES PASS_REGULAR_EXPRESSION "Working directory: -->${_parent_dir}<--" ) -string(REGEX REPLACE "/[^/]*$" "" _wd_exe "${CMAKE_BINARY_DIR}") -get_filename_component(_default_cwd "${_wd_exe}" ABSOLUTE) - set_tests_properties(WorkingDirectory6 PROPERTIES PASS_REGULAR_EXPRESSION "Working directory: -->${_default_cwd}<--" ) |