[Cmake-commits] [cmake-commits] king committed CMakeLists.txt 1.20 1.21 testLibCycleA1.c NONE 1.1 testLibCycleA2.c NONE 1.1 testLibCycleA3.c NONE 1.1 testLibCycleB1.c NONE 1.1 testLibCycleB2.c NONE 1.1 testLibCycleB3.c NONE 1.1

cmake-commits at cmake.org cmake-commits at cmake.org
Tue Sep 1 10:38:37 EDT 2009


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

Modified Files:
	CMakeLists.txt 
Added Files:
	testLibCycleA1.c testLibCycleA2.c testLibCycleA3.c 
	testLibCycleB1.c testLibCycleB2.c testLibCycleB3.c 
Log Message:
Test link multiplicity export/import

We test that LINK_INTERFACE_MULTIPLICITY propagates through export() and
install(EXPORT) into dependent projects.  A simple cycle of two archives
that need to be scanned three times ensures that the importing project
uses the multiplicity correctly.


--- NEW FILE: testLibCycleB1.c ---
extern int testLibCycleA2(void);
int testLibCycleB1(void) { return testLibCycleA2(); }

--- NEW FILE: testLibCycleA3.c ---
extern int testLibCycleB3(void);
int testLibCycleA3(void) { return testLibCycleB3(); }

--- NEW FILE: testLibCycleB2.c ---
extern int testLibCycleA3(void);
int testLibCycleB2(void) { return testLibCycleA3(); }

--- NEW FILE: testLibCycleA2.c ---
extern int testLibCycleB2(void);
int testLibCycleA2(void) { return testLibCycleB2(); }

--- NEW FILE: testLibCycleB3.c ---
int testLibCycleB3(void) { return 0; }

Index: CMakeLists.txt
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/ExportImport/Export/CMakeLists.txt,v
retrieving revision 1.20
retrieving revision 1.21
diff -C 2 -d -r1.20 -r1.21
*** CMakeLists.txt	13 Jul 2009 13:20:35 -0000	1.20
--- CMakeLists.txt	1 Sep 2009 14:38:26 -0000	1.21
***************
*** 74,77 ****
--- 74,86 ----
  set_property(TARGET testExe3 PROPERTY MACOSX_BUNDLE 1)
  
+ # Test cyclic dependencies.
+ add_library(testLibCycleA STATIC
+   testLibCycleA1.c testLibCycleA2.c testLibCycleA3.c)
+ add_library(testLibCycleB STATIC
+   testLibCycleB1.c testLibCycleB2.c testLibCycleB3.c)
+ target_link_libraries(testLibCycleA testLibCycleB)
+ target_link_libraries(testLibCycleB testLibCycleA)
+ set_property(TARGET testLibCycleA PROPERTY LINK_INTERFACE_MULTIPLICITY 3)
+ 
  # Install and export from install tree.
  install(
***************
*** 80,83 ****
--- 89,93 ----
    testExe2lib testLib4lib testLib4libdbg testLib4libopt
    testLib6
+   testLibCycleA testLibCycleB
    EXPORT exp
    RUNTIME DESTINATION bin
***************
*** 117,120 ****
--- 127,131 ----
  export(TARGETS testExe2 testLib4 testLib5 testLib6 testExe3 testExe2lib
    testLib4lib testLib4libdbg testLib4libopt
+   testLibCycleA testLibCycleB
    NAMESPACE bld_
    APPEND FILE ExportBuildTree.cmake

--- NEW FILE: testLibCycleA1.c ---
extern int testLibCycleB1(void);
int testLibCycleA1(void) { return testLibCycleB1(); }



More information about the Cmake-commits mailing list