- Consolidate the use of different variables for bin, lib and include
- Keep ${exec_prefix}/ in pkgconfig, deriving relative paths from std vars
- Use CMAKE_INSTALL_FULL_* where absolute paths are expected
- Ensure GNUInstallDirs is included early in the project
- For WIN32, keep the existing bin installdir for libraries
Signed-off-by: Andreas Sturmlechner <[email protected]>
56 lines
1.7 KiB
CMake
56 lines
1.7 KiB
CMake
# INSTALL and SOURCE_GROUP commands for OSG/OT/Producer Modules
|
|
|
|
# Required Vars:
|
|
# ${LIB_NAME}
|
|
# ${TARGET_H}
|
|
|
|
SET(HEADERS_GROUP "Header Files")
|
|
|
|
SOURCE_GROUP(
|
|
${HEADERS_GROUP}
|
|
FILES ${TARGET_H}
|
|
)
|
|
|
|
IF(MSVC AND OSG_MSVC_VERSIONED_DLL)
|
|
HANDLE_MSVC_DLL()
|
|
ENDIF()
|
|
|
|
# Keep pre-existing WIN32 INSTALL_LIBDIR=bin setting
|
|
IF(WIN32)
|
|
INSTALL(TARGETS ${LIB_NAME}
|
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT libopenscenegraph
|
|
LIBRARY DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT libopenscenegraph
|
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libopenscenegraph-dev
|
|
)
|
|
ELSE()
|
|
INSTALL(TARGETS ${LIB_NAME}
|
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT libopenscenegraph
|
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libopenscenegraph
|
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libopenscenegraph-dev
|
|
)
|
|
ENDIF()
|
|
|
|
IF(MSVC AND DYNAMIC_OPENSCENEGRAPH)
|
|
INSTALL(FILES $<TARGET_PDB_FILE:${LIB_NAME}> DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT libopenthreads)
|
|
ENDIF(MSVC AND DYNAMIC_OPENSCENEGRAPH)
|
|
|
|
IF(NOT OSG_COMPILE_FRAMEWORKS)
|
|
INSTALL (
|
|
FILES ${TARGET_H}
|
|
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${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
|
|
FRAMEWORK_VERSION ${OPENSCENEGRAPH_SOVERSION}
|
|
PUBLIC_HEADER "${TARGET_H}"
|
|
INSTALL_NAME_DIR "${OSG_COMPILE_FRAMEWORKS_INSTALL_NAME_DIR}"
|
|
)
|
|
# MESSAGE("${OSG_COMPILE_FRAMEWORKS_INSTALL_NAME_DIR}")
|
|
ENDIF()
|
|
|