summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorAmitha Perera <perera@cs.rpi.edu>2002-05-01 20:24:47 (GMT)
committerAmitha Perera <perera@cs.rpi.edu>2002-05-01 20:24:47 (GMT)
commit36f80fe6c8f7593462c450789b01f4eb37792996 (patch)
tree4c7a81e81780aa96ad9b485269e5af743bf785e2 /Tests
parent1f8df8585ef36aa980d13a0cb6646de399bceff9 (diff)
downloadCMake-36f80fe6c8f7593462c450789b01f4eb37792996.zip
CMake-36f80fe6c8f7593462c450789b01f4eb37792996.tar.gz
CMake-36f80fe6c8f7593462c450789b01f4eb37792996.tar.bz2
ENH: Make the LinkLibraries command contribute dependencies towards AddLibraries.
Diffstat (limited to 'Tests')
-rw-r--r--Tests/Dependency/CMakeLists.txt21
-rw-r--r--Tests/Dependency/Exec/CMakeLists.txt4
-rw-r--r--Tests/Dependency/Exec/ExecMain.c6
-rw-r--r--Tests/Dependency/Six/CMakeLists.txt12
-rw-r--r--Tests/Dependency/Six/SixASrc.c8
-rw-r--r--Tests/Dependency/Six/SixBSrc.c10
6 files changed, 50 insertions, 11 deletions
diff --git a/Tests/Dependency/CMakeLists.txt b/Tests/Dependency/CMakeLists.txt
index 81365d1..508fe01 100644
--- a/Tests/Dependency/CMakeLists.txt
+++ b/Tests/Dependency/CMakeLists.txt
@@ -15,11 +15,13 @@ SET( CMAKE_ANALYZE_LIB_DEPENDS "ON" )
# ^ |
# | |
# One <------ Four -----> Two <----- Five <---+
-# |
-# ^ ^ |
-# | | |
-# +--------- Three <-------+
-#
+# |
+# ^ ^ ^ | ^ ^ ^
+# | | +-----+ | | | +----+
+# | | | | | | |
+# +--------- Three <------+ +------- SixA SixB
+# | |
+# +-----------------------+
# NoDepA:
# NoDepB: NoDepA
# NoDepC: NoDepA
@@ -28,11 +30,16 @@ SET( CMAKE_ANALYZE_LIB_DEPENDS "ON" )
# Three: One Four
# Four: One Two A
# Five: Two
-# Exec: NoDepB NoDepC Five
+# SixA: Two Five
+# SixB: Four Five
+# Exec: NoDepB NoDepC SixA SixB
#
# The libraries One,...,Five have their dependencies explicitly
# encoded. The libraries NoDepA,...,NoDepC do not.
+#
+# Although SixB does not depend on Two, there is a dependency listed
+# in the corresponding CMakeLists.txt just because of commands used.
SUBDIRS( NoDepA NoDepB NoDepC )
-SUBDIRS( One Two Three Four Five )
+SUBDIRS( One Two Three Four Five Six )
SUBDIRS( Exec )
diff --git a/Tests/Dependency/Exec/CMakeLists.txt b/Tests/Dependency/Exec/CMakeLists.txt
index 7214b05..1867b1d 100644
--- a/Tests/Dependency/Exec/CMakeLists.txt
+++ b/Tests/Dependency/Exec/CMakeLists.txt
@@ -1,6 +1,6 @@
ADD_EXECUTABLE( exec ExecMain.c )
-# This executable directly depends on NoDepB, NoDepC and Five. However,
+# This executable directly depends on NoDepB, NoDepC, SixA and SixB. However,
# since NoDepB and NoDepC do not have explicit dependency information,
# and they depend on NoDepA, we have to manually specify that dependency.
-LINK_LIBRARIES( NoDepB NoDepC NoDepA Five )
+LINK_LIBRARIES( NoDepB NoDepC NoDepA SixB SixA )
diff --git a/Tests/Dependency/Exec/ExecMain.c b/Tests/Dependency/Exec/ExecMain.c
index b666a24..d2f551c 100644
--- a/Tests/Dependency/Exec/ExecMain.c
+++ b/Tests/Dependency/Exec/ExecMain.c
@@ -2,11 +2,13 @@
void NoDepBFunction();
void NoDepCFunction();
-void FiveFunction();
+void SixAFunction();
+void SixBFunction();
int main( )
{
- FiveFunction();
+ SixAFunction();
+ SixBFunction();
NoDepBFunction();
NoDepCFunction();
diff --git a/Tests/Dependency/Six/CMakeLists.txt b/Tests/Dependency/Six/CMakeLists.txt
new file mode 100644
index 0000000..2cb1586
--- /dev/null
+++ b/Tests/Dependency/Six/CMakeLists.txt
@@ -0,0 +1,12 @@
+# In some projects, people don't use TARGET_LINK_LIBRARIES, but just
+# use an all-encompassing LINK_LIBRARIES. And sometimes they don't
+# specify them in the correct order.
+
+LINK_LIBRARIES( Two )
+
+ADD_LIBRARY( SixA SixASrc.c )
+
+ADD_LIBRARY( SixB SixBSrc.c )
+TARGET_LINK_LIBRARIES( SixB Four )
+
+LINK_LIBRARIES( Five )
diff --git a/Tests/Dependency/Six/SixASrc.c b/Tests/Dependency/Six/SixASrc.c
new file mode 100644
index 0000000..7ea3711
--- /dev/null
+++ b/Tests/Dependency/Six/SixASrc.c
@@ -0,0 +1,8 @@
+void FiveFunction();
+void TwoFunction();
+
+void SixAFunction()
+{
+ FiveFunction();
+ TwoFunction();
+}
diff --git a/Tests/Dependency/Six/SixBSrc.c b/Tests/Dependency/Six/SixBSrc.c
new file mode 100644
index 0000000..92f9607
--- /dev/null
+++ b/Tests/Dependency/Six/SixBSrc.c
@@ -0,0 +1,10 @@
+void TwoFunction();
+void FiveFunction();
+void FourFunction();
+
+void SixBFunction()
+{
+ TwoFunction();
+ FiveFunction();
+ FourFunction();
+}