Add support for building Mac OS X Framework bundles
parent
b408e25a1d
commit
4fb5038fb1
|
@ -42,6 +42,10 @@ OPTION( BUILD_SHARED_LIBS
|
||||||
"Build package with shared libraries."
|
"Build package with shared libraries."
|
||||||
ON
|
ON
|
||||||
)
|
)
|
||||||
|
OPTION( BUILD_FRAMEWORK
|
||||||
|
"Build package as Mac OS X Framework bundle."
|
||||||
|
OFF
|
||||||
|
)
|
||||||
OPTION( ASSIMP_DOUBLE_PRECISION
|
OPTION( ASSIMP_DOUBLE_PRECISION
|
||||||
"Set to ON to enable double precision processing"
|
"Set to ON to enable double precision processing"
|
||||||
OFF
|
OFF
|
||||||
|
@ -111,6 +115,11 @@ IF(MSVC)
|
||||||
)
|
)
|
||||||
ENDIF(MSVC)
|
ENDIF(MSVC)
|
||||||
|
|
||||||
|
IF (BUILD_FRAMEWORK)
|
||||||
|
SET (BUILD_SHARED_LIBS ON)
|
||||||
|
MESSAGE(STATUS "Framework bundle building enabled")
|
||||||
|
ENDIF(BUILD_FRAMEWORK)
|
||||||
|
|
||||||
IF(NOT BUILD_SHARED_LIBS)
|
IF(NOT BUILD_SHARED_LIBS)
|
||||||
MESSAGE(STATUS "Shared libraries disabled")
|
MESSAGE(STATUS "Shared libraries disabled")
|
||||||
SET(LINK_SEARCH_START_STATIC TRUE)
|
SET(LINK_SEARCH_START_STATIC TRUE)
|
||||||
|
|
|
@ -914,8 +914,27 @@ SET_TARGET_PROPERTIES( assimp PROPERTIES
|
||||||
)
|
)
|
||||||
|
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
SET_TARGET_PROPERTIES( assimp PROPERTIES INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/${ASSIMP_LIB_INSTALL_DIR}")
|
SET_TARGET_PROPERTIES( assimp PROPERTIES
|
||||||
endif()
|
INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/${ASSIMP_LIB_INSTALL_DIR}"
|
||||||
|
)
|
||||||
|
|
||||||
|
if (BUILD_FRAMEWORK)
|
||||||
|
SET_TARGET_PROPERTIES( assimp PROPERTIES
|
||||||
|
FRAMEWORK TRUE
|
||||||
|
FRAMEWORK_VERSION C
|
||||||
|
MACOSX_FRAMEWORK_IDENTIFIER net.sf.assimp
|
||||||
|
PUBLIC_HEADER "${PUBLIC_HEADERS}"
|
||||||
|
)
|
||||||
|
|
||||||
|
# PUBLIC_HEADER option does not support directory structure creation
|
||||||
|
# add ./Compiler/*.h to assimp.framework via copy command
|
||||||
|
ADD_CUSTOM_COMMAND(TARGET assimp POST_BUILD
|
||||||
|
COMMAND "${CMAKE_COMMAND}" -E copy_directory
|
||||||
|
"../${HEADER_PATH}/Compiler"
|
||||||
|
assimp.framework/Headers/Compiler
|
||||||
|
COMMENT "Copying public ./Compiler/ header files to framework bundle's Headers/Compiler/")
|
||||||
|
endif(BUILD_FRAMEWORK)
|
||||||
|
endif(APPLE)
|
||||||
|
|
||||||
# Build against external unzip, or add ../contrib/unzip so
|
# Build against external unzip, or add ../contrib/unzip so
|
||||||
# assimp can #include "unzip.h"
|
# assimp can #include "unzip.h"
|
||||||
|
@ -935,9 +954,11 @@ INSTALL( TARGETS assimp
|
||||||
LIBRARY DESTINATION ${ASSIMP_LIB_INSTALL_DIR}
|
LIBRARY DESTINATION ${ASSIMP_LIB_INSTALL_DIR}
|
||||||
ARCHIVE DESTINATION ${ASSIMP_LIB_INSTALL_DIR}
|
ARCHIVE DESTINATION ${ASSIMP_LIB_INSTALL_DIR}
|
||||||
RUNTIME DESTINATION ${ASSIMP_BIN_INSTALL_DIR}
|
RUNTIME DESTINATION ${ASSIMP_BIN_INSTALL_DIR}
|
||||||
|
FRAMEWORK DESTINATION ${ASSIMP_LIB_INSTALL_DIR}
|
||||||
COMPONENT ${LIBASSIMP_COMPONENT})
|
COMPONENT ${LIBASSIMP_COMPONENT})
|
||||||
INSTALL( FILES ${PUBLIC_HEADERS} DESTINATION ${ASSIMP_INCLUDE_INSTALL_DIR}/assimp COMPONENT assimp-dev)
|
INSTALL( FILES ${PUBLIC_HEADERS} DESTINATION ${ASSIMP_INCLUDE_INSTALL_DIR}/assimp COMPONENT assimp-dev)
|
||||||
INSTALL( FILES ${COMPILER_HEADERS} DESTINATION ${ASSIMP_INCLUDE_INSTALL_DIR}/assimp/Compiler COMPONENT assimp-dev)
|
INSTALL( FILES ${COMPILER_HEADERS} DESTINATION ${ASSIMP_INCLUDE_INSTALL_DIR}/assimp/Compiler COMPONENT assimp-dev)
|
||||||
|
|
||||||
if (ASSIMP_ANDROID_JNIIOSYSTEM)
|
if (ASSIMP_ANDROID_JNIIOSYSTEM)
|
||||||
INSTALL(FILES ${HEADER_PATH}/${ASSIMP_ANDROID_JNIIOSYSTEM_PATH}/AndroidJNIIOSystem.h
|
INSTALL(FILES ${HEADER_PATH}/${ASSIMP_ANDROID_JNIIOSYSTEM_PATH}/AndroidJNIIOSystem.h
|
||||||
DESTINATION ${ASSIMP_INCLUDE_INSTALL_DIR}
|
DESTINATION ${ASSIMP_INCLUDE_INSTALL_DIR}
|
||||||
|
|
Loading…
Reference in New Issue