[Cmake-commits] [cmake-commits] king committed CMakeLists.txt 1.100 1.101

cmake-commits at cmake.org cmake-commits at cmake.org
Mon Aug 18 11:39:25 EDT 2008


Update of /cvsroot/CMake/CMake/Tests/SimpleInstall
In directory public:/mounts/ram/cvs-serv8993/Tests/SimpleInstall

Modified Files:
	CMakeLists.txt 
Log Message:
ENH: Add UNKNOWN type for IMPORTED libraries

When creating an IMPORTED target for a library that has been found on
disk, it may not be known whether the library is STATIC or SHARED.
However, the library may still be linked using the file found from disk.
Use of an IMPORTED target is still important to allow per-configuration
files to be specified for the library.

This change creates an UNKNOWN type for IMPORTED library targets.  The
IMPORTED_LOCATION property (and its per-config equivalents) specifies
the location of the library.  CMake makes no assumptions about the
library that cannot be inferred from the file on disk.  This will help
projects and find-modules import targets found on disk or specified by
the user.


Index: CMakeLists.txt
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/SimpleInstall/CMakeLists.txt,v
retrieving revision 1.100
retrieving revision 1.101
diff -C 2 -d -r1.100 -r1.101
*** CMakeLists.txt	17 Jun 2008 15:39:26 -0000	1.100
--- CMakeLists.txt	18 Aug 2008 15:39:22 -0000	1.101
***************
*** 67,73 ****
      DOC "Fourth library")
  
    INCLUDE_DIRECTORIES(${CMAKE_INSTALL_PREFIX}/MyTest/include)
    ADD_EXECUTABLE (SimpleInstExeS2 inst2.cxx foo.c foo.h)
!   TARGET_LINK_LIBRARIES(SimpleInstExeS2 ${TEST1_LIBRARY} ${TEST2_LIBRARY} ${TEST4_LIBRARY})
    SET(install_target SimpleInstExeS2)
  
--- 67,77 ----
      DOC "Fourth library")
  
+   # Test importing a library found on disk.
+   ADD_LIBRARY(lib_test4 UNKNOWN IMPORTED)
+   SET_PROPERTY(TARGET lib_test4 PROPERTY IMPORTED_LOCATION ${TEST4_LIBRARY})
+ 
    INCLUDE_DIRECTORIES(${CMAKE_INSTALL_PREFIX}/MyTest/include)
    ADD_EXECUTABLE (SimpleInstExeS2 inst2.cxx foo.c foo.h)
!   TARGET_LINK_LIBRARIES(SimpleInstExeS2 ${TEST1_LIBRARY} ${TEST2_LIBRARY} lib_test4)
    SET(install_target SimpleInstExeS2)
  



More information about the Cmake-commits mailing list