summaryrefslogtreecommitdiffstats
path: root/Tests/RuntimePath/CMakeLists.txt
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-01-22 14:15:16 (GMT)
committerBrad King <brad.king@kitware.com>2008-01-22 14:15:16 (GMT)
commitd2d18fb56584b1446981986a3ab0440cacd42e41 (patch)
treedc4737f2c12845b85a5b668dc6b88fc25703f4cb /Tests/RuntimePath/CMakeLists.txt
parent96fd5909d9dd1ffe740230ce652d574cd01c62d5 (diff)
downloadCMake-d2d18fb56584b1446981986a3ab0440cacd42e41.zip
CMake-d2d18fb56584b1446981986a3ab0440cacd42e41.tar.gz
CMake-d2d18fb56584b1446981986a3ab0440cacd42e41.tar.bz2
ENH: Added RuntimePath test to make sure rpath gets correct order.
Diffstat (limited to 'Tests/RuntimePath/CMakeLists.txt')
-rw-r--r--Tests/RuntimePath/CMakeLists.txt36
1 files changed, 36 insertions, 0 deletions
diff --git a/Tests/RuntimePath/CMakeLists.txt b/Tests/RuntimePath/CMakeLists.txt
new file mode 100644
index 0000000..4a5fbbd
--- /dev/null
+++ b/Tests/RuntimePath/CMakeLists.txt
@@ -0,0 +1,36 @@
+project(RuntimePath C)
+
+if(CMAKE_ANSI_CFLAGS)
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_ANSI_CFLAGS}")
+endif(CMAKE_ANSI_CFLAGS)
+
+# Add a simple chain of shared libraries that must be found.
+add_library(foo1 SHARED foo1.c)
+set_property(TARGET foo1 PROPERTY OUTPUT_NAME foo)
+set_property(TARGET foo1 PROPERTY LIBRARY_OUTPUT_DIRECTORY A)
+
+add_library(bar1 SHARED bar1.c)
+set_property(TARGET bar1 PROPERTY OUTPUT_NAME bar)
+set_property(TARGET bar1 PROPERTY VERSION 1)
+set_property(TARGET bar1 PROPERTY LIBRARY_OUTPUT_DIRECTORY B)
+target_link_libraries(bar1 foo1)
+
+add_executable(RuntimePath main.c)
+target_link_libraries(RuntimePath bar1)
+
+# Add a library that provides a conflicting location to make sure
+# rpath ordering works.
+add_library(foo2 SHARED foo2.c)
+set_property(TARGET foo2 PROPERTY OUTPUT_NAME foo)
+set_property(TARGET foo2 PROPERTY LIBRARY_OUTPUT_DIRECTORY B)
+
+# Add a library that would provide a conflicting location if not for
+# soname analysis in rpath ordering. This will also break the old
+# link directory ordering to make sure files are linked with full
+# paths.
+if(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG)
+ add_library(bar2 SHARED bar2.c)
+ set_property(TARGET bar2 PROPERTY OUTPUT_NAME bar)
+ set_property(TARGET bar2 PROPERTY LIBRARY_OUTPUT_DIRECTORY A)
+ target_link_libraries(bar2 foo2)
+endif(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG)