|
@@ -9,14 +9,22 @@ add_library(testExe1lib STATIC testExe1lib.c) # not exported
|
|
|
add_executable(testExe1 testExe1.c)
|
|
add_executable(testExe1 testExe1.c)
|
|
|
target_link_libraries(testExe1 testExe1lib)
|
|
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)
|
|
add_executable(testExe2 testExe2.c)
|
|
|
set_property(TARGET testExe2 PROPERTY ENABLE_EXPORTS 1)
|
|
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(testLib1 STATIC testLib1.c)
|
|
|
add_library(testLib2 STATIC testLib2.c)
|
|
add_library(testLib2 STATIC testLib2.c)
|
|
|
target_link_libraries(testLib2 testLib1)
|
|
target_link_libraries(testLib2 testLib1)
|
|
|
|
|
|
|
|
|
|
+add_library(testLib3Imp SHARED testLib3Imp.c)
|
|
|
add_library(testLib3 SHARED testLib3.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)
|
|
add_library(testLib4 SHARED testLib4.c)
|
|
|
set_property(TARGET testLib4 PROPERTY FRAMEWORK 1)
|
|
set_property(TARGET testLib4 PROPERTY FRAMEWORK 1)
|
|
@@ -24,9 +32,18 @@ set_property(TARGET testLib4 PROPERTY FRAMEWORK 1)
|
|
|
add_executable(testExe3 testExe3.c)
|
|
add_executable(testExe3 testExe3.c)
|
|
|
set_property(TARGET testExe3 PROPERTY MACOSX_BUNDLE 1)
|
|
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 and export from install tree.
|
|
|
install(
|
|
install(
|
|
|
TARGETS testExe1 testLib1 testLib2 testExe2 testLib3 testLib4 testExe3
|
|
TARGETS testExe1 testLib1 testLib2 testExe2 testLib3 testLib4 testExe3
|
|
|
|
|
+ testExe2lib
|
|
|
EXPORT exp
|
|
EXPORT exp
|
|
|
RUNTIME DESTINATION bin
|
|
RUNTIME DESTINATION bin
|
|
|
LIBRARY DESTINATION lib
|
|
LIBRARY DESTINATION lib
|
|
@@ -37,11 +54,11 @@ install(
|
|
|
install(EXPORT exp NAMESPACE exp_ DESTINATION lib/exp)
|
|
install(EXPORT exp NAMESPACE exp_ DESTINATION lib/exp)
|
|
|
|
|
|
|
|
# Export from build tree.
|
|
# Export from build tree.
|
|
|
-export(TARGETS testExe1 testLib1 testLib2
|
|
|
|
|
|
|
+export(TARGETS testExe1 testLib1 testLib2 testLib3
|
|
|
NAMESPACE bld_
|
|
NAMESPACE bld_
|
|
|
FILE ExportBuildTree.cmake
|
|
FILE ExportBuildTree.cmake
|
|
|
)
|
|
)
|
|
|
-export(TARGETS testExe2 testLib3 testLib4 testExe3
|
|
|
|
|
|
|
+export(TARGETS testExe2 testLib4 testExe3 testExe2lib
|
|
|
NAMESPACE bld_
|
|
NAMESPACE bld_
|
|
|
APPEND FILE ExportBuildTree.cmake
|
|
APPEND FILE ExportBuildTree.cmake
|
|
|
)
|
|
)
|