summaryrefslogtreecommitdiffstats
path: root/Tests/BuildDepends/CMakeLists.txt
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2012-11-13 19:31:54 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2012-11-13 19:31:54 (GMT)
commit035c29fee4b74fcd9146941193f88670dfa0e437 (patch)
tree3932a74dec5dfdd18e42a9e34b9993c712061ad8 /Tests/BuildDepends/CMakeLists.txt
parent87b8487d149ac4fcf081bee6871f4f04a096b0b6 (diff)
parent306796e86206f2b6cf0bd3b66735f2e825c6bcbd (diff)
downloadCMake-035c29fee4b74fcd9146941193f88670dfa0e437.zip
CMake-035c29fee4b74fcd9146941193f88670dfa0e437.tar.gz
CMake-035c29fee4b74fcd9146941193f88670dfa0e437.tar.bz2
Merge topic 'link-depends-no-shared'
306796e Teach BuildDepends test to cover LINK_DEPENDS_NO_SHARED ed97631 Optionally skip link dependencies on shared library files
Diffstat (limited to 'Tests/BuildDepends/CMakeLists.txt')
-rw-r--r--Tests/BuildDepends/CMakeLists.txt34
1 files changed, 34 insertions, 0 deletions
diff --git a/Tests/BuildDepends/CMakeLists.txt b/Tests/BuildDepends/CMakeLists.txt
index 2a70b6e..2792751 100644
--- a/Tests/BuildDepends/CMakeLists.txt
+++ b/Tests/BuildDepends/CMakeLists.txt
@@ -60,6 +60,12 @@ file(WRITE ${BuildDepends_BINARY_DIR}/Project/zot_macro_dir.hxx
file(WRITE ${BuildDepends_BINARY_DIR}/Project/zot_macro_tgt.hxx
"static const char* zot_macro_tgt = \"zot_macro_tgt\";\n")
+file(WRITE ${BuildDepends_BINARY_DIR}/Project/link_depends_no_shared_lib.h
+ "#define link_depends_no_shared_lib_value 1\n")
+file(WRITE ${BuildDepends_BINARY_DIR}/Project/link_depends_no_shared_exe.h
+ "#define link_depends_no_shared_exe_value 0\n")
+set(link_depends_no_shared_check_txt ${BuildDepends_BINARY_DIR}/Project/link_depends_no_shared_check.txt)
+
help_xcode_depends()
message("Building project first time")
@@ -125,6 +131,19 @@ else()
message(SEND_ERROR "Project did not initially build properly: ${out}")
endif()
+if(EXISTS "${link_depends_no_shared_check_txt}")
+ file(STRINGS "${link_depends_no_shared_check_txt}" link_depends_no_shared_check LIMIT_COUNT 1)
+ if("${link_depends_no_shared_check}" STREQUAL "1")
+ message(STATUS "link_depends_no_shared_exe is newer than link_depends_no_shared_lib as expected.")
+ else()
+ message(SEND_ERROR "Project did not initially build properly: "
+ "link_depends_no_shared_exe is older than link_depends_no_shared_lib.")
+ endif()
+else()
+ message(SEND_ERROR "Project did not initially build properly: "
+ "Targets link_depends_no_shared_lib and link_depends_no_shared_exe not both built.")
+endif()
+
message("Waiting 3 seconds...")
# any additional argument will cause ${bar} to wait forever
execute_process(COMMAND ${bar} -infinite TIMEOUT 3 OUTPUT_VARIABLE out)
@@ -141,6 +160,9 @@ file(WRITE ${BuildDepends_BINARY_DIR}/Project/zot_macro_dir.hxx
file(WRITE ${BuildDepends_BINARY_DIR}/Project/zot_macro_tgt.hxx
"static const char* zot_macro_tgt = \"zot_macro_tgt changed\";\n")
+file(WRITE ${BuildDepends_BINARY_DIR}/Project/link_depends_no_shared_lib.h
+ "#define link_depends_no_shared_lib_value 0\n")
+
if(TEST_LINK_DEPENDS)
file(WRITE ${TEST_LINK_DEPENDS} "2")
endif()
@@ -219,3 +241,15 @@ is not newer than dependency
")
endif()
endif()
+
+if(EXISTS "${link_depends_no_shared_check_txt}")
+ file(STRINGS "${link_depends_no_shared_check_txt}" link_depends_no_shared_check LIMIT_COUNT 1)
+ if("${link_depends_no_shared_check}" STREQUAL "0")
+ message(STATUS "link_depends_no_shared_exe is older than link_depends_no_shared_lib as expected.")
+ else()
+ message(SEND_ERROR "Project did not rebuild properly: link_depends_no_shared_exe is newer than link_depends_no_shared_lib.")
+ endif()
+else()
+ message(SEND_ERROR "Project did not rebuild properly. "
+ "Targets link_depends_no_shared_lib and link_depends_no_shared_exe not both built.")
+endif()