2012-11-20 13:58:15 +04:00
|
|
|
|
|
|
|
add_library(headeronly INTERFACE)
|
|
|
|
set_property(TARGET headeronly PROPERTY INTERFACE_INCLUDE_DIRECTORIES
|
|
|
|
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/headeronly>"
|
|
|
|
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include/headeronly>"
|
|
|
|
)
|
|
|
|
set_property(TARGET headeronly PROPERTY INTERFACE_COMPILE_DEFINITIONS "HEADERONLY_DEFINE")
|
|
|
|
|
|
|
|
include(GenerateExportHeader)
|
|
|
|
add_library(sharedlib SHARED sharedlib.cpp)
|
|
|
|
generate_export_header(sharedlib)
|
|
|
|
set_property(TARGET sharedlib PROPERTY INCLUDE_DIRECTORIES
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/sharedlib"
|
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}"
|
|
|
|
)
|
|
|
|
set_property(TARGET sharedlib PROPERTY INTERFACE_INCLUDE_DIRECTORIES
|
|
|
|
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/sharedlib;${CMAKE_CURRENT_BINARY_DIR}>"
|
|
|
|
"$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include/sharedlib>"
|
|
|
|
)
|
|
|
|
|
|
|
|
set_property(TARGET sharedlib PROPERTY INTERFACE_COMPILE_DEFINITIONS "SHAREDLIB_DEFINE")
|
|
|
|
|
|
|
|
add_library(sharediface INTERFACE)
|
|
|
|
target_link_libraries(sharediface INTERFACE sharedlib)
|
|
|
|
|
2013-12-26 11:30:30 +04:00
|
|
|
install(TARGETS headeronly sharediface
|
|
|
|
EXPORT expInterface
|
|
|
|
)
|
|
|
|
install(TARGETS sharedlib
|
2012-11-20 14:06:29 +04:00
|
|
|
EXPORT expInterface
|
|
|
|
RUNTIME DESTINATION bin
|
|
|
|
LIBRARY DESTINATION lib NAMELINK_SKIP
|
|
|
|
ARCHIVE DESTINATION lib
|
|
|
|
FRAMEWORK DESTINATION Frameworks
|
|
|
|
BUNDLE DESTINATION Applications
|
|
|
|
)
|
|
|
|
install(FILES
|
|
|
|
headeronly/headeronly.h
|
|
|
|
DESTINATION include/headeronly
|
|
|
|
)
|
|
|
|
install(FILES
|
|
|
|
sharedlib/sharedlib.h
|
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/sharedlib_export.h"
|
|
|
|
DESTINATION include/sharedlib
|
|
|
|
)
|
|
|
|
|
2013-07-30 11:51:56 +04:00
|
|
|
install(EXPORT expInterface NAMESPACE exp:: DESTINATION lib/exp)
|
2013-12-23 20:07:26 +04:00
|
|
|
|
|
|
|
export(EXPORT expInterface
|
|
|
|
NAMESPACE bld::
|
|
|
|
FILE ../ExportInterfaceBuildTree.cmake
|
|
|
|
)
|