From Stephan Huber and Mathieu Marache, "attached you'll find framework support for os x via cmake. Please credit
Mathieu Marache, he added the last missing piece to this puzzle. I think it is safe to commit these changes to trunk, as the traditional way via dylibs should work as before. Here's some more info how to get frameworks: With these modifications it is possible to compile frameworks on OS X, when you set the Cmake-option OSG_COMPILE_FRAMEWORKS to true. If you want to embed the frameworks in your app-bundle make sure to set OSG_COMPILE_FRAMEWORKS_INSTALL_NAME_DIR accordingly. You'll have to build the install-target of the generated xcode-projects as this sets the install_name_dirs of the frameworks and plugins."
This commit is contained in:
@@ -29,12 +29,25 @@ INSTALL(
|
||||
TARGETS ${LIB_NAME}
|
||||
RUNTIME DESTINATION ${INSTALL_BINDIR} COMPONENT libopenscenegraph
|
||||
LIBRARY DESTINATION ${INSTALL_LIBDIR} COMPONENT libopenscenegraph
|
||||
ARCHIVE DESTINATION ${INSTALL_ARCHIVEDIR} COMPONENT libopenscenegraph-dev
|
||||
ARCHIVE DESTINATION ${INSTALL_ARCHIVEDIR} COMPONENT libopenscenegraph-dev
|
||||
FRAMEWORK DESTINATION /Library/Frameworks
|
||||
)
|
||||
|
||||
# FIXME: Do not run for OS X framework
|
||||
INSTALL(
|
||||
FILES ${LIB_PUBLIC_HEADERS}
|
||||
DESTINATION ${INSTALL_INCDIR}/${LIB_NAME}
|
||||
COMPONENT libopenscenegraph-dev
|
||||
)
|
||||
IF(NOT OSG_COMPILE_FRAMEWORKS)
|
||||
INSTALL (
|
||||
FILES ${LIB_PUBLIC_HEADERS}
|
||||
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_VERSION}
|
||||
PUBLIC_HEADER "${LIB_PUBLIC_HEADERS}"
|
||||
INSTALL_NAME_DIR "${OSG_COMPILE_FRAMEWORKS_INSTALL_NAME_DIR}"
|
||||
)
|
||||
# MESSAGE("${OSG_COMPILE_FRAMEWORKS_INSTALL_NAME_DIR}")
|
||||
ENDIF()
|
||||
|
||||
Reference in New Issue
Block a user