2007-03-05 21:27:55 +08:00
|
|
|
# INSTALL and SOURCE_GROUP commands for OSG/OT/Producer Modules
|
|
|
|
|
|
|
|
# Required Vars:
|
|
|
|
# ${LIB_NAME}
|
2011-03-08 21:51:13 +08:00
|
|
|
# ${TARGET_H}
|
2007-03-05 21:27:55 +08:00
|
|
|
|
|
|
|
SET(HEADERS_GROUP "Header Files")
|
|
|
|
|
|
|
|
SOURCE_GROUP(
|
2007-04-27 17:49:28 +08:00
|
|
|
${HEADERS_GROUP}
|
2011-03-08 21:51:13 +08:00
|
|
|
FILES ${TARGET_H}
|
2007-03-05 21:27:55 +08:00
|
|
|
)
|
|
|
|
|
2007-08-30 18:41:15 +08:00
|
|
|
IF(MSVC AND OSG_MSVC_VERSIONED_DLL)
|
2008-12-12 19:01:09 +08:00
|
|
|
HANDLE_MSVC_DLL()
|
2009-04-09 17:23:45 +08:00
|
|
|
ENDIF()
|
2007-03-09 22:54:41 +08:00
|
|
|
|
2018-11-14 18:28:21 +08:00
|
|
|
|
|
|
|
IF(OSG_EXPORT_TARGETS)
|
|
|
|
|
|
|
|
INSTALL(
|
|
|
|
TARGETS ${LIB_NAME}
|
|
|
|
EXPORT ${LIB_NAME}
|
|
|
|
RUNTIME DESTINATION ${INSTALL_BINDIR} COMPONENT libopenscenegraph
|
|
|
|
LIBRARY DESTINATION ${INSTALL_LIBDIR} COMPONENT libopenscenegraph
|
|
|
|
ARCHIVE DESTINATION ${INSTALL_ARCHIVEDIR} COMPONENT libopenscenegraph-dev
|
|
|
|
)
|
|
|
|
|
|
|
|
INSTALL(
|
|
|
|
EXPORT ${LIB_NAME}
|
|
|
|
NAMESPACE ${PKG_NAMESPACE}::
|
|
|
|
DESTINATION ${INSTALL_CONFIGDIR}
|
|
|
|
FILE ${LIB_NAME}-targets.cmake
|
|
|
|
COMPONENT libopenscenegraph-dev
|
|
|
|
)
|
|
|
|
|
2018-11-15 16:38:18 +08:00
|
|
|
SET(COMPONENT_CMAKE_DEPENDENCIES ${TARGET_LIBRARIES})
|
|
|
|
|
|
|
|
# These two libraries are special cases because they will always be included
|
|
|
|
# by the config-file.
|
|
|
|
LIST(REMOVE_ITEM COMPONENT_CMAKE_DEPENDENCIES OpenThreads)
|
|
|
|
LIST(REMOVE_ITEM COMPONENT_CMAKE_DEPENDENCIES osg)
|
|
|
|
|
|
|
|
SET(TARGET_IMPORT_INPUT_FILE "${PROJECT_SOURCE_DIR}/packaging/cmake/openscenegraph-component-import-targets.cmake")
|
|
|
|
SET(TARGET_IMPORT_OUTPUT_FILE "${PROJECT_BINARY_DIR}/packaging/cmake/openscenegraph-${LIB_NAME}-import-targets.cmake")
|
|
|
|
CONFIGURE_FILE(
|
|
|
|
${TARGET_IMPORT_INPUT_FILE}
|
|
|
|
${TARGET_IMPORT_OUTPUT_FILE}
|
|
|
|
@ONLY
|
|
|
|
)
|
|
|
|
INSTALL(
|
|
|
|
FILES ${TARGET_IMPORT_OUTPUT_FILE}
|
|
|
|
DESTINATION ${INSTALL_CONFIGDIR}
|
|
|
|
COMPONENT libopenscenegraph-dev
|
|
|
|
)
|
|
|
|
|
2018-11-14 18:28:21 +08:00
|
|
|
ELSE()
|
|
|
|
|
|
|
|
INSTALL(
|
|
|
|
TARGETS ${LIB_NAME}
|
|
|
|
RUNTIME DESTINATION ${INSTALL_BINDIR} COMPONENT libopenscenegraph
|
|
|
|
LIBRARY DESTINATION ${INSTALL_LIBDIR} COMPONENT libopenscenegraph
|
|
|
|
ARCHIVE DESTINATION ${INSTALL_ARCHIVEDIR} COMPONENT libopenscenegraph-dev
|
|
|
|
)
|
|
|
|
|
|
|
|
ENDIF()
|
|
|
|
|
2017-07-25 21:56:27 +08:00
|
|
|
IF(MSVC AND DYNAMIC_OPENSCENEGRAPH)
|
2013-02-12 20:09:00 +08:00
|
|
|
GET_TARGET_PROPERTY(PREFIX ${LIB_NAME} PREFIX)
|
2016-10-06 23:15:25 +08:00
|
|
|
INSTALL(FILES ${OUTPUT_BINDIR}/${PREFIX}${LIB_NAME}${CMAKE_RELWITHDEBINFO_POSTFIX}.pdb DESTINATION ${INSTALL_BINDIR} COMPONENT libopenscenegraph CONFIGURATIONS RelWithDebInfo)
|
|
|
|
INSTALL(FILES ${OUTPUT_BINDIR}/${PREFIX}${LIB_NAME}${CMAKE_DEBUG_POSTFIX}.pdb DESTINATION ${INSTALL_BINDIR} COMPONENT libopenscenegraph CONFIGURATIONS Debug)
|
2017-07-25 21:56:27 +08:00
|
|
|
ENDIF(MSVC AND DYNAMIC_OPENSCENEGRAPH)
|
2013-02-12 20:09:00 +08:00
|
|
|
|
2010-04-19 21:44:42 +08:00
|
|
|
IF(NOT OSG_COMPILE_FRAMEWORKS)
|
|
|
|
INSTALL (
|
2011-03-08 21:51:13 +08:00
|
|
|
FILES ${TARGET_H}
|
2010-04-19 21:44:42 +08:00
|
|
|
DESTINATION ${INSTALL_INCDIR}/${LIB_NAME}
|
|
|
|
COMPONENT libopenscenegraph-dev
|
|
|
|
)
|
|
|
|
ELSE()
|
|
|
|
SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
|
|
|
|
SET(CMAKE_INSTALL_RPATH "${OSG_COMPILE_FRAMEWORKS_INSTALL_NAME_DIR}")
|
|
|
|
|
|
|
|
SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES
|
|
|
|
FRAMEWORK TRUE
|
2010-07-31 16:57:52 +08:00
|
|
|
FRAMEWORK_VERSION ${OPENSCENEGRAPH_SOVERSION}
|
2011-03-08 21:51:13 +08:00
|
|
|
PUBLIC_HEADER "${TARGET_H}"
|
2010-04-19 21:44:42 +08:00
|
|
|
INSTALL_NAME_DIR "${OSG_COMPILE_FRAMEWORKS_INSTALL_NAME_DIR}"
|
|
|
|
)
|
|
|
|
# MESSAGE("${OSG_COMPILE_FRAMEWORKS_INSTALL_NAME_DIR}")
|
|
|
|
ENDIF()
|
2011-03-11 18:24:12 +08:00
|
|
|
|
2018-11-15 14:26:41 +08:00
|
|
|
|
|
|
|
# Install pkgconfig file for this component
|
|
|
|
SET(COMPONENT_PKGCONFIG_REQUIRES)
|
|
|
|
FOREACH(component ${TARGET_LIBRARIES})
|
|
|
|
IF(${component} STREQUAL "OpenThreads")
|
|
|
|
# Skip OpenThreads because that's handled separately
|
|
|
|
CONTINUE()
|
|
|
|
ENDIF()
|
|
|
|
SET(COMPONENT_PKGCONFIG_REQUIRES "${COMPONENT_PKGCONFIG_REQUIRES} openscenegraph-${component}")
|
|
|
|
ENDFOREACH()
|
|
|
|
|
|
|
|
SET(PKGCONFIG_INPUT_FILE "${PROJECT_SOURCE_DIR}/packaging/pkgconfig/component.pc.in")
|
|
|
|
SET(PKGCONFIG_OUTPUT_FILE "${PROJECT_BINARY_DIR}/packaging/pkgconfig/openscenegraph-${LIB_NAME}.pc")
|
|
|
|
CONFIGURE_FILE(
|
|
|
|
${PKGCONFIG_INPUT_FILE}
|
|
|
|
${PKGCONFIG_OUTPUT_FILE}
|
|
|
|
@ONLY
|
|
|
|
)
|
|
|
|
INSTALL(
|
|
|
|
FILES ${PKGCONFIG_OUTPUT_FILE}
|
|
|
|
DESTINATION ${INSTALL_PKGCONFIGDIR}
|
|
|
|
COMPONENT libopenscenegraph-dev
|
|
|
|
)
|