[Cmake-commits] [cmake-commits] king committed CMakeLists.txt 1.15 1.16 testLib5.c NONE 1.1

cmake-commits at cmake.org cmake-commits at cmake.org
Wed Apr 8 16:29:05 EDT 2009


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

Modified Files:
	CMakeLists.txt 
Added Files:
	testLib5.c 
Log Message:
ENH: Allow IMPORTED_IMPLIB w/o IMPORTED_LOCATION

Linking to a Windows shared library (.dll) requires only its import
library (.lib).  This teaches CMake to recognize SHARED IMPORTED library
targets that set only IMPORTED_IMPLIB and not IMPORTED_LOCATION.


Index: CMakeLists.txt
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/ExportImport/Export/CMakeLists.txt,v
retrieving revision 1.15
retrieving revision 1.16
diff -C 2 -d -r1.15 -r1.16
*** CMakeLists.txt	4 Sep 2008 21:34:25 -0000	1.15
--- CMakeLists.txt	8 Apr 2009 20:29:03 -0000	1.16
***************
*** 40,43 ****
--- 40,45 ----
  set_property(TARGET testLib4 PROPERTY FRAMEWORK 1)
  
+ add_library(testLib5 SHARED testLib5.c)
+ 
  # Work-around: Visual Studio 6 does not support per-target object files.
  set(VS6)
***************
*** 86,91 ****
--- 88,105 ----
    ARCHIVE DESTINATION lib/impl
    )
+ install(
+   TARGETS testLib5
+   EXPORT exp
+   # Leave out RUNTIME DESTINATION to test implib-only export.
+   LIBRARY DESTINATION lib
+   ARCHIVE DESTINATION lib
+   )
  install(EXPORT exp NAMESPACE exp_ DESTINATION lib/exp)
  
+ # Install testLib5.dll outside the export.
+ if(WIN32)
+   install(TARGETS testLib5 RUNTIME DESTINATION bin)
+ endif(WIN32)
+ 
  # Export from build tree.
  export(TARGETS testExe1 testLib1 testLib2 testLib3
***************
*** 94,98 ****
    FILE ExportBuildTree.cmake
    )
! export(TARGETS testExe2 testLib4 testExe3 testExe2lib
    testLib4lib testLib4libdbg testLib4libopt
    NAMESPACE bld_
--- 108,112 ----
    FILE ExportBuildTree.cmake
    )
! export(TARGETS testExe2 testLib4 testLib5 testExe3 testExe2lib
    testLib4lib testLib4libdbg testLib4libopt
    NAMESPACE bld_

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

testLib5_EXPORT int testLib5(void) { return 0; }



More information about the Cmake-commits mailing list