diff options
Diffstat (limited to 'Tests/ObjectLibrary/A/CMakeLists.txt')
-rw-r--r-- | Tests/ObjectLibrary/A/CMakeLists.txt | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/Tests/ObjectLibrary/A/CMakeLists.txt b/Tests/ObjectLibrary/A/CMakeLists.txt index 3fba9f8167..c24c5ed92e 100644 --- a/Tests/ObjectLibrary/A/CMakeLists.txt +++ b/Tests/ObjectLibrary/A/CMakeLists.txt @@ -11,5 +11,16 @@ add_custom_command( ${CMAKE_CURRENT_BINARY_DIR}/a1.c ) -add_library(A OBJECT a1.c a2.c) +# Remove the custom command output to be sure it runs in an +# incremental test. Skip this on VS 6 because it sometimes +# re-runs CMake after the custom command runs. +if(NOT CMAKE_GENERATOR STREQUAL "Visual Studio 6") + file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/a.cmake) +endif() +add_custom_command( + OUTPUT a.cmake + COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/a.cmake + ) + +add_library(A OBJECT a1.c a2.c a.cmake) target_include_directories(A PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) |