OpenSceneGraph/CMakeModules/ModuleInstall.cmake
Robert Osfield 339fe794b0 From Mourad Boufarguine,
"There is a redundant cmake code at the end of osgViewer cmake script. The install command is issued in SETUP_LIBRARY macro."
"I spotted this when i tried a make install on the android port :) I saw some weird copy commands of osgViewer headers.
I managed to get all osg headers copied to cmake_install_prefix/include upon make install, but i can't (yet) get the libraries to be copied to cmake_install_prefix/lib (see attached files)"
2011-03-11 10:24:12 +00:00

63 lines
1.5 KiB
CMake

# INSTALL and SOURCE_GROUP commands for OSG/OT/Producer Modules
# Required Vars:
# ${LIB_NAME}
# ${TARGET_H}
SET(INSTALL_INCDIR include)
SET(INSTALL_BINDIR bin)
IF(WIN32)
SET(INSTALL_LIBDIR bin)
SET(INSTALL_ARCHIVEDIR lib)
ELSE()
SET(INSTALL_LIBDIR lib${LIB_POSTFIX})
SET(INSTALL_ARCHIVEDIR lib${LIB_POSTFIX})
ENDIF()
SET(HEADERS_GROUP "Header Files")
SOURCE_GROUP(
${HEADERS_GROUP}
FILES ${TARGET_H}
)
IF(MSVC AND OSG_MSVC_VERSIONED_DLL)
HANDLE_MSVC_DLL()
ENDIF()
IF(ANDROID)
INSTALL (
FILES ${TARGET_H}
DESTINATION ${INSTALL_INCDIR}/${LIB_NAME}
COMPONENT libopenscenegraph-dev
)
ELSE(ANDROID)
INSTALL(
TARGETS ${LIB_NAME}
RUNTIME DESTINATION ${INSTALL_BINDIR} COMPONENT libopenscenegraph
LIBRARY DESTINATION ${INSTALL_LIBDIR} COMPONENT libopenscenegraph
ARCHIVE DESTINATION ${INSTALL_ARCHIVEDIR} COMPONENT libopenscenegraph-dev
)
IF(NOT OSG_COMPILE_FRAMEWORKS)
INSTALL (
FILES ${TARGET_H}
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
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()
ENDIF(ANDROID)