[Cmake-commits] CMake branch, next, updated. v2.8.6-1686-g62000f6
Brad King
brad.king at kitware.com
Tue Oct 25 08:41:48 EDT 2011
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via 62000f6cc45126c799634e41344b766e37255fe3 (commit)
via 347677b9795e062a0e6fb58b7c9dc38cd79626d1 (commit)
via 5bcb9b9f732478cce94b4ea43c913c7fdb518f5b (commit)
via 91335c3641e7378ae7be8d177ebc72387be942c0 (commit)
via fd01e56c49cce26ba207ab1d0bad107404fc7dde (commit)
via fd2317aabd2c27f1da9386d779ccd9452bc0bc24 (commit)
via 05d0f96e426f77aee9c88956121ca21cef6c456f (commit)
via 18926094a7d3c87f52db32f160c4468e0056517b (commit)
via 772e351087638d354c3d67670916270db70399d4 (commit)
via 548e24559a64293873444fff5b7ecf3f7755d9a4 (commit)
via 2d97eee648862012747af1ce966342fa120a44ee (commit)
via 874acbface709d5fa49587b636b5404b7c92361f (commit)
via 622b20e277e4542d992f432e3bb7d38989fab908 (commit)
via 2024585bdc6d8fa967206cd5dfc95f73223e0198 (commit)
via a70b8f5cd36352a0ebfa474360c41b8ce7932b57 (commit)
via df6f44618bcfd0b1ce07f53b7f2b8452cf9e0520 (commit)
via 72cfee061a3d523f3f97cc5ac7fedeec8e03317c (commit)
via 78f2890a7955831a17dad505a4934b6b13cdb7a2 (commit)
via 381dc399554f9050f5911e3e4a70afa7d7cb5b77 (commit)
via dadec9893118e0c74f24377750cc04ccbc2e9f99 (commit)
via c69a7a65e1b95a0043c550c6b6b4b1c7c5275f27 (commit)
via daa761fcdec9dd121925e05c6974b2a675f98608 (commit)
via a1fe4c7d39c3da7f2d4b0dbf2a911e93ee8f3ffe (commit)
via 9b36fb915986cfc061391a90133e221b03af53dc (commit)
via 537403ab024916a3b118372f06e34053f0e4f94a (commit)
via 68f16263627072db3a771a4072bb2ac98f68b7b1 (commit)
via d9cbba7c2cd364a19b42cd856f5d048deb92b415 (commit)
from 9602ac7636b79fc71727558ede2838ccf7d04dbc (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=62000f6cc45126c799634e41344b766e37255fe3
commit 62000f6cc45126c799634e41344b766e37255fe3
Merge: 9602ac7 347677b
Author: Brad King <brad.king at kitware.com>
AuthorDate: Tue Oct 25 08:41:44 2011 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Oct 25 08:41:44 2011 -0400
Merge topic 'test-target_link_libraries' into next
347677b Make it easy to see platforms not running these tests.
5bcb9b9 Don't run any more tests if building the libraries fails.
91335c3 Add a control point to the unit test.
fd01e56 Start enabling these tests only on non-APPLE.
fd2317a Start enabling these tests so we can find out why they cause failures.
05d0f96 Add linker flag instead of definition.
1892609 Add tests for the --no-undefined flag with shared and static libs.
772e351 Add newlines to ends of files.
548e245 Quote everything to avoid space in directory name errors.
2d97eee Split the test source into libs and executable.
874acbf Make some long lines less long.
622b20e Enable verbose makefile so I can see why tests are failing
2024585 Disable the use of -Wl,--no-undefined
a70b8f5 Add check for -Wl,--no-undefined
df6f446 These tests don't work on many platforms.
72cfee0 Move the dummy executable creation to the top.
78f2890 Don't test for failure on APPLE.
381dc39 Explicitly exclude apple from use of this linker flag.
dadec98 Comment test on Windows.
c69a7a6 Make the project name agree with the directory name.
daa761f Export symbols from the test libraries.
a1fe4c7 Maybe fix on Windows.
9b36fb9 Test for features, not platforms.
537403a Fix build on non-GNU.
68f1626 Test target_link_libraries command explicitly
d9cbba7 Initialize LINK_INTERFACE_LIBRARIES target property with a variable
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=347677b9795e062a0e6fb58b7c9dc38cd79626d1
commit 347677b9795e062a0e6fb58b7c9dc38cd79626d1
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Oct 16 12:40:29 2011 +0200
Commit: Brad King <brad.king at kitware.com>
CommitDate: Mon Oct 24 16:18:45 2011 -0400
Make it easy to see platforms not running these tests.
diff --git a/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
index 69bc52d..3f61ebc 100644
--- a/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
+++ b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
@@ -20,6 +20,7 @@ try_compile(LINK_INTERFACE_LIBRARIES_FAILS
)
if (LINK_INTERFACE_LIBRARIES_FAILS)
+ message("\n\n#######################\nTHIS PLATFORM DOES NOT SUPPORT LINK_INTERFACE_LIBRARIES\n\n")
return()
endif()
@@ -79,6 +80,7 @@ foreach(B1 ${Bools})
if (NOT Result)
message("Libs CLEAR_LINK_INTERFACE_LIBRARIES: ${B1}\n"
"Libs SPECIFY_LINK_INTERFACE_LIBRARIES: ${B2}\n\n\n${Out}")
+ message("\n\n#######################\nTHIS PLATFORM DOES NOT SUPPORT LINK_INTERFACE_LIBRARIES\n\n")
return()
endif()
endforeach()
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5bcb9b9f732478cce94b4ea43c913c7fdb518f5b
commit 5bcb9b9f732478cce94b4ea43c913c7fdb518f5b
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Oct 16 12:38:15 2011 +0200
Commit: Brad King <brad.king at kitware.com>
CommitDate: Mon Oct 24 16:18:45 2011 -0400
Don't run any more tests if building the libraries fails.
diff --git a/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
index 534cc38..69bc52d 100644
--- a/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
+++ b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
@@ -79,6 +79,7 @@ foreach(B1 ${Bools})
if (NOT Result)
message("Libs CLEAR_LINK_INTERFACE_LIBRARIES: ${B1}\n"
"Libs SPECIFY_LINK_INTERFACE_LIBRARIES: ${B2}\n\n\n${Out}")
+ return()
endif()
endforeach()
endforeach()
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=91335c3641e7378ae7be8d177ebc72387be942c0
commit 91335c3641e7378ae7be8d177ebc72387be942c0
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Oct 13 22:42:01 2011 +0200
Commit: Brad King <brad.king at kitware.com>
CommitDate: Mon Oct 24 16:18:45 2011 -0400
Add a control point to the unit test.
We only test on platforms where LINK_INTERFACE_LIBRARIES works.
diff --git a/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
index 69a94bd..534cc38 100644
--- a/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
+++ b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
@@ -13,6 +13,16 @@ add_executable(
"${CMAKE_CURRENT_BINARY_DIR}/main.cxx"
)
+try_compile(LINK_INTERFACE_LIBRARIES_FAILS
+ "${CMAKE_CURRENT_BINARY_DIR}/control_point"
+ "${CMAKE_CURRENT_SOURCE_DIR}/control_point"
+ control_point
+)
+
+if (LINK_INTERFACE_LIBRARIES_FAILS)
+ return()
+endif()
+
set(Bools True False)
foreach(B1 ${Bools})
diff --git a/Tests/CMakeCommands/target_link_libraries/control_point/CMakeLists.txt b/Tests/CMakeCommands/target_link_libraries/control_point/CMakeLists.txt
new file mode 100644
index 0000000..e41c3f1
--- /dev/null
+++ b/Tests/CMakeCommands/target_link_libraries/control_point/CMakeLists.txt
@@ -0,0 +1,24 @@
+cmake_minimum_required(VERSION 2.8)
+
+project(src)
+
+include(CheckCXXCompilerFlag)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+set(CMAKE_VERBOSE_MAKEFILE ON)
+
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
+
+add_subdirectory(lib)
+
+include_directories(
+ "${CMAKE_CURRENT_SOURCE_DIR}/lib"
+ "${CMAKE_CURRENT_BINARY_DIR}/lib"
+)
+
+
+add_executable(exec
+ "main.cpp"
+)
+
+target_link_libraries(exec libB )
diff --git a/Tests/CMakeCommands/target_link_libraries/control_point/lib/CMakeLists.txt b/Tests/CMakeCommands/target_link_libraries/control_point/lib/CMakeLists.txt
new file mode 100644
index 0000000..c0d1353
--- /dev/null
+++ b/Tests/CMakeCommands/target_link_libraries/control_point/lib/CMakeLists.txt
@@ -0,0 +1,22 @@
+cmake_minimum_required(VERSION 2.8)
+
+project(libs)
+
+include(CheckCXXCompilerFlag)
+include(GenerateExportHeader)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+set(CMAKE_VERBOSE_MAKEFILE ON)
+
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
+
+add_library(libA SHARED classA.cpp)
+add_library(libB SHARED classB.cpp)
+
+generate_export_header(libA)
+generate_export_header(libB)
+
+target_link_libraries(libB libA)
+
+target_link_libraries(libA LINK_INTERFACE_LIBRARIES "")
+target_link_libraries(libB LINK_INTERFACE_LIBRARIES "")
diff --git a/Tests/CMakeCommands/target_link_libraries/control_point/lib/classA.cpp b/Tests/CMakeCommands/target_link_libraries/control_point/lib/classA.cpp
new file mode 100644
index 0000000..f5e7106
--- /dev/null
+++ b/Tests/CMakeCommands/target_link_libraries/control_point/lib/classA.cpp
@@ -0,0 +1,7 @@
+
+#include "classA.h"
+
+classA::classA()
+{
+
+}
diff --git a/Tests/CMakeCommands/target_link_libraries/control_point/lib/classA.h b/Tests/CMakeCommands/target_link_libraries/control_point/lib/classA.h
new file mode 100644
index 0000000..4d568e3
--- /dev/null
+++ b/Tests/CMakeCommands/target_link_libraries/control_point/lib/classA.h
@@ -0,0 +1,13 @@
+
+#ifndef CLASS_A_H
+#define CLASS_A_H
+
+#include "liba_export.h"
+
+class LIBA_EXPORT classA
+{
+public:
+ classA();
+};
+
+#endif
diff --git a/Tests/CMakeCommands/target_link_libraries/control_point/lib/classB.cpp b/Tests/CMakeCommands/target_link_libraries/control_point/lib/classB.cpp
new file mode 100644
index 0000000..e309586
--- /dev/null
+++ b/Tests/CMakeCommands/target_link_libraries/control_point/lib/classB.cpp
@@ -0,0 +1,13 @@
+
+#include "classB.h"
+
+#include "classA.h"
+
+classB::classB()
+{
+}
+
+classA* classB::a() const
+{
+ return new classA();
+}
diff --git a/Tests/CMakeCommands/target_link_libraries/control_point/lib/classB.h b/Tests/CMakeCommands/target_link_libraries/control_point/lib/classB.h
new file mode 100644
index 0000000..e0baed6
--- /dev/null
+++ b/Tests/CMakeCommands/target_link_libraries/control_point/lib/classB.h
@@ -0,0 +1,17 @@
+
+#ifndef CLASS_B_H
+#define CLASS_B_H
+
+#include "libb_export.h"
+
+class classA;
+
+class LIBB_EXPORT classB
+{
+public:
+ classB();
+
+ classA* a() const;
+};
+
+#endif
diff --git a/Tests/CMakeCommands/target_link_libraries/control_point/main.cpp b/Tests/CMakeCommands/target_link_libraries/control_point/main.cpp
new file mode 100644
index 0000000..e5472cf
--- /dev/null
+++ b/Tests/CMakeCommands/target_link_libraries/control_point/main.cpp
@@ -0,0 +1,10 @@
+#include "classB.h"
+#include "classA.h"
+
+int main(int, char **) {
+
+ classB classB_;
+ classA classA_;
+
+ return 0;
+}
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fd01e56c49cce26ba207ab1d0bad107404fc7dde
commit fd01e56c49cce26ba207ab1d0bad107404fc7dde
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Oct 10 16:44:38 2011 +0200
Commit: Brad King <brad.king at kitware.com>
CommitDate: Mon Oct 24 16:18:45 2011 -0400
Start enabling these tests only on non-APPLE.
Now we know why tests fail on APPLE, we can check other platforms.
diff --git a/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
index 68a0f18..69a94bd 100644
--- a/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
+++ b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
@@ -229,7 +229,7 @@ expect_pass(False False
# However, if we do clear it and don't explicitly link the executable to it,
# it fails,
# whether we specify the link_interface_libraries properly or not.
-if (APPLE)
+if (NOT APPLE)
expect_fail(True False
classB classC
LIBS
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fd2317aabd2c27f1da9386d779ccd9452bc0bc24
commit fd2317aabd2c27f1da9386d779ccd9452bc0bc24
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Oct 10 16:44:38 2011 +0200
Commit: Brad King <brad.king at kitware.com>
CommitDate: Mon Oct 24 16:18:45 2011 -0400
Start enabling these tests so we can find out why they cause failures.
diff --git a/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
index 79c447e..68a0f18 100644
--- a/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
+++ b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
@@ -226,27 +226,22 @@ expect_pass(False False
libC
)
-# # However, if we do clear it and don't explicitly link the executable to it,
-# # it fails,
-# # whether we specify the link_interface_libraries properly or not.
-# if (NOT APPLE)
-# # Apparently this doesn't work on APPLE either.
-# # http://www.cdash.org/CDash/testDetails.php?test=117927753&build=1596834
-# if (NOT WIN32)
-# # This does not work on windows apparently
-# expect_fail(True False
-# classB classC
-# LIBS
-# libC
-# )
-# endif()
-#
-# expect_fail(True True
-# classB classC
-# LIBS
-# libC
-# )
-# endif()
+# However, if we do clear it and don't explicitly link the executable to it,
+# it fails,
+# whether we specify the link_interface_libraries properly or not.
+if (APPLE)
+ expect_fail(True False
+ classB classC
+ LIBS
+ libC
+ )
+ expect_fail(True True
+ classB classC
+ LIBS
+ libC
+ )
+endif()
+
# Then we can still link the executable to libA directly of course to pass
expect_pass(True False
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=05d0f96e426f77aee9c88956121ca21cef6c456f
commit 05d0f96e426f77aee9c88956121ca21cef6c456f
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Oct 9 11:43:39 2011 +0200
Commit: Brad King <brad.king at kitware.com>
CommitDate: Mon Oct 24 16:18:44 2011 -0400
Add linker flag instead of definition.
diff --git a/Tests/Module/CheckCXXCompilerFlag/shared_lib/CMakeLists.txt b/Tests/Module/CheckCXXCompilerFlag/shared_lib/CMakeLists.txt
index 5c0c2a1..8c7190a 100644
--- a/Tests/Module/CheckCXXCompilerFlag/shared_lib/CMakeLists.txt
+++ b/Tests/Module/CheckCXXCompilerFlag/shared_lib/CMakeLists.txt
@@ -8,5 +8,5 @@ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/input.cpp"
"int doNothing() { return 0; }\n"
)
-add_definitions(-Wl,--noundefined)
+set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined")
add_library(lib SHARED "${CMAKE_CURRENT_BINARY_DIR}/input.cpp")
diff --git a/Tests/Module/CheckCXXCompilerFlag/static_lib/CMakeLists.txt b/Tests/Module/CheckCXXCompilerFlag/static_lib/CMakeLists.txt
index c04b69f..36c208d 100644
--- a/Tests/Module/CheckCXXCompilerFlag/static_lib/CMakeLists.txt
+++ b/Tests/Module/CheckCXXCompilerFlag/static_lib/CMakeLists.txt
@@ -8,5 +8,6 @@ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/input.cpp"
"int doNothing() { return 0; }\n"
)
-add_definitions(-Wl,--noundefined)
+set(CMAKE_STATIC_LINKER_FLAGS "-Wl,--no-undefined")
+
add_library(lib "${CMAKE_CURRENT_BINARY_DIR}/input.cpp")
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=18926094a7d3c87f52db32f160c4468e0056517b
commit 18926094a7d3c87f52db32f160c4468e0056517b
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Oct 8 14:04:57 2011 +0200
Commit: Brad King <brad.king at kitware.com>
CommitDate: Mon Oct 24 16:18:44 2011 -0400
Add tests for the --no-undefined flag with shared and static libs.
diff --git a/Tests/Module/CheckCXXCompilerFlag/CMakeLists.txt b/Tests/Module/CheckCXXCompilerFlag/CMakeLists.txt
index ab934e4..7b56727 100644
--- a/Tests/Module/CheckCXXCompilerFlag/CMakeLists.txt
+++ b/Tests/Module/CheckCXXCompilerFlag/CMakeLists.txt
@@ -62,6 +62,27 @@ check_cxx_compiler_flag(-Wl,--no-undefined HAS_NO_UNDEFINED)
message("HAS_NO_UNDEFINED: ${HAS_NO_UNDEFINED}\n\nCOMPILE OUTPUT:\n${OUTPUT}")
+try_compile(HAS_NO_UNDEFINED_SHARED_LIB
+ "${CMAKE_CURRENT_BINARY_DIR}/shared_lib_build"
+ "${CMAKE_CURRENT_SOURCE_DIR}/shared_lib"
+ shared_lib
+ OUTPUT_VARIABLE Out
+)
+message("HAS_NO_UNDEFINED_SHARED_LIB: ${HAS_NO_UNDEFINED_SHARED_LIB}\n"
+ "\nCOMPILE OUTPUT:\n${Out}"
+)
+
+try_compile(HAS_NO_UNDEFINED_STATIC_LIB
+ "${CMAKE_CURRENT_BINARY_DIR}/static_lib_build"
+ "${CMAKE_CURRENT_SOURCE_DIR}/static_lib"
+ static_lib
+ OUTPUT_VARIABLE Out
+)
+message("HAS_NO_UNDEFINED_STATIC_LIB: ${HAS_NO_UNDEFINED_STATIC_LIB}\n"
+ "\nCOMPILE OUTPUT:\n${Out}"
+)
+
+
#
# This is a no-op executable... If this test is going to fail, it fails during
# the configure step while cmake is configuring this CMakeLists.txt file...
diff --git a/Tests/Module/CheckCXXCompilerFlag/shared_lib/CMakeLists.txt b/Tests/Module/CheckCXXCompilerFlag/shared_lib/CMakeLists.txt
new file mode 100644
index 0000000..5c0c2a1
--- /dev/null
+++ b/Tests/Module/CheckCXXCompilerFlag/shared_lib/CMakeLists.txt
@@ -0,0 +1,12 @@
+cmake_minimum_required(VERSION 2.8)
+
+project(shared_lib)
+
+set(CMAKE_VERBOSE_MAKEFILE ON)
+
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/input.cpp"
+ "int doNothing() { return 0; }\n"
+)
+
+add_definitions(-Wl,--noundefined)
+add_library(lib SHARED "${CMAKE_CURRENT_BINARY_DIR}/input.cpp")
diff --git a/Tests/Module/CheckCXXCompilerFlag/static_lib/CMakeLists.txt b/Tests/Module/CheckCXXCompilerFlag/static_lib/CMakeLists.txt
new file mode 100644
index 0000000..c04b69f
--- /dev/null
+++ b/Tests/Module/CheckCXXCompilerFlag/static_lib/CMakeLists.txt
@@ -0,0 +1,12 @@
+cmake_minimum_required(VERSION 2.8)
+
+project(static_lib)
+
+set(CMAKE_VERBOSE_MAKEFILE ON)
+
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/input.cpp"
+ "int doNothing() { return 0; }\n"
+)
+
+add_definitions(-Wl,--noundefined)
+add_library(lib "${CMAKE_CURRENT_BINARY_DIR}/input.cpp")
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=772e351087638d354c3d67670916270db70399d4
commit 772e351087638d354c3d67670916270db70399d4
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Oct 8 13:33:37 2011 +0200
Commit: Brad King <brad.king at kitware.com>
CommitDate: Mon Oct 24 16:18:44 2011 -0400
Add newlines to ends of files.
diff --git a/Tests/CMakeCommands/target_link_libraries/libs/classA.h b/Tests/CMakeCommands/target_link_libraries/libs/classA.h
index 0a83f88..4d568e3 100644
--- a/Tests/CMakeCommands/target_link_libraries/libs/classA.h
+++ b/Tests/CMakeCommands/target_link_libraries/libs/classA.h
@@ -10,4 +10,4 @@ public:
classA();
};
-#endif
\ No newline at end of file
+#endif
diff --git a/Tests/CMakeCommands/target_link_libraries/libs/classB.cpp b/Tests/CMakeCommands/target_link_libraries/libs/classB.cpp
index 86308a5..e309586 100644
--- a/Tests/CMakeCommands/target_link_libraries/libs/classB.cpp
+++ b/Tests/CMakeCommands/target_link_libraries/libs/classB.cpp
@@ -10,4 +10,4 @@ classB::classB()
classA* classB::a() const
{
return new classA();
-}
\ No newline at end of file
+}
diff --git a/Tests/CMakeCommands/target_link_libraries/libs/classB.h b/Tests/CMakeCommands/target_link_libraries/libs/classB.h
index 81e83fe..e0baed6 100644
--- a/Tests/CMakeCommands/target_link_libraries/libs/classB.h
+++ b/Tests/CMakeCommands/target_link_libraries/libs/classB.h
@@ -14,4 +14,4 @@ public:
classA* a() const;
};
-#endif
\ No newline at end of file
+#endif
diff --git a/Tests/CMakeCommands/target_link_libraries/libs/classC.cpp b/Tests/CMakeCommands/target_link_libraries/libs/classC.cpp
index 55ab9fc..6d15259 100644
--- a/Tests/CMakeCommands/target_link_libraries/libs/classC.cpp
+++ b/Tests/CMakeCommands/target_link_libraries/libs/classC.cpp
@@ -12,4 +12,4 @@ classC::classC()
classA* classC::a() const
{
return new classA();
-}
\ No newline at end of file
+}
diff --git a/Tests/CMakeCommands/target_link_libraries/libs/classC.h b/Tests/CMakeCommands/target_link_libraries/libs/classC.h
index 8dc929e..0135f65 100644
--- a/Tests/CMakeCommands/target_link_libraries/libs/classC.h
+++ b/Tests/CMakeCommands/target_link_libraries/libs/classC.h
@@ -14,4 +14,4 @@ public:
classA* a() const;
};
-#endif
\ No newline at end of file
+#endif
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=548e24559a64293873444fff5b7ecf3f7755d9a4
commit 548e24559a64293873444fff5b7ecf3f7755d9a4
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Oct 8 12:48:37 2011 +0200
Commit: Brad King <brad.king at kitware.com>
CommitDate: Mon Oct 24 16:18:44 2011 -0400
Quote everything to avoid space in directory name errors.
diff --git a/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
index 217634a..79c447e 100644
--- a/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
+++ b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
@@ -61,8 +61,8 @@ foreach(B1 ${Bools})
"export(TARGETS libA libB libC FILE Targets.cmake)\n"
)
- try_compile(Result ${CMAKE_CURRENT_BINARY_DIR}/libs_build_${B1}_${B2}
- ${CMAKE_CURRENT_BINARY_DIR}/libs_${B1}_${B2}
+ try_compile(Result "${CMAKE_CURRENT_BINARY_DIR}/libs_build_${B1}_${B2}"
+ "${CMAKE_CURRENT_BINARY_DIR}/libs_${B1}_${B2}"
libs
OUTPUT_VARIABLE Out
)
@@ -87,13 +87,13 @@ macro(_do_build CLEAR_LINK_INTERFACE_LIBRARIES
# Set local short variables to avoid long lines
set(B1 ${CLEAR_LINK_INTERFACE_LIBRARIES})
set(B2 ${SPECIFY_LINK_INTERFACE_LIBRARIES})
- set(Libs_Build_Dir ${CMAKE_CURRENT_BINARY_DIR}/libs_build_${B1}_${B2})
+ set(Libs_Build_Dir "${CMAKE_CURRENT_BINARY_DIR}/libs_build_${B1}_${B2}")
file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/test${COUNT}/CMakeLists.txt"
- "include_directories(${CMAKE_CURRENT_BINARY_DIR}/libs_${B1}_${B2}\n"
- " ${Libs_Build_Dir}\n"
+ "include_directories(\"${CMAKE_CURRENT_BINARY_DIR}/libs_${B1}_${B2}\"\n"
+ " \"${Libs_Build_Dir}\"\n"
")\n"
- "include(${Libs_Build_Dir}/Targets.cmake)\n"
+ "include(\"${Libs_Build_Dir}/Targets.cmake\")\n"
)
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/test${COUNT}/main.cpp"
@@ -154,8 +154,8 @@ macro(_do_build CLEAR_LINK_INTERFACE_LIBRARIES
")\n"
)
- try_compile(Result ${CMAKE_CURRENT_BINARY_DIR}/fail${COUNT}
- ${CMAKE_CURRENT_BINARY_DIR}/test${COUNT}
+ try_compile(Result "${CMAKE_CURRENT_BINARY_DIR}/fail${COUNT}"
+ "${CMAKE_CURRENT_BINARY_DIR}/test${COUNT}"
src
OUTPUT_VARIABLE Out
)
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2d97eee648862012747af1ce966342fa120a44ee
commit 2d97eee648862012747af1ce966342fa120a44ee
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Oct 8 12:09:24 2011 +0200
Commit: Brad King <brad.king at kitware.com>
CommitDate: Mon Oct 24 16:18:44 2011 -0400
Split the test source into libs and executable.
Allows building the libs only 4 times instead of 22 times.
Should help with timeout issues on the dashboard.
diff --git a/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
index ea49210..217634a 100644
--- a/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
+++ b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
@@ -13,6 +13,66 @@ add_executable(
"${CMAKE_CURRENT_BINARY_DIR}/main.cxx"
)
+set(Bools True False)
+
+foreach(B1 ${Bools})
+ foreach(B2 ${Bools})
+ execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory
+ "${CMAKE_CURRENT_SOURCE_DIR}/libs"
+ "${CMAKE_CURRENT_BINARY_DIR}/libs_${B1}_${B2}"
+ )
+ endforeach()
+endforeach()
+
+foreach(B1 ${Bools})
+ file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/libs_True_${B1}/CMakeLists.txt"
+ "set(CMAKE_LINK_INTERFACE_LIBRARIES \"\")\n"
+ )
+endforeach()
+
+foreach(B1 ${Bools})
+ foreach(B2 ${Bools})
+ file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/libs_${B1}_${B2}/CMakeLists.txt"
+
+ "add_library(libA SHARED classA.cpp)\n"
+ "add_library(libB SHARED classB.cpp)\n"
+ "add_library(libC SHARED classC.cpp)\n"
+
+ "generate_export_header(libA)\n"
+ "generate_export_header(libB)\n"
+ "generate_export_header(libC)\n"
+
+ "target_link_libraries(libB libA)\n"
+ "target_link_libraries(libC libA libB)\n"
+ )
+ endforeach()
+endforeach()
+
+foreach(B1 ${Bools})
+ file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/libs_${B1}_True/CMakeLists.txt"
+ "target_link_libraries(libB LINK_INTERFACE_LIBRARIES libA)\n"
+ "target_link_libraries(libC LINK_INTERFACE_LIBRARIES libA)\n"
+ )
+endforeach()
+
+foreach(B1 ${Bools})
+ foreach(B2 ${Bools})
+ file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/libs_${B1}_${B2}/CMakeLists.txt"
+ "export(TARGETS libA libB libC FILE Targets.cmake)\n"
+ )
+
+ try_compile(Result ${CMAKE_CURRENT_BINARY_DIR}/libs_build_${B1}_${B2}
+ ${CMAKE_CURRENT_BINARY_DIR}/libs_${B1}_${B2}
+ libs
+ OUTPUT_VARIABLE Out
+ )
+ if (NOT Result)
+ message("Libs CLEAR_LINK_INTERFACE_LIBRARIES: ${B1}\n"
+ "Libs SPECIFY_LINK_INTERFACE_LIBRARIES: ${B2}\n\n\n${Out}")
+ endif()
+ endforeach()
+endforeach()
+
set (COUNT 0)
macro(_do_build CLEAR_LINK_INTERFACE_LIBRARIES
@@ -24,11 +84,17 @@ macro(_do_build CLEAR_LINK_INTERFACE_LIBRARIES
"${CMAKE_CURRENT_BINARY_DIR}/test${COUNT}"
)
- if (${CLEAR_LINK_INTERFACE_LIBRARIES})
- file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/test${COUNT}/CMakeLists.txt"
- "set(CMAKE_LINK_INTERFACE_LIBRARIES \"\")\n"
- )
- endif()
+ # Set local short variables to avoid long lines
+ set(B1 ${CLEAR_LINK_INTERFACE_LIBRARIES})
+ set(B2 ${SPECIFY_LINK_INTERFACE_LIBRARIES})
+ set(Libs_Build_Dir ${CMAKE_CURRENT_BINARY_DIR}/libs_build_${B1}_${B2})
+
+ file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/test${COUNT}/CMakeLists.txt"
+ "include_directories(${CMAKE_CURRENT_BINARY_DIR}/libs_${B1}_${B2}\n"
+ " ${Libs_Build_Dir}\n"
+ ")\n"
+ "include(${Libs_Build_Dir}/Targets.cmake)\n"
+ )
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/test${COUNT}/main.cpp"
""
@@ -63,31 +129,11 @@ macro(_do_build CLEAR_LINK_INTERFACE_LIBRARIES
file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/test${COUNT}/CMakeLists.txt"
- "add_library(libA SHARED classA.cpp)\n"
- "add_library(libB SHARED classB.cpp)\n"
- "add_library(libC SHARED classC.cpp)\n"
-
- "generate_export_header(libA)\n"
- "generate_export_header(libB)\n"
- "generate_export_header(libC)\n"
-
"add_executable(exec \n"
"\"${CMAKE_CURRENT_BINARY_DIR}/test${COUNT}/main.cpp\")\n"
)
file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/test${COUNT}/CMakeLists.txt"
- "target_link_libraries(libB libA)\n"
- "target_link_libraries(libC libA libB)\n"
- )
-
- if (${SPECIFY_LINK_INTERFACE_LIBRARIES})
- file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/test${COUNT}/CMakeLists.txt"
- "target_link_libraries(libB LINK_INTERFACE_LIBRARIES libA)\n"
- "target_link_libraries(libC LINK_INTERFACE_LIBRARIES libA)\n"
- )
- endif()
-
- file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/test${COUNT}/CMakeLists.txt"
"target_link_libraries(exec "
)
diff --git a/Tests/CMakeCommands/target_link_libraries/src/CMakeLists.txt b/Tests/CMakeCommands/target_link_libraries/libs/CMakeLists.txt
similarity index 97%
copy from Tests/CMakeCommands/target_link_libraries/src/CMakeLists.txt
copy to Tests/CMakeCommands/target_link_libraries/libs/CMakeLists.txt
index d7ed3a2..e32d2cb 100644
--- a/Tests/CMakeCommands/target_link_libraries/src/CMakeLists.txt
+++ b/Tests/CMakeCommands/target_link_libraries/libs/CMakeLists.txt
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 2.8)
-project(src)
+project(libs)
include(CheckCXXCompilerFlag)
include(GenerateExportHeader)
diff --git a/Tests/CMakeCommands/target_link_libraries/src/classA.cpp b/Tests/CMakeCommands/target_link_libraries/libs/classA.cpp
similarity index 100%
rename from Tests/CMakeCommands/target_link_libraries/src/classA.cpp
rename to Tests/CMakeCommands/target_link_libraries/libs/classA.cpp
diff --git a/Tests/CMakeCommands/target_link_libraries/src/classA.h b/Tests/CMakeCommands/target_link_libraries/libs/classA.h
similarity index 100%
rename from Tests/CMakeCommands/target_link_libraries/src/classA.h
rename to Tests/CMakeCommands/target_link_libraries/libs/classA.h
diff --git a/Tests/CMakeCommands/target_link_libraries/src/classB.cpp b/Tests/CMakeCommands/target_link_libraries/libs/classB.cpp
similarity index 100%
rename from Tests/CMakeCommands/target_link_libraries/src/classB.cpp
rename to Tests/CMakeCommands/target_link_libraries/libs/classB.cpp
diff --git a/Tests/CMakeCommands/target_link_libraries/src/classB.h b/Tests/CMakeCommands/target_link_libraries/libs/classB.h
similarity index 100%
rename from Tests/CMakeCommands/target_link_libraries/src/classB.h
rename to Tests/CMakeCommands/target_link_libraries/libs/classB.h
diff --git a/Tests/CMakeCommands/target_link_libraries/src/classC.cpp b/Tests/CMakeCommands/target_link_libraries/libs/classC.cpp
similarity index 100%
rename from Tests/CMakeCommands/target_link_libraries/src/classC.cpp
rename to Tests/CMakeCommands/target_link_libraries/libs/classC.cpp
diff --git a/Tests/CMakeCommands/target_link_libraries/src/classC.h b/Tests/CMakeCommands/target_link_libraries/libs/classC.h
similarity index 100%
rename from Tests/CMakeCommands/target_link_libraries/src/classC.h
rename to Tests/CMakeCommands/target_link_libraries/libs/classC.h
diff --git a/Tests/CMakeCommands/target_link_libraries/src/CMakeLists.txt b/Tests/CMakeCommands/target_link_libraries/src/CMakeLists.txt
index d7ed3a2..29f0986 100644
--- a/Tests/CMakeCommands/target_link_libraries/src/CMakeLists.txt
+++ b/Tests/CMakeCommands/target_link_libraries/src/CMakeLists.txt
@@ -3,14 +3,6 @@ cmake_minimum_required(VERSION 2.8)
project(src)
include(CheckCXXCompilerFlag)
-include(GenerateExportHeader)
-
-check_cxx_compiler_flag(-Wl,--no-undefined HAS_NO_UNDEFINED)
-
-if (HAS_NO_UNDEFINED AND NOT APPLE)
- # Disabled while figuring out why the check above gives a false positive.
-# set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined")
-endif()
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_VERBOSE_MAKEFILE ON)
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=874acbface709d5fa49587b636b5404b7c92361f
commit 874acbface709d5fa49587b636b5404b7c92361f
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Oct 7 20:03:34 2011 +0200
Commit: Brad King <brad.king at kitware.com>
CommitDate: Mon Oct 24 16:18:44 2011 -0400
Make some long lines less long.
diff --git a/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
index 0ff1a16..ea49210 100644
--- a/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
+++ b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
@@ -15,10 +15,14 @@ add_executable(
set (COUNT 0)
-macro(_do_build CLEAR_LINK_INTERFACE_LIBRARIES SPECIFY_LINK_INTERFACE_LIBRARIES)
+macro(_do_build CLEAR_LINK_INTERFACE_LIBRARIES
+ SPECIFY_LINK_INTERFACE_LIBRARIES)
math(EXPR COUNT "${COUNT} + 1" )
- execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/src" "${CMAKE_CURRENT_BINARY_DIR}/test${COUNT}")
+ execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory
+ "${CMAKE_CURRENT_SOURCE_DIR}/src"
+ "${CMAKE_CURRENT_BINARY_DIR}/test${COUNT}"
+ )
if (${CLEAR_LINK_INTERFACE_LIBRARIES})
file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/test${COUNT}/CMakeLists.txt"
@@ -67,7 +71,8 @@ macro(_do_build CLEAR_LINK_INTERFACE_LIBRARIES SPECIFY_LINK_INTERFACE_LIBRARIES)
"generate_export_header(libB)\n"
"generate_export_header(libC)\n"
- "add_executable(exec \"${CMAKE_CURRENT_BINARY_DIR}/test${COUNT}/main.cpp\")\n"
+ "add_executable(exec \n"
+ "\"${CMAKE_CURRENT_BINARY_DIR}/test${COUNT}/main.cpp\")\n"
)
file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/test${COUNT}/CMakeLists.txt"
@@ -156,8 +161,9 @@ all_pass(
libA libB libC
)
-# If we don't set the CMAKE_LINK_INTERFACE_LIBRARIES to empty and we don't explicitly
-# specify the LINK_INTERFACE_LIBRARIES, the executable can use all classes if linked
+# If we don't set the CMAKE_LINK_INTERFACE_LIBRARIES to empty and
+# we don't explicitly specify the LINK_INTERFACE_LIBRARIES, the
+# executable can use all classes if linked
# indirectly to them
expect_pass(False False
classA classB
@@ -165,7 +171,8 @@ expect_pass(False False
libB
)
-# Although libC is linked to libA, libA is not part of the link interface of libC.
+# Although libC is linked to libA, libA is not part of the link interface of
+# libC.
# Because we don't clear the CMAKE_LINK_INTERFACE_LIBRARIES it still works.
expect_pass(False False
classA classC
@@ -173,7 +180,8 @@ expect_pass(False False
libC
)
-# # However, if we do clear it and don't explicitly link the executable to it, it fails,
+# # However, if we do clear it and don't explicitly link the executable to it,
+# # it fails,
# # whether we specify the link_interface_libraries properly or not.
# if (NOT APPLE)
# # Apparently this doesn't work on APPLE either.
@@ -206,8 +214,8 @@ expect_pass(True True
libC libA
)
-# Also, if we clear and specify the link interface, we can use classes defined in
-# that interface without linking to the library directly
+# Also, if we clear and specify the link interface, we can use classes defined
+# in that interface without linking to the library directly
expect_pass(True True
classA classB
LIBS
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=622b20e277e4542d992f432e3bb7d38989fab908
commit 622b20e277e4542d992f432e3bb7d38989fab908
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Oct 7 19:51:24 2011 +0200
Commit: Brad King <brad.king at kitware.com>
CommitDate: Mon Oct 24 16:18:44 2011 -0400
Enable verbose makefile so I can see why tests are failing
diff --git a/Tests/CMakeCommands/target_link_libraries/src/CMakeLists.txt b/Tests/CMakeCommands/target_link_libraries/src/CMakeLists.txt
index 8c79b5b..d7ed3a2 100644
--- a/Tests/CMakeCommands/target_link_libraries/src/CMakeLists.txt
+++ b/Tests/CMakeCommands/target_link_libraries/src/CMakeLists.txt
@@ -13,5 +13,6 @@ if (HAS_NO_UNDEFINED AND NOT APPLE)
endif()
set(CMAKE_INCLUDE_CURRENT_DIR ON)
+set(CMAKE_VERBOSE_MAKEFILE ON)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2024585bdc6d8fa967206cd5dfc95f73223e0198
commit 2024585bdc6d8fa967206cd5dfc95f73223e0198
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Oct 7 17:00:04 2011 +0200
Commit: Brad King <brad.king at kitware.com>
CommitDate: Mon Oct 24 16:18:44 2011 -0400
Disable the use of -Wl,--no-undefined
It's causing some noisy failures.
diff --git a/Tests/CMakeCommands/target_link_libraries/src/CMakeLists.txt b/Tests/CMakeCommands/target_link_libraries/src/CMakeLists.txt
index 5411226..8c79b5b 100644
--- a/Tests/CMakeCommands/target_link_libraries/src/CMakeLists.txt
+++ b/Tests/CMakeCommands/target_link_libraries/src/CMakeLists.txt
@@ -8,7 +8,8 @@ include(GenerateExportHeader)
check_cxx_compiler_flag(-Wl,--no-undefined HAS_NO_UNDEFINED)
if (HAS_NO_UNDEFINED AND NOT APPLE)
- set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined")
+ # Disabled while figuring out why the check above gives a false positive.
+# set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined")
endif()
set(CMAKE_INCLUDE_CURRENT_DIR ON)
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a70b8f5cd36352a0ebfa474360c41b8ce7932b57
commit a70b8f5cd36352a0ebfa474360c41b8ce7932b57
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Oct 7 16:54:31 2011 +0200
Commit: Brad King <brad.king at kitware.com>
CommitDate: Mon Oct 24 16:18:44 2011 -0400
Add check for -Wl,--no-undefined
Hopefully we can extract more compiler warnings from it.
diff --git a/Tests/Module/CheckCXXCompilerFlag/CMakeLists.txt b/Tests/Module/CheckCXXCompilerFlag/CMakeLists.txt
index 77f5006..ab934e4 100644
--- a/Tests/Module/CheckCXXCompilerFlag/CMakeLists.txt
+++ b/Tests/Module/CheckCXXCompilerFlag/CMakeLists.txt
@@ -57,6 +57,11 @@ else()
message("Unhandled Platform")
endif()
+
+check_cxx_compiler_flag(-Wl,--no-undefined HAS_NO_UNDEFINED)
+
+message("HAS_NO_UNDEFINED: ${HAS_NO_UNDEFINED}\n\nCOMPILE OUTPUT:\n${OUTPUT}")
+
#
# This is a no-op executable... If this test is going to fail, it fails during
# the configure step while cmake is configuring this CMakeLists.txt file...
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=df6f44618bcfd0b1ce07f53b7f2b8452cf9e0520
commit df6f44618bcfd0b1ce07f53b7f2b8452cf9e0520
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Oct 6 10:36:48 2011 +0200
Commit: Brad King <brad.king at kitware.com>
CommitDate: Mon Oct 24 16:18:44 2011 -0400
These tests don't work on many platforms.
diff --git a/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
index 2396bc0..0ff1a16 100644
--- a/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
+++ b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
@@ -173,26 +173,26 @@ expect_pass(False False
libC
)
-# However, if we do clear it and don't explicitly link the executable to it, it fails,
-# whether we specify the link_interface_libraries properly or not.
-if (NOT APPLE)
- # Apparently this doesn't work on APPLE either.
- # http://www.cdash.org/CDash/testDetails.php?test=117927753&build=1596834
- if (NOT WIN32)
- # This does not work on windows apparently
- expect_fail(True False
- classB classC
- LIBS
- libC
- )
- endif()
-
- expect_fail(True True
- classB classC
- LIBS
- libC
- )
-endif()
+# # However, if we do clear it and don't explicitly link the executable to it, it fails,
+# # whether we specify the link_interface_libraries properly or not.
+# if (NOT APPLE)
+# # Apparently this doesn't work on APPLE either.
+# # http://www.cdash.org/CDash/testDetails.php?test=117927753&build=1596834
+# if (NOT WIN32)
+# # This does not work on windows apparently
+# expect_fail(True False
+# classB classC
+# LIBS
+# libC
+# )
+# endif()
+#
+# expect_fail(True True
+# classB classC
+# LIBS
+# libC
+# )
+# endif()
# Then we can still link the executable to libA directly of course to pass
expect_pass(True False
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=72cfee061a3d523f3f97cc5ac7fedeec8e03317c
commit 72cfee061a3d523f3f97cc5ac7fedeec8e03317c
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Oct 6 10:36:02 2011 +0200
Commit: Brad King <brad.king at kitware.com>
CommitDate: Mon Oct 24 16:18:43 2011 -0400
Move the dummy executable creation to the top.
diff --git a/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
index 41224d0..2396bc0 100644
--- a/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
+++ b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
@@ -2,6 +2,18 @@ cmake_minimum_required(VERSION 2.8)
project(target_link_libraries)
+file(WRITE
+ "${CMAKE_CURRENT_BINARY_DIR}/main.cxx"
+ "int main() { return 0; }
+"
+)
+
+add_executable(
+ target_link_libraries
+ "${CMAKE_CURRENT_BINARY_DIR}/main.cxx"
+)
+
+
set (COUNT 0)
macro(_do_build CLEAR_LINK_INTERFACE_LIBRARIES SPECIFY_LINK_INTERFACE_LIBRARIES)
math(EXPR COUNT "${COUNT} + 1" )
@@ -207,14 +219,3 @@ expect_pass(True True
LIBS
libC
)
-
-file(WRITE
- "${CMAKE_CURRENT_BINARY_DIR}/main.cxx"
- "int main() { return 0; }
-"
-)
-
-add_executable(
- target_link_libraries
- "${CMAKE_CURRENT_BINARY_DIR}/main.cxx"
-)
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=78f2890a7955831a17dad505a4934b6b13cdb7a2
commit 78f2890a7955831a17dad505a4934b6b13cdb7a2
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Oct 5 18:00:24 2011 +0200
Commit: Brad King <brad.king at kitware.com>
CommitDate: Mon Oct 24 16:18:43 2011 -0400
Don't test for failure on APPLE.
This fails for a reason I do not know because I'm not familiar with Apple.
diff --git a/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
index 94029bf..41224d0 100644
--- a/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
+++ b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
@@ -163,20 +163,24 @@ expect_pass(False False
# However, if we do clear it and don't explicitly link the executable to it, it fails,
# whether we specify the link_interface_libraries properly or not.
-if (NOT WIN32)
- # ... but not on windows apparently
- expect_fail(True False
- classB classC
- LIBS
- libC
-)
-endif()
+if (NOT APPLE)
+ # Apparently this doesn't work on APPLE either.
+ # http://www.cdash.org/CDash/testDetails.php?test=117927753&build=1596834
+ if (NOT WIN32)
+ # This does not work on windows apparently
+ expect_fail(True False
+ classB classC
+ LIBS
+ libC
+ )
+ endif()
-expect_fail(True True
- classB classC
- LIBS
- libC
-)
+ expect_fail(True True
+ classB classC
+ LIBS
+ libC
+ )
+endif()
# Then we can still link the executable to libA directly of course to pass
expect_pass(True False
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=381dc399554f9050f5911e3e4a70afa7d7cb5b77
commit 381dc399554f9050f5911e3e4a70afa7d7cb5b77
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Oct 5 17:14:57 2011 +0200
Commit: Brad King <brad.king at kitware.com>
CommitDate: Mon Oct 24 16:18:43 2011 -0400
Explicitly exclude apple from use of this linker flag.
The check for this flag seems to pass on Apple, and then fail later.
diff --git a/Tests/CMakeCommands/target_link_libraries/src/CMakeLists.txt b/Tests/CMakeCommands/target_link_libraries/src/CMakeLists.txt
index 22e6b29..5411226 100644
--- a/Tests/CMakeCommands/target_link_libraries/src/CMakeLists.txt
+++ b/Tests/CMakeCommands/target_link_libraries/src/CMakeLists.txt
@@ -7,7 +7,7 @@ include(GenerateExportHeader)
check_cxx_compiler_flag(-Wl,--no-undefined HAS_NO_UNDEFINED)
-if (HAS_NO_UNDEFINED)
+if (HAS_NO_UNDEFINED AND NOT APPLE)
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined")
endif()
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dadec9893118e0c74f24377750cc04ccbc2e9f99
commit dadec9893118e0c74f24377750cc04ccbc2e9f99
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Oct 5 17:07:43 2011 +0200
Commit: Brad King <brad.king at kitware.com>
CommitDate: Mon Oct 24 16:18:43 2011 -0400
Comment test on Windows.
Fails on my system. This is a central unit test for this feature.
Need to find out later why it fails.
diff --git a/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
index abaface..94029bf 100644
--- a/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
+++ b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
@@ -163,11 +163,15 @@ expect_pass(False False
# However, if we do clear it and don't explicitly link the executable to it, it fails,
# whether we specify the link_interface_libraries properly or not.
-expect_fail(True False
+if (NOT WIN32)
+ # ... but not on windows apparently
+ expect_fail(True False
classB classC
LIBS
libC
)
+endif()
+
expect_fail(True True
classB classC
LIBS
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c69a7a65e1b95a0043c550c6b6b4b1c7c5275f27
commit c69a7a65e1b95a0043c550c6b6b4b1c7c5275f27
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Oct 5 17:06:15 2011 +0200
Commit: Brad King <brad.king at kitware.com>
CommitDate: Mon Oct 24 16:18:43 2011 -0400
Make the project name agree with the directory name.
Might help the solution file based cdash failures.
diff --git a/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
index b7bb42f..abaface 100644
--- a/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
+++ b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 2.8)
-project(target_link_libraries_test)
+project(target_link_libraries)
set (COUNT 0)
macro(_do_build CLEAR_LINK_INTERFACE_LIBRARIES SPECIFY_LINK_INTERFACE_LIBRARIES)
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=daa761fcdec9dd121925e05c6974b2a675f98608
commit daa761fcdec9dd121925e05c6974b2a675f98608
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Oct 5 15:51:46 2011 +0200
Commit: Brad King <brad.king at kitware.com>
CommitDate: Mon Oct 24 16:18:43 2011 -0400
Export symbols from the test libraries.
Hopefully fix continuous builds.
diff --git a/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
index 8a06cf0..b7bb42f 100644
--- a/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
+++ b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
@@ -51,6 +51,10 @@ macro(_do_build CLEAR_LINK_INTERFACE_LIBRARIES SPECIFY_LINK_INTERFACE_LIBRARIES)
"add_library(libB SHARED classB.cpp)\n"
"add_library(libC SHARED classC.cpp)\n"
+ "generate_export_header(libA)\n"
+ "generate_export_header(libB)\n"
+ "generate_export_header(libC)\n"
+
"add_executable(exec \"${CMAKE_CURRENT_BINARY_DIR}/test${COUNT}/main.cpp\")\n"
)
diff --git a/Tests/CMakeCommands/target_link_libraries/src/CMakeLists.txt b/Tests/CMakeCommands/target_link_libraries/src/CMakeLists.txt
index a9332e9..22e6b29 100644
--- a/Tests/CMakeCommands/target_link_libraries/src/CMakeLists.txt
+++ b/Tests/CMakeCommands/target_link_libraries/src/CMakeLists.txt
@@ -3,6 +3,7 @@ cmake_minimum_required(VERSION 2.8)
project(src)
include(CheckCXXCompilerFlag)
+include(GenerateExportHeader)
check_cxx_compiler_flag(-Wl,--no-undefined HAS_NO_UNDEFINED)
diff --git a/Tests/CMakeCommands/target_link_libraries/src/classA.h b/Tests/CMakeCommands/target_link_libraries/src/classA.h
index d485489..0a83f88 100644
--- a/Tests/CMakeCommands/target_link_libraries/src/classA.h
+++ b/Tests/CMakeCommands/target_link_libraries/src/classA.h
@@ -2,7 +2,9 @@
#ifndef CLASS_A_H
#define CLASS_A_H
-class classA
+#include "liba_export.h"
+
+class LIBA_EXPORT classA
{
public:
classA();
diff --git a/Tests/CMakeCommands/target_link_libraries/src/classB.h b/Tests/CMakeCommands/target_link_libraries/src/classB.h
index 7c2ad47..81e83fe 100644
--- a/Tests/CMakeCommands/target_link_libraries/src/classB.h
+++ b/Tests/CMakeCommands/target_link_libraries/src/classB.h
@@ -2,9 +2,11 @@
#ifndef CLASS_B_H
#define CLASS_B_H
+#include "libb_export.h"
+
class classA;
-class classB
+class LIBB_EXPORT classB
{
public:
classB();
diff --git a/Tests/CMakeCommands/target_link_libraries/src/classC.h b/Tests/CMakeCommands/target_link_libraries/src/classC.h
index 5d8a931..8dc929e 100644
--- a/Tests/CMakeCommands/target_link_libraries/src/classC.h
+++ b/Tests/CMakeCommands/target_link_libraries/src/classC.h
@@ -2,9 +2,11 @@
#ifndef CLASS_C_H
#define CLASS_C_H
+#include "libc_export.h"
+
class classA;
-class classC
+class LIBC_EXPORT classC
{
public:
classC();
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a1fe4c7d39c3da7f2d4b0dbf2a911e93ee8f3ffe
commit a1fe4c7d39c3da7f2d4b0dbf2a911e93ee8f3ffe
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Oct 5 15:18:51 2011 +0200
Commit: Brad King <brad.king at kitware.com>
CommitDate: Mon Oct 24 16:18:43 2011 -0400
Maybe fix on Windows.
diff --git a/Tests/CMakeCommands/target_link_libraries/src/CMakeLists.txt b/Tests/CMakeCommands/target_link_libraries/src/CMakeLists.txt
index 8b510fc..a9332e9 100644
--- a/Tests/CMakeCommands/target_link_libraries/src/CMakeLists.txt
+++ b/Tests/CMakeCommands/target_link_libraries/src/CMakeLists.txt
@@ -11,3 +11,5 @@ if (HAS_NO_UNDEFINED)
endif()
set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9b36fb915986cfc061391a90133e221b03af53dc
commit 9b36fb915986cfc061391a90133e221b03af53dc
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Oct 5 15:14:31 2011 +0200
Commit: Brad King <brad.king at kitware.com>
CommitDate: Mon Oct 24 16:18:43 2011 -0400
Test for features, not platforms.
diff --git a/Tests/CMakeCommands/target_link_libraries/src/CMakeLists.txt b/Tests/CMakeCommands/target_link_libraries/src/CMakeLists.txt
index 9ac8727..8b510fc 100644
--- a/Tests/CMakeCommands/target_link_libraries/src/CMakeLists.txt
+++ b/Tests/CMakeCommands/target_link_libraries/src/CMakeLists.txt
@@ -2,7 +2,11 @@ cmake_minimum_required(VERSION 2.8)
project(src)
-if (CMAKE_COMPILER_IS_GNUCXX)
+include(CheckCXXCompilerFlag)
+
+check_cxx_compiler_flag(-Wl,--no-undefined HAS_NO_UNDEFINED)
+
+if (HAS_NO_UNDEFINED)
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined")
endif()
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=537403ab024916a3b118372f06e34053f0e4f94a
commit 537403ab024916a3b118372f06e34053f0e4f94a
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Oct 5 15:02:50 2011 +0200
Commit: Brad King <brad.king at kitware.com>
CommitDate: Mon Oct 24 16:18:43 2011 -0400
Fix build on non-GNU.
diff --git a/Tests/CMakeCommands/target_link_libraries/src/CMakeLists.txt b/Tests/CMakeCommands/target_link_libraries/src/CMakeLists.txt
index 17c8844..9ac8727 100644
--- a/Tests/CMakeCommands/target_link_libraries/src/CMakeLists.txt
+++ b/Tests/CMakeCommands/target_link_libraries/src/CMakeLists.txt
@@ -2,5 +2,8 @@ cmake_minimum_required(VERSION 2.8)
project(src)
-set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined")
+if (CMAKE_COMPILER_IS_GNUCXX)
+ set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined")
+endif()
+
set(CMAKE_INCLUDE_CURRENT_DIR ON)
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=68f16263627072db3a771a4072bb2ac98f68b7b1
commit 68f16263627072db3a771a4072bb2ac98f68b7b1
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Oct 1 15:00:27 2011 +0200
Commit: Brad King <brad.king at kitware.com>
CommitDate: Mon Oct 24 16:18:16 2011 -0400
Test target_link_libraries command explicitly
Run the tests with the rest of the cmake tests.
Need a dummy executable to use the cmake test macro.
diff --git a/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
new file mode 100644
index 0000000..8a06cf0
--- /dev/null
+++ b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
@@ -0,0 +1,208 @@
+cmake_minimum_required(VERSION 2.8)
+
+project(target_link_libraries_test)
+
+set (COUNT 0)
+macro(_do_build CLEAR_LINK_INTERFACE_LIBRARIES SPECIFY_LINK_INTERFACE_LIBRARIES)
+ math(EXPR COUNT "${COUNT} + 1" )
+
+ execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/src" "${CMAKE_CURRENT_BINARY_DIR}/test${COUNT}")
+
+ if (${CLEAR_LINK_INTERFACE_LIBRARIES})
+ file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/test${COUNT}/CMakeLists.txt"
+ "set(CMAKE_LINK_INTERFACE_LIBRARIES \"\")\n"
+ )
+ endif()
+
+ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/test${COUNT}/main.cpp"
+ ""
+ )
+
+ foreach(klass ${ARGN})
+ if (klass STREQUAL "LIBS")
+ break()
+ endif()
+ file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/test${COUNT}/main.cpp"
+ "#include \"${klass}.h\"\n"
+ )
+ endforeach()
+
+ file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/test${COUNT}/main.cpp"
+ "int main(int, char **) {"
+ )
+
+ foreach(klass ${ARGN})
+ if (klass STREQUAL "LIBS")
+ break()
+ endif()
+ file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/test${COUNT}/main.cpp"
+ "${klass} ${klass}_;\n"
+ )
+ endforeach()
+
+ file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/test${COUNT}/main.cpp"
+ "return 0;"
+ "}\n"
+ )
+
+ file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/test${COUNT}/CMakeLists.txt"
+
+ "add_library(libA SHARED classA.cpp)\n"
+ "add_library(libB SHARED classB.cpp)\n"
+ "add_library(libC SHARED classC.cpp)\n"
+
+ "add_executable(exec \"${CMAKE_CURRENT_BINARY_DIR}/test${COUNT}/main.cpp\")\n"
+ )
+
+ file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/test${COUNT}/CMakeLists.txt"
+ "target_link_libraries(libB libA)\n"
+ "target_link_libraries(libC libA libB)\n"
+ )
+
+ if (${SPECIFY_LINK_INTERFACE_LIBRARIES})
+ file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/test${COUNT}/CMakeLists.txt"
+ "target_link_libraries(libB LINK_INTERFACE_LIBRARIES libA)\n"
+ "target_link_libraries(libC LINK_INTERFACE_LIBRARIES libA)\n"
+ )
+ endif()
+
+ file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/test${COUNT}/CMakeLists.txt"
+ "target_link_libraries(exec "
+ )
+
+ set(continue True)
+ foreach(klass ${ARGN})
+ if (klass STREQUAL "LIBS")
+ # CMake has no continue() command
+ set(continue False)
+ endif()
+ if (NOT continue AND NOT klass STREQUAL "LIBS")
+ file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/test${COUNT}/CMakeLists.txt"
+ "${klass} "
+ )
+ endif()
+ endforeach()
+
+ file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/test${COUNT}/CMakeLists.txt"
+ ")\n"
+ )
+
+ try_compile(Result ${CMAKE_CURRENT_BINARY_DIR}/fail${COUNT}
+ ${CMAKE_CURRENT_BINARY_DIR}/test${COUNT}
+ src
+ OUTPUT_VARIABLE Out
+ )
+endmacro()
+
+macro(EXPECT_PASS)
+ _do_build(${ARGN})
+ if (NOT ${Result})
+ message(SEND_ERROR "Failed! \n\n${Out}")
+ endif()
+endmacro()
+
+macro(EXPECT_FAIL)
+ _do_build(${ARGN})
+ if (${Result})
+ message(SEND_ERROR "Failed! \n\n${Out} -- ${COUNT}")
+ endif()
+endmacro()
+
+macro(all_pass)
+ expect_pass(False False ${ARGN})
+ expect_pass(True False ${ARGN})
+ expect_pass(False True ${ARGN})
+ expect_pass(True True ${ARGN})
+endmacro()
+
+# If we specify all libs to the executable, it will always pass
+all_pass(
+ classA
+ LIBS
+ libA
+)
+
+all_pass(
+ classA classB
+ LIBS
+ libA libB
+)
+
+all_pass(
+ classA classC
+ LIBS
+ libA libC
+)
+
+all_pass(
+ classA classB classC
+ LIBS
+ libA libB libC
+)
+
+# If we don't set the CMAKE_LINK_INTERFACE_LIBRARIES to empty and we don't explicitly
+# specify the LINK_INTERFACE_LIBRARIES, the executable can use all classes if linked
+# indirectly to them
+expect_pass(False False
+ classA classB
+ LIBS
+ libB
+)
+
+# Although libC is linked to libA, libA is not part of the link interface of libC.
+# Because we don't clear the CMAKE_LINK_INTERFACE_LIBRARIES it still works.
+expect_pass(False False
+ classA classC
+ LIBS
+ libC
+)
+
+# However, if we do clear it and don't explicitly link the executable to it, it fails,
+# whether we specify the link_interface_libraries properly or not.
+expect_fail(True False
+ classB classC
+ LIBS
+ libC
+)
+expect_fail(True True
+ classB classC
+ LIBS
+ libC
+)
+
+# Then we can still link the executable to libA directly of course to pass
+expect_pass(True False
+ classA classC
+ LIBS
+ libC libA
+)
+expect_pass(True True
+ classA classC
+ LIBS
+ libC libA
+)
+
+# Also, if we clear and specify the link interface, we can use classes defined in
+# that interface without linking to the library directly
+expect_pass(True True
+ classA classB
+ LIBS
+ libB
+)
+
+expect_pass(True True
+ classA classC
+ LIBS
+ libC
+)
+
+file(WRITE
+ "${CMAKE_CURRENT_BINARY_DIR}/main.cxx"
+ "int main() { return 0; }
+"
+)
+
+add_executable(
+ target_link_libraries
+ "${CMAKE_CURRENT_BINARY_DIR}/main.cxx"
+)
diff --git a/Tests/CMakeCommands/target_link_libraries/src/CMakeLists.txt b/Tests/CMakeCommands/target_link_libraries/src/CMakeLists.txt
new file mode 100644
index 0000000..17c8844
--- /dev/null
+++ b/Tests/CMakeCommands/target_link_libraries/src/CMakeLists.txt
@@ -0,0 +1,6 @@
+cmake_minimum_required(VERSION 2.8)
+
+project(src)
+
+set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined")
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
diff --git a/Tests/CMakeCommands/target_link_libraries/src/classA.cpp b/Tests/CMakeCommands/target_link_libraries/src/classA.cpp
new file mode 100644
index 0000000..f5e7106
--- /dev/null
+++ b/Tests/CMakeCommands/target_link_libraries/src/classA.cpp
@@ -0,0 +1,7 @@
+
+#include "classA.h"
+
+classA::classA()
+{
+
+}
diff --git a/Tests/CMakeCommands/target_link_libraries/src/classA.h b/Tests/CMakeCommands/target_link_libraries/src/classA.h
new file mode 100644
index 0000000..d485489
--- /dev/null
+++ b/Tests/CMakeCommands/target_link_libraries/src/classA.h
@@ -0,0 +1,11 @@
+
+#ifndef CLASS_A_H
+#define CLASS_A_H
+
+class classA
+{
+public:
+ classA();
+};
+
+#endif
\ No newline at end of file
diff --git a/Tests/CMakeCommands/target_link_libraries/src/classB.cpp b/Tests/CMakeCommands/target_link_libraries/src/classB.cpp
new file mode 100644
index 0000000..86308a5
--- /dev/null
+++ b/Tests/CMakeCommands/target_link_libraries/src/classB.cpp
@@ -0,0 +1,13 @@
+
+#include "classB.h"
+
+#include "classA.h"
+
+classB::classB()
+{
+}
+
+classA* classB::a() const
+{
+ return new classA();
+}
\ No newline at end of file
diff --git a/Tests/CMakeCommands/target_link_libraries/src/classB.h b/Tests/CMakeCommands/target_link_libraries/src/classB.h
new file mode 100644
index 0000000..7c2ad47
--- /dev/null
+++ b/Tests/CMakeCommands/target_link_libraries/src/classB.h
@@ -0,0 +1,15 @@
+
+#ifndef CLASS_B_H
+#define CLASS_B_H
+
+class classA;
+
+class classB
+{
+public:
+ classB();
+
+ classA* a() const;
+};
+
+#endif
\ No newline at end of file
diff --git a/Tests/CMakeCommands/target_link_libraries/src/classC.cpp b/Tests/CMakeCommands/target_link_libraries/src/classC.cpp
new file mode 100644
index 0000000..55ab9fc
--- /dev/null
+++ b/Tests/CMakeCommands/target_link_libraries/src/classC.cpp
@@ -0,0 +1,15 @@
+
+#include "classC.h"
+
+#include "classA.h"
+#include "classB.h"
+
+classC::classC()
+{
+ classB b;
+}
+
+classA* classC::a() const
+{
+ return new classA();
+}
\ No newline at end of file
diff --git a/Tests/CMakeCommands/target_link_libraries/src/classC.h b/Tests/CMakeCommands/target_link_libraries/src/classC.h
new file mode 100644
index 0000000..5d8a931
--- /dev/null
+++ b/Tests/CMakeCommands/target_link_libraries/src/classC.h
@@ -0,0 +1,15 @@
+
+#ifndef CLASS_C_H
+#define CLASS_C_H
+
+class classA;
+
+class classC
+{
+public:
+ classC();
+
+ classA* a() const;
+};
+
+#endif
\ No newline at end of file
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 78db39d..44ed2f5 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -1574,6 +1574,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
-P "${CMake_SOURCE_DIR}/Tests/CMakeCommands/build_command/RunCMake.cmake"
)
+ ADD_TEST_MACRO(CMakeCommands.target_link_libraries target_link_libraries)
+
CONFIGURE_FILE(
"${CMake_SOURCE_DIR}/Tests/CTestTestCrash/test.cmake.in"
"${CMake_BINARY_DIR}/Tests/CTestTestCrash/test.cmake"
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d9cbba7c2cd364a19b42cd856f5d048deb92b415
commit d9cbba7c2cd364a19b42cd856f5d048deb92b415
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Oct 1 12:23:56 2011 +0200
Commit: Brad King <brad.king at kitware.com>
CommitDate: Mon Oct 24 16:09:29 2011 -0400
Initialize LINK_INTERFACE_LIBRARIES target property with a variable
Define variable CMAKE_LINK_INTERFACE_LIBRARIES to initialize the
value of this property when a target is created. This allows authors
to write
set(CMAKE_LINK_INTERFACE_LIBRARIES "")
to disable transitive linking to implementation dependencies of shared
libraries on platforms where it is possible.
diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx
index f2b01f1..f4d4e7c 100644
--- a/Source/cmDocumentVariables.cxx
+++ b/Source/cmDocumentVariables.cxx
@@ -1219,7 +1219,14 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
"Therefore a specific build configuration must be chosen even "
"if the generated build system supports multiple configurations.",false,
"Variables that Control the Build");
-
+ cm->DefineProperty
+ ("CMAKE_LINK_INTERFACE_LIBRARIES", cmProperty::VARIABLE,
+ "Default value for LINK_INTERFACE_LIBRARIES of targets.",
+ "This variable is used to initialize the "
+ "LINK_INTERFACE_LIBRARIES property on all the targets. "
+ "See that target property for additional information.",
+ false,
+ "Variables that Control the Build");
// Variables defined when the a language is enabled These variables will
// also be defined whenever CMake has loaded its support for compiling (LANG)
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index fb92016..14b73d1 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -619,6 +619,9 @@ void cmTarget::DefineProperties(cmake *cm)
"If the list is empty then no transitive link dependencies will be "
"incorporated when this target is linked into another target even if "
"the default set is non-empty. "
+ "This property is initialized by the value of the variable "
+ "CMAKE_LINK_INTERFACE_LIBRARIES if it is set when a target is "
+ "created. "
"This property is ignored for STATIC libraries.");
cm->DefineProperty
@@ -1153,6 +1156,7 @@ void cmTarget::SetMakefile(cmMakefile* mf)
this->SetPropertyDefault("Fortran_MODULE_DIRECTORY", 0);
this->SetPropertyDefault("OSX_ARCHITECTURES", 0);
this->SetPropertyDefault("AUTOMOC", 0);
+ this->SetPropertyDefault("LINK_INTERFACE_LIBRARIES", 0);
// Collect the set of configuration types.
std::vector<std::string> configNames;
-----------------------------------------------------------------------
Summary of changes:
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list