[cmake-commits] king committed CMakeLists.txt 1.5 1.6 testExe2lib.c NONE 1.1 testExe2libImp.c NONE 1.1 testLib3.c 1.1 1.2 testLib3Imp.c NONE 1.1

cmake-commits at cmake.org cmake-commits at cmake.org
Wed Jan 30 17:26:11 EST 2008


Update of /cvsroot/CMake/CMake/Tests/ExportImport/Export
In directory public:/mounts/ram/cvs-serv10384/Tests/ExportImport/Export

Modified Files:
	CMakeLists.txt testLib3.c 
Added Files:
	testExe2lib.c testExe2libImp.c testLib3Imp.c 
Log Message:
ENH: Updated ExportImport test to try LINK_INTERFACE_LIBRARIES.


--- NEW FILE: testExe2lib.c ---
#if defined(_WIN32) || defined(__CYGWIN__)
# define testExe2lib_EXPORT __declspec(dllexport)
# define testExe2libImp_IMPORT __declspec(dllimport)
#else
# define testExe2lib_EXPORT
# define testExe2libImp_IMPORT
#endif

testExe2libImp_IMPORT int testExe2libImp(void);
testExe2lib_EXPORT int testExe2lib(void) { return testExe2libImp(); }

--- NEW FILE: testExe2libImp.c ---
#if defined(_WIN32) || defined(__CYGWIN__)
# define testExe2libImp_EXPORT __declspec(dllexport)
#else
# define testExe2libImp_EXPORT
#endif

testExe2libImp_EXPORT int testExe2libImp(void) { return 0; }

Index: testLib3.c
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/ExportImport/Export/testLib3.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- testLib3.c	28 Jan 2008 13:40:20 -0000	1.1
+++ testLib3.c	30 Jan 2008 22:26:09 -0000	1.2
@@ -1,7 +1,10 @@
 #if defined(_WIN32) || defined(__CYGWIN__)
 # define testLib3_EXPORT __declspec(dllexport)
+# define testLib3Imp_IMPORT __declspec(dllimport)
 #else
 # define testLib3_EXPORT
+# define testLib3Imp_IMPORT
 #endif
 
-testLib3_EXPORT int testLib3(void) { return 0; }
+testLib3Imp_IMPORT int testLib3Imp(void);
+testLib3_EXPORT int testLib3(void) { return testLib3Imp(); }

Index: CMakeLists.txt
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/ExportImport/Export/CMakeLists.txt,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- CMakeLists.txt	28 Jan 2008 19:46:16 -0000	1.5
+++ CMakeLists.txt	30 Jan 2008 22:26:09 -0000	1.6
@@ -9,14 +9,22 @@
 add_executable(testExe1 testExe1.c)
 target_link_libraries(testExe1 testExe1lib)
 
+add_library(testExe2libImp SHARED testExe2libImp.c)
+add_library(testExe2lib SHARED testExe2lib.c)
+target_link_libraries(testExe2lib testExe2libImp)
+set_property(TARGET testExe2lib PROPERTY LINK_INTERFACE_LIBRARIES "")
 add_executable(testExe2 testExe2.c)
 set_property(TARGET testExe2 PROPERTY ENABLE_EXPORTS 1)
+set_property(TARGET testExe2 PROPERTY LINK_INTERFACE_LIBRARIES testExe2lib)
 
 add_library(testLib1 STATIC testLib1.c)
 add_library(testLib2 STATIC testLib2.c)
 target_link_libraries(testLib2 testLib1)
 
+add_library(testLib3Imp SHARED testLib3Imp.c)
 add_library(testLib3 SHARED testLib3.c)
+target_link_libraries(testLib3 testLib3Imp)
+set_property(TARGET testLib3 PROPERTY LINK_INTERFACE_LIBRARIES "")
 
 add_library(testLib4 SHARED testLib4.c)
 set_property(TARGET testLib4 PROPERTY FRAMEWORK 1)
@@ -24,9 +32,18 @@
 add_executable(testExe3 testExe3.c)
 set_property(TARGET testExe3 PROPERTY MACOSX_BUNDLE 1)
 
+# Install helper targets that are not part of the interface.
+install(
+  TARGETS testExe2libImp testLib3Imp
+  RUNTIME DESTINATION bin
+  LIBRARY DESTINATION lib
+  ARCHIVE DESTINATION lib
+  )
+
 # Install and export from install tree.
 install(
   TARGETS testExe1 testLib1 testLib2 testExe2 testLib3 testLib4 testExe3
+          testExe2lib
   EXPORT exp
   RUNTIME DESTINATION bin
   LIBRARY DESTINATION lib
@@ -37,11 +54,11 @@
 install(EXPORT exp NAMESPACE exp_ DESTINATION lib/exp)
 
 # Export from build tree.
-export(TARGETS testExe1 testLib1 testLib2
+export(TARGETS testExe1 testLib1 testLib2 testLib3
   NAMESPACE bld_
   FILE ExportBuildTree.cmake
   )
-export(TARGETS testExe2 testLib3 testLib4 testExe3
+export(TARGETS testExe2 testLib4 testExe3 testExe2lib
   NAMESPACE bld_
   APPEND FILE ExportBuildTree.cmake
   )

--- NEW FILE: testLib3Imp.c ---
#if defined(_WIN32) || defined(__CYGWIN__)
# define testLib3Imp_EXPORT __declspec(dllexport)
#else
# define testLib3Imp_EXPORT
#endif

testLib3Imp_EXPORT int testLib3Imp(void) { return 0; }



More information about the Cmake-commits mailing list