summaryrefslogtreecommitdiff
path: root/Tests/SimpleInstallS2/CMakeLists.txt
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-08-18 11:39:22 -0400
committerBrad King <brad.king@kitware.com>2008-08-18 11:39:22 -0400
commit061d20be3869d53e0dee4c72b4f9e0202fe6b197 (patch)
treee3b1e82517d89a5795e6d1927e49de21d0294983 /Tests/SimpleInstallS2/CMakeLists.txt
parent0bf093fd172951a8da7fc892da95c5c37a3354e2 (diff)
downloadcmake-061d20be3869d53e0dee4c72b4f9e0202fe6b197.tar.gz
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.
Diffstat (limited to 'Tests/SimpleInstallS2/CMakeLists.txt')
-rw-r--r--Tests/SimpleInstallS2/CMakeLists.txt6
1 files changed, 5 insertions, 1 deletions
diff --git a/Tests/SimpleInstallS2/CMakeLists.txt b/Tests/SimpleInstallS2/CMakeLists.txt
index 34914b6a3a..c204e64100 100644
--- a/Tests/SimpleInstallS2/CMakeLists.txt
+++ b/Tests/SimpleInstallS2/CMakeLists.txt
@@ -66,9 +66,13 @@ IF(STAGE2)
PATHS ${LIBPATHS}
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} ${TEST4_LIBRARY})
+ TARGET_LINK_LIBRARIES(SimpleInstExeS2 ${TEST1_LIBRARY} ${TEST2_LIBRARY} lib_test4)
SET(install_target SimpleInstExeS2)
IF("${TEST1_LIBRARY}" MATCHES "static")