Build Hunter-compatible config file
parent
5cda81e84b
commit
d00f4f4b3a
|
@ -34,6 +34,8 @@
|
||||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
|
SET(CMAKE_POLICY_DEFAULT_CMP0074 NEW)
|
||||||
|
|
||||||
CMAKE_MINIMUM_REQUIRED( VERSION 3.0 )
|
CMAKE_MINIMUM_REQUIRED( VERSION 3.0 )
|
||||||
|
|
||||||
# Toggles the use of the hunter package manager
|
# Toggles the use of the hunter package manager
|
||||||
|
@ -49,7 +51,7 @@ IF(HUNTER_ENABLED)
|
||||||
add_definitions(-DASSIMP_USE_HUNTER)
|
add_definitions(-DASSIMP_USE_HUNTER)
|
||||||
ENDIF(HUNTER_ENABLED)
|
ENDIF(HUNTER_ENABLED)
|
||||||
|
|
||||||
PROJECT( Assimp )
|
PROJECT( Assimp VERSION 5.0.0 )
|
||||||
|
|
||||||
# All supported options ###############################################
|
# All supported options ###############################################
|
||||||
|
|
||||||
|
@ -164,12 +166,11 @@ ELSE()
|
||||||
ENDIF(NOT BUILD_SHARED_LIBS)
|
ENDIF(NOT BUILD_SHARED_LIBS)
|
||||||
|
|
||||||
# Define here the needed parameters
|
# Define here the needed parameters
|
||||||
SET (ASSIMP_VERSION_MAJOR 5)
|
SET (ASSIMP_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
|
||||||
SET (ASSIMP_VERSION_MINOR 0)
|
SET (ASSIMP_VERSION_MINOR ${PROJECT_VERSION_MINOR})
|
||||||
SET (ASSIMP_VERSION_PATCH 0)
|
SET (ASSIMP_VERSION_PATCH ${PROJECT_VERSION_PATCH})
|
||||||
SET (ASSIMP_VERSION ${ASSIMP_VERSION_MAJOR}.${ASSIMP_VERSION_MINOR}.${ASSIMP_VERSION_PATCH})
|
SET (ASSIMP_VERSION ${ASSIMP_VERSION_MAJOR}.${ASSIMP_VERSION_MINOR}.${ASSIMP_VERSION_PATCH})
|
||||||
SET (ASSIMP_SOVERSION 4)
|
SET (ASSIMP_SOVERSION 5)
|
||||||
SET (PROJECT_VERSION "${ASSIMP_VERSION}")
|
|
||||||
|
|
||||||
SET( ASSIMP_PACKAGE_VERSION "0" CACHE STRING "the package-specific version used for uploading the sources" )
|
SET( ASSIMP_PACKAGE_VERSION "0" CACHE STRING "the package-specific version used for uploading the sources" )
|
||||||
|
|
||||||
|
@ -353,28 +354,67 @@ IF (NOT TARGET uninstall)
|
||||||
ADD_CUSTOM_TARGET(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
|
ADD_CUSTOM_TARGET(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
# cmake configuration files
|
IF(HUNTER_ENABLED)
|
||||||
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/assimp-config.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/assimp-config.cmake" @ONLY IMMEDIATE)
|
set(CONFIG_INSTALL_DIR "lib/cmake/${PROJECT_NAME}")
|
||||||
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/assimpTargets.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/assimpTargets.cmake" @ONLY IMMEDIATE)
|
set(INCLUDE_INSTALL_DIR "include")
|
||||||
IF (is_multi_config)
|
|
||||||
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/assimpTargets-debug.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/assimpTargets-debug.cmake" @ONLY IMMEDIATE)
|
set(GENERATED_DIR "${CMAKE_CURRENT_BINARY_DIR}/generated")
|
||||||
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/assimpTargets-release.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/assimpTargets-release.cmake" @ONLY IMMEDIATE)
|
|
||||||
SET(PACKAGE_TARGETS_FILE "${CMAKE_CURRENT_BINARY_DIR}/assimpTargets-debug.cmake" "${CMAKE_CURRENT_BINARY_DIR}/assimpTargets-release.cmake")
|
# Configuration
|
||||||
ELSEIF (CMAKE_BUILD_TYPE STREQUAL Debug)
|
set(VERSION_CONFIG "${GENERATED_DIR}/${PROJECT_NAME}ConfigVersion.cmake")
|
||||||
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/assimpTargets-debug.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/assimpTargets-debug.cmake" @ONLY IMMEDIATE)
|
set(PROJECT_CONFIG "${GENERATED_DIR}/${PROJECT_NAME}Config.cmake")
|
||||||
SET(PACKAGE_TARGETS_FILE "${CMAKE_CURRENT_BINARY_DIR}/assimpTargets-debug.cmake")
|
set(TARGETS_EXPORT_NAME "${PROJECT_NAME}Targets")
|
||||||
ELSE()
|
set(NAMESPACE "${PROJECT_NAME}::")
|
||||||
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/assimpTargets-release.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/assimpTargets-release.cmake" @ONLY IMMEDIATE)
|
|
||||||
SET(PACKAGE_TARGETS_FILE "${CMAKE_CURRENT_BINARY_DIR}/assimpTargets-release.cmake")
|
# Include module with fuction 'write_basic_package_version_file'
|
||||||
ENDIF()
|
include(CMakePackageConfigHelpers)
|
||||||
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/assimp-config-version.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/assimp-config-version.cmake" @ONLY IMMEDIATE)
|
|
||||||
#we should generated these scripts after CMake VERSION 3.0.2 using export(EXPORT ...) and write_basic_package_version_file(...)
|
# Note: PROJECT_VERSION is used as a VERSION
|
||||||
INSTALL(FILES
|
write_basic_package_version_file("${VERSION_CONFIG}" COMPATIBILITY SameMajorVersion)
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/assimp-config.cmake"
|
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/assimp-config-version.cmake"
|
# Use variables:
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/assimpTargets.cmake"
|
# * TARGETS_EXPORT_NAME
|
||||||
${PACKAGE_TARGETS_FILE}
|
# * PROJECT_NAME
|
||||||
DESTINATION "${ASSIMP_LIB_INSTALL_DIR}/cmake/assimp-${ASSIMP_VERSION_MAJOR}.${ASSIMP_VERSION_MINOR}" COMPONENT ${LIBASSIMP-DEV_COMPONENT})
|
configure_package_config_file(
|
||||||
|
"cmake/assimp-hunter-config.cmake.in"
|
||||||
|
"${PROJECT_CONFIG}"
|
||||||
|
INSTALL_DESTINATION "${CONFIG_INSTALL_DIR}"
|
||||||
|
)
|
||||||
|
|
||||||
|
install(
|
||||||
|
FILES "${PROJECT_CONFIG}" "${VERSION_CONFIG}"
|
||||||
|
DESTINATION "${CONFIG_INSTALL_DIR}"
|
||||||
|
)
|
||||||
|
|
||||||
|
install(
|
||||||
|
EXPORT "${TARGETS_EXPORT_NAME}"
|
||||||
|
NAMESPACE "${NAMESPACE}"
|
||||||
|
DESTINATION "${CONFIG_INSTALL_DIR}"
|
||||||
|
)
|
||||||
|
ELSE(HUNTER_ENABLED)
|
||||||
|
# cmake configuration files
|
||||||
|
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/assimp-config.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/assimp-config.cmake" @ONLY IMMEDIATE)
|
||||||
|
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/assimpTargets.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/assimpTargets.cmake" @ONLY IMMEDIATE)
|
||||||
|
IF (is_multi_config)
|
||||||
|
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/assimpTargets-debug.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/assimpTargets-debug.cmake" @ONLY IMMEDIATE)
|
||||||
|
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/assimpTargets-release.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/assimpTargets-release.cmake" @ONLY IMMEDIATE)
|
||||||
|
SET(PACKAGE_TARGETS_FILE "${CMAKE_CURRENT_BINARY_DIR}/assimpTargets-debug.cmake" "${CMAKE_CURRENT_BINARY_DIR}/assimpTargets-release.cmake")
|
||||||
|
ELSEIF (CMAKE_BUILD_TYPE STREQUAL Debug)
|
||||||
|
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/assimpTargets-debug.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/assimpTargets-debug.cmake" @ONLY IMMEDIATE)
|
||||||
|
SET(PACKAGE_TARGETS_FILE "${CMAKE_CURRENT_BINARY_DIR}/assimpTargets-debug.cmake")
|
||||||
|
ELSE()
|
||||||
|
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/assimpTargets-release.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/assimpTargets-release.cmake" @ONLY IMMEDIATE)
|
||||||
|
SET(PACKAGE_TARGETS_FILE "${CMAKE_CURRENT_BINARY_DIR}/assimpTargets-release.cmake")
|
||||||
|
ENDIF()
|
||||||
|
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/assimp-config-version.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/assimp-config-version.cmake" @ONLY IMMEDIATE)
|
||||||
|
#we should generated these scripts after CMake VERSION 3.0.2 using export(EXPORT ...) and write_basic_package_version_file(...)
|
||||||
|
INSTALL(FILES
|
||||||
|
"${CMAKE_CURRENT_BINARY_DIR}/assimp-config.cmake"
|
||||||
|
"${CMAKE_CURRENT_BINARY_DIR}/assimp-config-version.cmake"
|
||||||
|
"${CMAKE_CURRENT_BINARY_DIR}/assimpTargets.cmake"
|
||||||
|
${PACKAGE_TARGETS_FILE}
|
||||||
|
DESTINATION "${ASSIMP_LIB_INSTALL_DIR}/cmake/assimp-${ASSIMP_VERSION_MAJOR}.${ASSIMP_VERSION_MINOR}" COMPONENT ${LIBASSIMP-DEV_COMPONENT})
|
||||||
|
ENDIF(HUNTER_ENABLED)
|
||||||
|
|
||||||
FIND_PACKAGE( DirectX )
|
FIND_PACKAGE( DirectX )
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
@PACKAGE_INIT@
|
||||||
|
|
||||||
|
find_package(RapidJSON CONFIG REQUIRED)
|
||||||
|
find_package(ZLIB CONFIG REQUIRED)
|
||||||
|
find_package(utf8 CONFIG REQUIRED)
|
||||||
|
find_package(irrXML CONFIG REQUIRED)
|
||||||
|
find_package(minizip CONFIG REQUIRED)
|
||||||
|
find_package(openddlparser CONFIG REQUIRED)
|
||||||
|
find_package(poly2tri CONFIG REQUIRED)
|
||||||
|
find_package(polyclipping CONFIG REQUIRED)
|
||||||
|
find_package(zip CONFIG REQUIRED)
|
||||||
|
|
||||||
|
include("${CMAKE_CURRENT_LIST_DIR}/@TARGETS_EXPORT_NAME@.cmake")
|
||||||
|
check_required_components("@PROJECT_NAME@")
|
|
@ -1209,12 +1209,23 @@ IF (RT_FOUND AND ASSIMP_IMPORTER_GLTF_USE_OPEN3DGC)
|
||||||
TARGET_LINK_LIBRARIES(assimp ${RT_LIBRARY})
|
TARGET_LINK_LIBRARIES(assimp ${RT_LIBRARY})
|
||||||
ENDIF (RT_FOUND AND ASSIMP_IMPORTER_GLTF_USE_OPEN3DGC)
|
ENDIF (RT_FOUND AND ASSIMP_IMPORTER_GLTF_USE_OPEN3DGC)
|
||||||
|
|
||||||
|
IF(HUNTER_ENABLED)
|
||||||
|
INSTALL( TARGETS assimp
|
||||||
|
EXPORT "${TARGETS_EXPORT_NAME}"
|
||||||
|
LIBRARY DESTINATION ${ASSIMP_LIB_INSTALL_DIR}
|
||||||
|
ARCHIVE DESTINATION ${ASSIMP_LIB_INSTALL_DIR}
|
||||||
|
RUNTIME DESTINATION ${ASSIMP_BIN_INSTALL_DIR}
|
||||||
|
FRAMEWORK DESTINATION ${ASSIMP_LIB_INSTALL_DIR}
|
||||||
|
COMPONENT ${LIBASSIMP_COMPONENT}
|
||||||
|
INCLUDES DESTINATION "include")
|
||||||
|
ELSE(HUNTER_ENABLED)
|
||||||
INSTALL( TARGETS assimp
|
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}
|
FRAMEWORK DESTINATION ${ASSIMP_LIB_INSTALL_DIR}
|
||||||
COMPONENT ${LIBASSIMP_COMPONENT})
|
COMPONENT ${LIBASSIMP_COMPONENT})
|
||||||
|
ENDIF(HUNTER_ENABLED)
|
||||||
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)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue