2016-04-23 07:42:05 +00:00
|
|
|
# Open Asset Import Library (assimp)
|
|
|
|
# ----------------------------------------------------------------------
|
2018-01-28 18:42:05 +00:00
|
|
|
# Copyright (c) 2006-2018, assimp team
|
|
|
|
|
2016-04-23 07:42:05 +00:00
|
|
|
# All rights reserved.
|
|
|
|
#
|
|
|
|
# Redistribution and use of this software in source and binary forms,
|
|
|
|
# with or without modification, are permitted provided that the
|
|
|
|
# following conditions are met:
|
|
|
|
#
|
|
|
|
# * Redistributions of source code must retain the above
|
|
|
|
# copyright notice, this list of conditions and the
|
|
|
|
# following disclaimer.
|
|
|
|
#
|
|
|
|
# * Redistributions in binary form must reproduce the above
|
|
|
|
# copyright notice, this list of conditions and the
|
|
|
|
# following disclaimer in the documentation and/or other
|
|
|
|
# materials provided with the distribution.
|
|
|
|
#
|
|
|
|
# * Neither the name of the assimp team, nor the names of its
|
|
|
|
# contributors may be used to endorse or promote products
|
|
|
|
# derived from this software without specific prior
|
|
|
|
# written permission of the assimp team.
|
|
|
|
#
|
|
|
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
|
|
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
|
|
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
|
|
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
|
|
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
#----------------------------------------------------------------------
|
|
|
|
SET(CMAKE_LEGACY_CYGWIN_WIN32 0) # Remove when CMake >= 2.8.4 is required
|
2017-07-31 12:25:00 +00:00
|
|
|
CMAKE_MINIMUM_REQUIRED( VERSION 2.8 )
|
2010-03-03 22:07:59 +00:00
|
|
|
PROJECT( Assimp )
|
2011-05-09 19:34:21 +00:00
|
|
|
|
2016-08-13 07:13:22 +00:00
|
|
|
# All supported options ###############################################
|
2018-03-20 11:46:03 +00:00
|
|
|
|
|
|
|
if(NOT CMAKE_BUILD_TYPE)
|
|
|
|
set(CMAKE_BUILD_TYPE "Release")
|
|
|
|
endif()
|
|
|
|
|
2016-10-21 10:50:41 +00:00
|
|
|
OPTION( BUILD_SHARED_LIBS
|
|
|
|
"Build package with shared libraries."
|
2018-03-20 12:45:54 +00:00
|
|
|
ON
|
2016-08-13 07:13:22 +00:00
|
|
|
)
|
2018-03-20 11:46:03 +00:00
|
|
|
|
2017-11-19 22:10:05 +00:00
|
|
|
OPTION( BUILD_FRAMEWORK
|
|
|
|
"Build package as Mac OS X Framework bundle."
|
|
|
|
OFF
|
|
|
|
)
|
2016-08-13 07:13:22 +00:00
|
|
|
OPTION( ASSIMP_DOUBLE_PRECISION
|
|
|
|
"Set to ON to enable double precision processing"
|
|
|
|
OFF
|
|
|
|
)
|
2016-10-21 10:50:41 +00:00
|
|
|
OPTION( ASSIMP_OPT_BUILD_PACKAGES
|
|
|
|
"Set to ON to generate CPack configuration files and packaging targets"
|
2016-08-13 07:13:22 +00:00
|
|
|
OFF
|
|
|
|
)
|
2016-10-21 10:50:41 +00:00
|
|
|
OPTION( ASSIMP_ANDROID_JNIIOSYSTEM
|
|
|
|
"Android JNI IOSystem support is active"
|
2016-08-13 07:13:22 +00:00
|
|
|
OFF
|
|
|
|
)
|
|
|
|
OPTION( ASSIMP_NO_EXPORT
|
|
|
|
"Disable Assimp's export functionality."
|
|
|
|
OFF
|
|
|
|
)
|
|
|
|
OPTION( ASSIMP_BUILD_ZLIB
|
|
|
|
"Build your own zlib"
|
|
|
|
OFF
|
|
|
|
)
|
2017-07-31 12:25:00 +00:00
|
|
|
OPTION( ASSIMP_BUILD_ASSIMP_TOOLS
|
2016-08-13 07:13:22 +00:00
|
|
|
"If the supplementary tools for Assimp are built in addition to the library."
|
|
|
|
ON
|
|
|
|
)
|
2017-07-31 12:25:00 +00:00
|
|
|
OPTION ( ASSIMP_BUILD_SAMPLES
|
2016-08-13 07:13:22 +00:00
|
|
|
"If the official samples are built as well (needs Glut)."
|
|
|
|
OFF
|
|
|
|
)
|
|
|
|
OPTION ( ASSIMP_BUILD_TESTS
|
|
|
|
"If the test suite for Assimp is built in addition to the library."
|
|
|
|
ON
|
|
|
|
)
|
2016-11-16 11:24:55 +00:00
|
|
|
OPTION ( ASSIMP_COVERALLS
|
2017-07-31 12:25:00 +00:00
|
|
|
"Enable this to measure test coverage."
|
|
|
|
OFF
|
2016-11-16 11:24:55 +00:00
|
|
|
)
|
2017-09-30 13:35:11 +00:00
|
|
|
OPTION ( ASSIMP_WERROR
|
2017-09-14 07:54:02 +00:00
|
|
|
"Treat warnings as errors."
|
|
|
|
OFF
|
|
|
|
)
|
2017-09-12 15:57:44 +00:00
|
|
|
OPTION ( ASSIMP_ASAN
|
|
|
|
"Enable AddressSanitizer."
|
|
|
|
OFF
|
|
|
|
)
|
2017-10-07 14:13:08 +00:00
|
|
|
OPTION ( ASSIMP_UBSAN
|
|
|
|
"Enable Undefined Behavior sanitizer."
|
|
|
|
OFF
|
|
|
|
)
|
2017-07-31 12:25:00 +00:00
|
|
|
OPTION ( SYSTEM_IRRXML
|
|
|
|
"Use system installed Irrlicht/IrrXML library."
|
|
|
|
OFF
|
2017-04-27 15:19:51 +00:00
|
|
|
)
|
2017-04-18 12:51:17 +00:00
|
|
|
OPTION ( BUILD_DOCS
|
2017-07-31 12:25:00 +00:00
|
|
|
"Build documentation using Doxygen."
|
|
|
|
OFF
|
2017-04-18 12:51:17 +00:00
|
|
|
)
|
|
|
|
|
2018-01-03 16:22:07 +00:00
|
|
|
# Use subset of Windows.h
|
2017-06-01 13:50:19 +00:00
|
|
|
if (WIN32)
|
2017-07-31 12:25:00 +00:00
|
|
|
ADD_DEFINITIONS( -DWIN32_LEAN_AND_MEAN )
|
2017-06-01 13:50:19 +00:00
|
|
|
endif()
|
|
|
|
|
2016-08-13 07:13:22 +00:00
|
|
|
IF(MSVC)
|
2017-07-31 12:25:00 +00:00
|
|
|
SET (CMAKE_PREFIX_PATH "D:\\libs\\devil")
|
2016-08-13 07:13:22 +00:00
|
|
|
OPTION( ASSIMP_INSTALL_PDB
|
|
|
|
"Install MSVC debug files."
|
|
|
|
ON
|
|
|
|
)
|
|
|
|
ENDIF(MSVC)
|
|
|
|
|
2017-11-19 22:10:05 +00:00
|
|
|
IF (BUILD_FRAMEWORK)
|
|
|
|
SET (BUILD_SHARED_LIBS ON)
|
|
|
|
MESSAGE(STATUS "Framework bundle building enabled")
|
|
|
|
ENDIF(BUILD_FRAMEWORK)
|
|
|
|
|
2016-04-23 07:42:05 +00:00
|
|
|
IF(NOT BUILD_SHARED_LIBS)
|
2017-10-07 11:59:12 +00:00
|
|
|
MESSAGE(STATUS "Shared libraries disabled")
|
2016-04-23 07:42:05 +00:00
|
|
|
SET(LINK_SEARCH_START_STATIC TRUE)
|
2017-10-07 11:59:12 +00:00
|
|
|
ELSE()
|
|
|
|
MESSAGE(STATUS "Shared libraries enabled")
|
2016-04-23 07:42:05 +00:00
|
|
|
ENDIF(NOT BUILD_SHARED_LIBS)
|
2015-04-07 06:20:27 +00:00
|
|
|
|
2011-05-09 19:34:21 +00:00
|
|
|
# Define here the needed parameters
|
2017-07-18 17:02:08 +00:00
|
|
|
SET (ASSIMP_VERSION_MAJOR 4)
|
2017-12-11 12:22:20 +00:00
|
|
|
SET (ASSIMP_VERSION_MINOR 1)
|
|
|
|
SET (ASSIMP_VERSION_PATCH 0)
|
2016-04-23 07:42:05 +00:00
|
|
|
SET (ASSIMP_VERSION ${ASSIMP_VERSION_MAJOR}.${ASSIMP_VERSION_MINOR}.${ASSIMP_VERSION_PATCH})
|
2017-07-18 17:02:08 +00:00
|
|
|
SET (ASSIMP_SOVERSION 4)
|
2016-04-23 07:42:05 +00:00
|
|
|
SET (PROJECT_VERSION "${ASSIMP_VERSION}")
|
2011-05-09 19:34:21 +00:00
|
|
|
|
2017-07-31 12:25:00 +00:00
|
|
|
SET( ASSIMP_PACKAGE_VERSION "0" CACHE STRING "the package-specific version used for uploading the sources" )
|
2011-05-09 19:34:21 +00:00
|
|
|
|
2015-06-23 19:28:13 +00:00
|
|
|
# Needed for openddl_parser config, no use of c++11 at this moment
|
2017-07-31 12:25:00 +00:00
|
|
|
ADD_DEFINITIONS( -DOPENDDL_NO_USE_CPP11 )
|
2016-03-31 09:11:55 +00:00
|
|
|
set_property( GLOBAL PROPERTY CXX_STANDARD 11 )
|
2015-02-07 17:26:57 +00:00
|
|
|
|
2014-05-19 12:36:24 +00:00
|
|
|
# Get the current working branch
|
2016-04-23 07:42:05 +00:00
|
|
|
EXECUTE_PROCESS(
|
2015-05-19 03:44:54 +00:00
|
|
|
COMMAND git rev-parse --abbrev-ref HEAD
|
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
OUTPUT_VARIABLE GIT_BRANCH
|
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
2015-09-02 08:04:28 +00:00
|
|
|
ERROR_QUIET
|
2014-05-19 12:36:24 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# Get the latest abbreviated commit hash of the working branch
|
2016-04-23 07:42:05 +00:00
|
|
|
EXECUTE_PROCESS(
|
2015-05-19 03:44:54 +00:00
|
|
|
COMMAND git log -1 --format=%h
|
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
OUTPUT_VARIABLE GIT_COMMIT_HASH
|
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
2015-09-02 08:04:28 +00:00
|
|
|
ERROR_QUIET
|
2014-05-19 12:36:24 +00:00
|
|
|
)
|
|
|
|
|
2016-04-23 07:42:05 +00:00
|
|
|
IF(NOT GIT_COMMIT_HASH)
|
2017-07-31 12:25:00 +00:00
|
|
|
SET(GIT_COMMIT_HASH 0)
|
2016-04-23 07:42:05 +00:00
|
|
|
ENDIF(NOT GIT_COMMIT_HASH)
|
2014-05-19 12:36:24 +00:00
|
|
|
|
2016-07-15 03:20:16 +00:00
|
|
|
IF(ASSIMP_DOUBLE_PRECISION)
|
2017-07-31 12:25:00 +00:00
|
|
|
ADD_DEFINITIONS(-DASSIMP_DOUBLE_PRECISION)
|
2016-07-15 03:20:16 +00:00
|
|
|
ENDIF(ASSIMP_DOUBLE_PRECISION)
|
|
|
|
|
2017-07-31 12:25:00 +00:00
|
|
|
CONFIGURE_FILE(
|
2016-06-29 22:42:08 +00:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/revision.h.in
|
2015-05-19 03:44:54 +00:00
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/revision.h
|
2014-05-19 12:36:24 +00:00
|
|
|
)
|
|
|
|
|
2017-07-31 12:25:00 +00:00
|
|
|
CONFIGURE_FILE(
|
2016-07-16 08:39:06 +00:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/include/assimp/config.h.in
|
2017-03-31 13:56:49 +00:00
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/include/assimp/config.h
|
2016-07-16 06:02:47 +00:00
|
|
|
)
|
|
|
|
|
2017-07-31 12:25:00 +00:00
|
|
|
INCLUDE_DIRECTORIES(
|
2016-06-10 23:14:25 +00:00
|
|
|
./
|
2017-07-31 12:25:00 +00:00
|
|
|
include
|
2016-06-10 23:14:25 +00:00
|
|
|
${CMAKE_CURRENT_BINARY_DIR}
|
2016-07-16 06:02:47 +00:00
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/include
|
2016-06-10 23:14:25 +00:00
|
|
|
)
|
2014-05-19 12:36:24 +00:00
|
|
|
|
2017-06-10 18:12:12 +00:00
|
|
|
LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake-modules" )
|
2016-04-23 07:42:05 +00:00
|
|
|
SET(LIBASSIMP_COMPONENT "libassimp${ASSIMP_VERSION_MAJOR}.${ASSIMP_VERSION_MINOR}.${ASSIMP_VERSION_PATCH}" )
|
|
|
|
SET(LIBASSIMP-DEV_COMPONENT "libassimp${ASSIMP_VERSION_MAJOR}.${ASSIMP_VERSION_MINOR}.${ASSIMP_VERSION_PATCH}-dev" )
|
|
|
|
SET(CPACK_COMPONENTS_ALL assimp-bin ${LIBASSIMP_COMPONENT} ${LIBASSIMP-DEV_COMPONENT} assimp-dev)
|
|
|
|
SET(ASSIMP_LIBRARY_SUFFIX "" CACHE STRING "Suffix to append to library names")
|
2011-05-09 19:34:21 +00:00
|
|
|
|
2016-08-14 10:23:16 +00:00
|
|
|
IF( UNIX )
|
2017-04-25 12:35:07 +00:00
|
|
|
# Ensure that we do not run into issues like http://www.tcm.phy.cam.ac.uk/sw/inodes64.html on 32 bit linux
|
2017-11-14 19:11:40 +00:00
|
|
|
IF( ${OPERATING_SYSTEM} MATCHES "Android")
|
|
|
|
ELSE()
|
|
|
|
IF ( CMAKE_SIZEOF_VOID_P EQUAL 4) # only necessary for 32-bit linux
|
2017-11-18 17:32:16 +00:00
|
|
|
#ADD_DEFINITIONS(-D_FILE_OFFSET_BITS=64 )
|
2017-11-14 19:11:40 +00:00
|
|
|
ENDIF()
|
2016-08-14 10:23:16 +00:00
|
|
|
ENDIF()
|
|
|
|
|
2017-04-25 12:35:07 +00:00
|
|
|
# Use GNUInstallDirs for Unix predefined directories
|
2017-07-31 12:25:00 +00:00
|
|
|
INCLUDE(GNUInstallDirs)
|
2017-04-18 12:51:17 +00:00
|
|
|
ENDIF( UNIX )
|
|
|
|
|
2017-04-29 06:44:58 +00:00
|
|
|
# Grouped compiler settings
|
2017-04-27 15:19:51 +00:00
|
|
|
IF ((CMAKE_C_COMPILER_ID MATCHES "GNU") AND NOT CMAKE_COMPILER_IS_MINGW)
|
2015-05-19 03:44:54 +00:00
|
|
|
# hide all not-exported symbols
|
2017-05-02 14:45:37 +00:00
|
|
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -fvisibility=hidden -fPIC -Wall -std=c++0x")
|
2017-05-23 13:34:02 +00:00
|
|
|
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
|
2017-04-29 06:44:58 +00:00
|
|
|
SET(LIBSTDC++_LIBRARIES -lstdc++)
|
2016-04-23 07:42:05 +00:00
|
|
|
ELSEIF(MSVC)
|
2015-05-19 03:44:54 +00:00
|
|
|
# enable multi-core compilation with MSVC
|
2016-03-14 22:14:31 +00:00
|
|
|
add_compile_options(/MP)
|
2018-01-27 08:20:22 +00:00
|
|
|
if("${CMAKE_GENERATOR}" MATCHES "(Win64|IA64)")
|
|
|
|
add_compile_options( /bigobj )
|
|
|
|
endif()
|
2017-10-02 10:08:20 +00:00
|
|
|
# disable "elements of array '' will be default initialized" warning on MSVC2013
|
|
|
|
IF(MSVC12)
|
|
|
|
add_compile_options(/wd4351)
|
|
|
|
ENDIF()
|
2017-04-27 15:19:51 +00:00
|
|
|
ELSEIF ( "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
|
2017-09-30 13:28:02 +00:00
|
|
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -fvisibility=hidden -fPIC -Wall -Wno-long-long -std=c++11" )
|
|
|
|
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
|
2016-04-20 22:02:28 +00:00
|
|
|
ELSEIF( CMAKE_COMPILER_IS_MINGW )
|
2017-09-30 13:28:02 +00:00
|
|
|
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -Wall -Wno-long-long -std=c++11" )
|
|
|
|
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
|
2017-07-31 12:25:00 +00:00
|
|
|
ADD_DEFINITIONS( -U__STRICT_ANSI__ )
|
2016-04-23 07:42:05 +00:00
|
|
|
ENDIF()
|
2009-04-18 00:10:16 +00:00
|
|
|
|
2018-02-09 15:02:27 +00:00
|
|
|
if (IOS)
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fembed-bitcode -O3")
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fembed-bitcode -O3")
|
|
|
|
endif()
|
2017-10-31 01:05:01 +00:00
|
|
|
|
2016-11-16 11:24:55 +00:00
|
|
|
if (ASSIMP_COVERALLS)
|
2017-10-07 11:59:12 +00:00
|
|
|
MESSAGE(STATUS "Coveralls enabled")
|
2017-07-31 12:25:00 +00:00
|
|
|
INCLUDE(Coveralls)
|
|
|
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage")
|
|
|
|
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage")
|
2016-11-16 10:39:44 +00:00
|
|
|
endif()
|
|
|
|
|
2017-09-14 07:54:02 +00:00
|
|
|
if (ASSIMP_WERROR)
|
2017-10-07 11:59:12 +00:00
|
|
|
MESSAGE(STATUS "Treating warnings as errors")
|
2017-10-02 08:40:57 +00:00
|
|
|
IF (MSVC)
|
|
|
|
add_compile_options(/WX)
|
|
|
|
ELSE()
|
2017-09-14 07:54:02 +00:00
|
|
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
|
|
|
|
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")
|
2017-10-02 08:40:57 +00:00
|
|
|
ENDIF()
|
2017-09-14 07:54:02 +00:00
|
|
|
endif()
|
|
|
|
|
2017-09-12 15:57:44 +00:00
|
|
|
if (ASSIMP_ASAN)
|
2017-10-07 11:59:12 +00:00
|
|
|
MESSAGE(STATUS "AddressSanitizer enabled")
|
2017-09-12 15:57:44 +00:00
|
|
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
|
|
|
|
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address")
|
|
|
|
endif()
|
|
|
|
|
2017-10-07 14:13:08 +00:00
|
|
|
if (ASSIMP_UBSAN)
|
|
|
|
MESSAGE(STATUS "Undefined Behavior sanitizer enabled")
|
|
|
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=undefined -fno-sanitize-recover=all")
|
|
|
|
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=undefined -fno-sanitize-recover=all")
|
|
|
|
endif()
|
|
|
|
|
2017-03-02 03:12:47 +00:00
|
|
|
INCLUDE (FindPkgMacros)
|
2013-04-20 21:15:59 +00:00
|
|
|
INCLUDE (PrecompiledHeader)
|
|
|
|
|
2010-03-03 22:55:02 +00:00
|
|
|
# If this is an in-source build (CMAKE_SOURCE_DIR == CMAKE_BINARY_DIR),
|
|
|
|
# write the library/executable files to the respective directories in the
|
|
|
|
# source tree. During an out-of-source build, however, do not litter this
|
|
|
|
# directory, since that is probably what the user wanted to avoid.
|
|
|
|
IF ( CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR )
|
2015-05-19 03:44:54 +00:00
|
|
|
SET( CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_HOME_DIRECTORY}/lib" )
|
|
|
|
SET( CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_HOME_DIRECTORY}/lib" )
|
|
|
|
SET( CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_HOME_DIRECTORY}/bin" )
|
2010-03-03 22:55:02 +00:00
|
|
|
ENDIF ( CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR )
|
2010-02-27 12:00:00 +00:00
|
|
|
|
2010-03-03 21:48:23 +00:00
|
|
|
# Cache these to allow the user to override them manually.
|
2016-07-12 07:04:38 +00:00
|
|
|
SET( ASSIMP_LIB_INSTALL_DIR "lib" CACHE STRING
|
2015-05-19 03:44:54 +00:00
|
|
|
"Path the built library files are installed to." )
|
2016-07-12 07:04:38 +00:00
|
|
|
SET( ASSIMP_INCLUDE_INSTALL_DIR "include" CACHE STRING
|
2015-05-19 03:44:54 +00:00
|
|
|
"Path the header files are installed to." )
|
2016-07-12 07:04:38 +00:00
|
|
|
SET( ASSIMP_BIN_INSTALL_DIR "bin" CACHE STRING
|
2015-05-19 03:44:54 +00:00
|
|
|
"Path the tool executables are installed to." )
|
2009-04-18 00:10:16 +00:00
|
|
|
|
2016-02-22 20:24:03 +00:00
|
|
|
IF (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
2015-08-08 15:30:15 +00:00
|
|
|
SET(CMAKE_DEBUG_POSTFIX "d" CACHE STRING "Debug Postfix for lib, samples and tools")
|
2016-02-22 20:24:03 +00:00
|
|
|
ELSE()
|
|
|
|
SET(CMAKE_DEBUG_POSTFIX "" CACHE STRING "Debug Postfix for lib, samples and tools")
|
2015-08-08 15:30:15 +00:00
|
|
|
ENDIF()
|
2012-07-17 22:56:15 +00:00
|
|
|
|
2013-11-26 18:43:17 +00:00
|
|
|
# Only generate this target if no higher-level project already has
|
|
|
|
IF (NOT TARGET uninstall)
|
2015-05-19 03:44:54 +00:00
|
|
|
# add make uninstall capability
|
2017-07-31 12:25:00 +00:00
|
|
|
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/cmake-modules/cmake_uninstall.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" IMMEDIATE @ONLY)
|
2015-05-19 03:44:54 +00:00
|
|
|
add_custom_target(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
|
2013-11-26 18:43:17 +00:00
|
|
|
ENDIF()
|
2012-06-05 19:30:45 +00:00
|
|
|
|
2014-04-23 12:12:10 +00:00
|
|
|
# cmake configuration files
|
2017-07-31 12:25:00 +00:00
|
|
|
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}/assimp-config-version.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/assimp-config-version.cmake" @ONLY IMMEDIATE)
|
2014-04-23 12:12:10 +00:00
|
|
|
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/assimp-config.cmake" "${CMAKE_CURRENT_BINARY_DIR}/assimp-config-version.cmake" DESTINATION "${ASSIMP_LIB_INSTALL_DIR}/cmake/assimp-${ASSIMP_VERSION_MAJOR}.${ASSIMP_VERSION_MINOR}" COMPONENT ${LIBASSIMP-DEV_COMPONENT})
|
2010-09-27 08:31:09 +00:00
|
|
|
|
2015-07-04 20:08:26 +00:00
|
|
|
FIND_PACKAGE( DirectX )
|
|
|
|
|
2017-04-25 12:35:07 +00:00
|
|
|
IF( BUILD_DOCS )
|
|
|
|
add_subdirectory(doc)
|
|
|
|
ENDIF( BUILD_DOCS )
|
|
|
|
|
2017-04-27 15:19:51 +00:00
|
|
|
# Look for system installed irrXML
|
|
|
|
IF ( SYSTEM_IRRXML )
|
|
|
|
find_package( IrrXML REQUIRED )
|
|
|
|
ENDIF( SYSTEM_IRRXML )
|
|
|
|
|
2011-05-30 14:13:33 +00:00
|
|
|
# Search for external dependencies, and build them from source if not found
|
|
|
|
# Search for zlib
|
2016-06-22 07:38:10 +00:00
|
|
|
IF ( NOT ASSIMP_BUILD_ZLIB )
|
|
|
|
find_package(ZLIB)
|
2016-07-05 08:21:29 +00:00
|
|
|
ENDIF( NOT ASSIMP_BUILD_ZLIB )
|
2016-06-22 07:38:10 +00:00
|
|
|
|
2016-04-23 07:42:05 +00:00
|
|
|
IF( NOT ZLIB_FOUND )
|
2015-05-19 03:44:54 +00:00
|
|
|
message(STATUS "compiling zlib from souces")
|
2017-07-31 12:25:00 +00:00
|
|
|
INCLUDE(CheckIncludeFile)
|
|
|
|
INCLUDE(CheckTypeSize)
|
|
|
|
INCLUDE(CheckFunctionExists)
|
2015-05-19 03:44:54 +00:00
|
|
|
# compile from sources
|
|
|
|
add_subdirectory(contrib/zlib)
|
2016-04-23 07:42:05 +00:00
|
|
|
SET(ZLIB_FOUND 1)
|
|
|
|
SET(ZLIB_LIBRARIES zlibstatic)
|
|
|
|
SET(ZLIB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/contrib/zlib ${CMAKE_CURRENT_BINARY_DIR}/contrib/zlib)
|
2011-05-30 14:13:33 +00:00
|
|
|
else(NOT ZLIB_FOUND)
|
2015-05-19 03:44:54 +00:00
|
|
|
ADD_DEFINITIONS(-DASSIMP_BUILD_NO_OWN_ZLIB)
|
2016-04-23 07:42:05 +00:00
|
|
|
SET(ZLIB_LIBRARIES_LINKED -lz)
|
|
|
|
ENDIF(NOT ZLIB_FOUND)
|
2011-05-09 19:34:21 +00:00
|
|
|
INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR})
|
|
|
|
|
2011-05-30 14:13:33 +00:00
|
|
|
# Search for unzip
|
2018-03-19 20:51:52 +00:00
|
|
|
IF (NOT IOS)
|
|
|
|
use_pkgconfig(UNZIP minizip)
|
|
|
|
ENDIF (NOT IOS)
|
2011-05-30 14:13:33 +00:00
|
|
|
|
2012-07-17 22:56:15 +00:00
|
|
|
IF ( ASSIMP_NO_EXPORT )
|
2015-05-19 03:44:54 +00:00
|
|
|
ADD_DEFINITIONS( -DASSIMP_BUILD_NO_EXPORT)
|
|
|
|
MESSAGE( STATUS "Build an import-only version of Assimp." )
|
2012-07-17 22:56:15 +00:00
|
|
|
ENDIF( ASSIMP_NO_EXPORT )
|
2011-08-22 20:22:51 +00:00
|
|
|
|
2015-01-23 18:10:36 +00:00
|
|
|
SET ( ASSIMP_BUILD_ARCHITECTURE "" CACHE STRING
|
2015-05-19 03:44:54 +00:00
|
|
|
"describe the current architecture."
|
2011-09-28 09:04:49 +00:00
|
|
|
)
|
|
|
|
IF ( ASSIMP_BUILD_ARCHITECTURE STREQUAL "")
|
|
|
|
ELSE ( ASSIMP_BUILD_ARCHITECTURE STREQUAL "")
|
2015-05-19 03:44:54 +00:00
|
|
|
ADD_DEFINITIONS ( -D'ASSIMP_BUILD_ARCHITECTURE="${ASSIMP_BUILD_ARCHITECTURE}"' )
|
2011-09-28 09:04:49 +00:00
|
|
|
ENDIF ( ASSIMP_BUILD_ARCHITECTURE STREQUAL "")
|
|
|
|
|
2012-07-17 22:56:15 +00:00
|
|
|
# ${CMAKE_GENERATOR}
|
2015-01-23 18:10:36 +00:00
|
|
|
SET ( ASSIMP_BUILD_COMPILER "" CACHE STRING
|
2015-05-19 03:44:54 +00:00
|
|
|
"describe the current compiler."
|
2011-09-28 09:04:49 +00:00
|
|
|
)
|
|
|
|
IF ( ASSIMP_BUILD_COMPILER STREQUAL "")
|
|
|
|
ELSE ( ASSIMP_BUILD_COMPILER STREQUAL "")
|
2015-05-19 03:44:54 +00:00
|
|
|
ADD_DEFINITIONS ( -D'ASSIMP_BUILD_COMPILER="${ASSIMP_BUILD_COMPILER}"' )
|
2011-09-28 09:04:49 +00:00
|
|
|
ENDIF ( ASSIMP_BUILD_COMPILER STREQUAL "")
|
|
|
|
|
|
|
|
MARK_AS_ADVANCED ( ASSIMP_BUILD_ARCHITECTURE ASSIMP_BUILD_COMPILER )
|
|
|
|
|
2015-02-23 13:23:28 +00:00
|
|
|
SET ( ASSIMP_BUILD_NONFREE_C4D_IMPORTER OFF CACHE BOOL
|
2016-04-06 08:29:41 +00:00
|
|
|
"Build the C4D importer, which relies on the non-free Melange SDK."
|
2015-02-23 13:23:28 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
IF (ASSIMP_BUILD_NONFREE_C4D_IMPORTER)
|
2015-05-19 03:44:54 +00:00
|
|
|
IF ( MSVC )
|
2016-07-01 12:50:46 +00:00
|
|
|
SET(C4D_INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}/contrib/Melange/includes")
|
2015-05-19 03:44:54 +00:00
|
|
|
|
|
|
|
# pick the correct prebuilt library
|
2016-07-01 14:57:45 +00:00
|
|
|
IF(MSVC14)
|
|
|
|
SET(C4D_LIB_POSTFIX "_2015")
|
|
|
|
ELSEIF(MSVC12)
|
|
|
|
SET(C4D_LIB_POSTFIX "_2013")
|
|
|
|
ELSEIF(MSVC11)
|
|
|
|
SET(C4D_LIB_POSTFIX "_2012")
|
2015-05-19 03:44:54 +00:00
|
|
|
ELSEIF(MSVC10)
|
2016-07-01 14:57:45 +00:00
|
|
|
SET(C4D_LIB_POSTFIX "_2010")
|
2015-05-19 03:44:54 +00:00
|
|
|
ELSE()
|
2016-04-06 08:29:41 +00:00
|
|
|
MESSAGE( FATAL_ERROR
|
2016-07-01 14:57:45 +00:00
|
|
|
"C4D is currently only supported with MSVC 10, 11, 12, 14"
|
2015-05-19 03:44:54 +00:00
|
|
|
)
|
|
|
|
ENDIF()
|
2016-04-06 08:29:41 +00:00
|
|
|
|
2016-07-01 14:57:45 +00:00
|
|
|
SET(C4D_LIB_BASE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/contrib/Melange/libraries/win")
|
2016-04-06 08:29:41 +00:00
|
|
|
|
2016-07-01 14:57:45 +00:00
|
|
|
SET(C4D_DEBUG_LIBRARIES
|
|
|
|
"${C4D_LIB_BASE_PATH}/melangelib${C4D_LIB_POSTFIX}/melangelib_debug.lib"
|
|
|
|
"${C4D_LIB_BASE_PATH}/jpeglib${C4D_LIB_POSTFIX}/jpeglib_debug.lib"
|
|
|
|
)
|
|
|
|
SET(C4D_RELEASE_LIBRARIES
|
|
|
|
"${C4D_LIB_BASE_PATH}/melangelib${C4D_LIB_POSTFIX}/melangelib_release.lib"
|
|
|
|
"${C4D_LIB_BASE_PATH}/jpeglib${C4D_LIB_POSTFIX}/jpeglib_release.lib"
|
|
|
|
)
|
2016-04-06 08:29:41 +00:00
|
|
|
|
2015-05-19 03:44:54 +00:00
|
|
|
# winsock and winmm are necessary dependencies of melange (this is undocumented, but true.)
|
|
|
|
SET(C4D_EXTRA_LIBRARIES WSock32.lib Winmm.lib)
|
|
|
|
ELSE ()
|
2016-04-06 08:29:41 +00:00
|
|
|
MESSAGE( FATAL_ERROR
|
2015-05-19 03:44:54 +00:00
|
|
|
"C4D is currently only available on Windows with melange SDK installed in contrib/Melange"
|
|
|
|
)
|
|
|
|
ENDIF ( MSVC )
|
2016-04-23 07:42:05 +00:00
|
|
|
ELSE (ASSIMP_BUILD_NONFREE_C4D_IMPORTER)
|
2015-05-19 03:44:54 +00:00
|
|
|
ADD_DEFINITIONS( -DASSIMP_BUILD_NO_C4D_IMPORTER )
|
2015-02-23 13:23:28 +00:00
|
|
|
ENDIF (ASSIMP_BUILD_NONFREE_C4D_IMPORTER)
|
|
|
|
|
2017-04-27 15:19:51 +00:00
|
|
|
ADD_SUBDIRECTORY(contrib)
|
|
|
|
|
2010-03-03 21:46:56 +00:00
|
|
|
ADD_SUBDIRECTORY( code/ )
|
2012-07-17 22:56:15 +00:00
|
|
|
IF ( ASSIMP_BUILD_ASSIMP_TOOLS )
|
2016-12-05 11:01:16 +00:00
|
|
|
IF ( WIN32 AND DirectX_D3DX9_LIBRARY )
|
2016-04-28 16:44:47 +00:00
|
|
|
option ( ASSIMP_BUILD_ASSIMP_VIEW "If the Assimp view tool is built. (requires DirectX)" ${DirectX_FOUND} )
|
|
|
|
IF ( ASSIMP_BUILD_ASSIMP_VIEW )
|
|
|
|
ADD_SUBDIRECTORY( tools/assimp_view/ )
|
|
|
|
ENDIF ( ASSIMP_BUILD_ASSIMP_VIEW )
|
2017-01-17 15:21:16 +00:00
|
|
|
ENDIF ( WIN32 AND DirectX_D3DX9_LIBRARY )
|
2016-06-22 07:38:10 +00:00
|
|
|
|
2015-05-19 03:44:54 +00:00
|
|
|
ADD_SUBDIRECTORY( tools/assimp_cmd/ )
|
2016-07-31 19:51:15 +00:00
|
|
|
|
|
|
|
# Check dependencies for assimp_qt_viewer.
|
|
|
|
# Why here? Maybe user do not want Qt viewer and have no Qt.
|
|
|
|
# Why assimp_qt_viewer/CMakeLists.txt still contain similar check?
|
|
|
|
# Because viewer can be build independently of Assimp.
|
2018-03-19 13:49:16 +00:00
|
|
|
IF (NOT IOS)
|
|
|
|
FIND_PACKAGE(Qt5Widgets QUIET)
|
|
|
|
ENDIF (NOT IOS)
|
|
|
|
FIND_PACKAGE(DevIL QUIET)
|
2018-03-20 12:45:54 +00:00
|
|
|
FIND_PACKAGE(OpenGL QUIET)
|
2016-10-21 10:50:41 +00:00
|
|
|
IF ( Qt5Widgets_FOUND AND IL_FOUND AND OPENGL_FOUND)
|
2016-07-31 19:51:15 +00:00
|
|
|
ADD_SUBDIRECTORY( tools/assimp_qt_viewer/ )
|
|
|
|
ELSE()
|
|
|
|
SET ( ASSIMP_QT_VIEWER_DEPENDENCIES "")
|
2016-09-10 07:27:29 +00:00
|
|
|
IF (NOT Qt5_FOUND)
|
|
|
|
SET ( ASSIMP_QT_VIEWER_DEPENDENCIES "${ASSIMP_QT_VIEWER_DEPENDENCIES} Qt5")
|
|
|
|
ENDIF (NOT Qt5_FOUND)
|
2016-07-31 19:51:15 +00:00
|
|
|
|
|
|
|
IF (NOT IL_FOUND)
|
|
|
|
SET ( ASSIMP_QT_VIEWER_DEPENDENCIES "${ASSIMP_QT_VIEWER_DEPENDENCIES} DevIL")
|
|
|
|
ENDIF (NOT IL_FOUND)
|
|
|
|
|
|
|
|
IF (NOT OPENGL_FOUND)
|
|
|
|
SET ( ASSIMP_QT_VIEWER_DEPENDENCIES "${ASSIMP_QT_VIEWER_DEPENDENCIES} OpengGL")
|
|
|
|
ENDIF (NOT OPENGL_FOUND)
|
|
|
|
|
|
|
|
MESSAGE (WARNING "Build of assimp_qt_viewer is disabled. Unsatisfied dendencies: ${ASSIMP_QT_VIEWER_DEPENDENCIES}")
|
2016-10-21 10:50:41 +00:00
|
|
|
ENDIF ( Qt5Widgets_FOUND AND IL_FOUND AND OPENGL_FOUND)
|
2012-07-17 22:56:15 +00:00
|
|
|
ENDIF ( ASSIMP_BUILD_ASSIMP_TOOLS )
|
2010-09-27 08:31:09 +00:00
|
|
|
|
2012-07-17 22:56:15 +00:00
|
|
|
IF ( ASSIMP_BUILD_SAMPLES)
|
2015-05-19 03:44:54 +00:00
|
|
|
IF ( WIN32 )
|
|
|
|
ADD_SUBDIRECTORY( samples/SimpleTexturedOpenGL/ )
|
|
|
|
ENDIF ( WIN32 )
|
|
|
|
ADD_SUBDIRECTORY( samples/SimpleOpenGL/ )
|
2012-07-17 22:56:15 +00:00
|
|
|
ENDIF ( ASSIMP_BUILD_SAMPLES )
|
|
|
|
|
2014-08-17 22:34:45 +00:00
|
|
|
IF ( ASSIMP_BUILD_TESTS )
|
2015-05-19 03:44:54 +00:00
|
|
|
ADD_SUBDIRECTORY( test/ )
|
2014-08-17 22:34:45 +00:00
|
|
|
ENDIF ( ASSIMP_BUILD_TESTS )
|
2012-07-17 22:56:15 +00:00
|
|
|
|
2014-10-15 05:28:14 +00:00
|
|
|
# Generate a pkg-config .pc for the Assimp library.
|
|
|
|
CONFIGURE_FILE( "${PROJECT_SOURCE_DIR}/assimp.pc.in" "${PROJECT_BINARY_DIR}/assimp.pc" @ONLY )
|
|
|
|
INSTALL( FILES "${PROJECT_BINARY_DIR}/assimp.pc" DESTINATION ${ASSIMP_LIB_INSTALL_DIR}/pkgconfig/ COMPONENT ${LIBASSIMP-DEV_COMPONENT})
|
|
|
|
|
2016-04-23 07:42:05 +00:00
|
|
|
IF(CMAKE_CPACK_COMMAND AND UNIX AND ASSIMP_OPT_BUILD_PACKAGES)
|
2015-05-19 03:44:54 +00:00
|
|
|
# Packing information
|
2016-04-23 07:42:05 +00:00
|
|
|
SET(CPACK_PACKAGE_NAME "assimp{ASSIMP_VERSION_MAJOR}")
|
|
|
|
SET(CPACK_PACKAGE_CONTACT "" CACHE STRING "Package maintainer and PGP signer.")
|
|
|
|
SET(CPACK_PACKAGE_VENDOR "https://github.com/assimp")
|
|
|
|
SET(CPACK_PACKAGE_DISPLAY_NAME "Assimp ${ASSIMP_VERSION}")
|
|
|
|
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY " - Open Asset Import Library ${ASSIMP_VERSION}")
|
|
|
|
SET(CPACK_PACKAGE_VERSION "${ASSIMP_VERSION}.${ASSIMP_PACKAGE_VERSION}" )
|
|
|
|
SET(CPACK_PACKAGE_VERSION_MAJOR "${ASSIMP_VERSION_MAJOR}")
|
|
|
|
SET(CPACK_PACKAGE_VERSION_MINOR "${ASSIMP_VERSION_MINOR}")
|
|
|
|
SET(CPACK_PACKAGE_VERSION_PATCH "${ASSIMP_VERSION_PATCH}")
|
|
|
|
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "assimp${ASSIMP_VERSION_MAJOR}.${ASSIMP_VERSION_MINOR}")
|
|
|
|
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
|
2015-05-19 03:44:54 +00:00
|
|
|
|
|
|
|
string(TOUPPER ${LIBASSIMP_COMPONENT} "LIBASSIMP_COMPONENT_UPPER")
|
|
|
|
string(TOUPPER ${LIBASSIMP-DEV_COMPONENT} "LIBASSIMP-DEV_COMPONENT_UPPER")
|
|
|
|
|
2016-04-23 07:42:05 +00:00
|
|
|
SET(CPACK_COMPONENT_ASSIMP-BIN_DISPLAY_NAME "tools")
|
|
|
|
SET(CPACK_COMPONENT_ASSIMP-BIN_DEPENDS "${LIBASSIMP_COMPONENT}" )
|
|
|
|
SET(CPACK_COMPONENT_${LIBASSIMP_COMPONENT_UPPER}_DISPLAY_NAME "libraries")
|
|
|
|
SET(CPACK_COMPONENT_${LIBASSIMP-DEV_COMPONENT_UPPER}_DISPLAY_NAME "common headers and installs")
|
|
|
|
SET(CPACK_COMPONENT_${LIBASSIMP-DEV_COMPONENT_UPPER}_DEPENDS $ "{LIBASSIMP_COMPONENT}" )
|
|
|
|
SET(CPACK_COMPONENT_ASSIMP-DEV_DISPLAY_NAME "${CPACK_COMPONENT_${LIBASSIMP-DEV_COMPONENT}_DISPLAY_NAME}" )
|
|
|
|
SET(CPACK_COMPONENT_ASSIMP-DEV_DEPENDS "${LIBASSIMP-DEV_COMPONENT}" )
|
|
|
|
SET(CPACK_DEBIAN_BUILD_DEPENDS debhelper cmake zlib1g-dev pkg-config)
|
2015-05-19 03:44:54 +00:00
|
|
|
|
|
|
|
# debian
|
2016-04-23 07:42:05 +00:00
|
|
|
SET(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
|
|
|
|
SET(CPACK_DEBIAN_CMAKE_OPTIONS "-DBUILD_ASSIMP_SAMPLES:BOOL=${ASSIMP_BUILD_SAMPLES}")
|
|
|
|
SET(CPACK_DEBIAN_PACKAGE_SECTION "libs" )
|
|
|
|
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_COMPONENTS_ALL}")
|
|
|
|
SET(CPACK_DEBIAN_PACKAGE_SUGGESTS)
|
|
|
|
SET(CPACK_DEBIAN_PACKAGE_NAME "assimp")
|
|
|
|
SET(CPACK_DEBIAN_PACKAGE_REMOVE_SOURCE_FILES contrib/cppunit-1.12.1 contrib/cppunit_note.txt contrib/zlib workspaces test doc obj samples packaging)
|
|
|
|
SET(CPACK_DEBIAN_PACKAGE_SOURCE_COPY svn export --force)
|
|
|
|
SET(CPACK_DEBIAN_CHANGELOG)
|
2015-05-19 03:44:54 +00:00
|
|
|
execute_process(COMMAND lsb_release -is
|
|
|
|
OUTPUT_VARIABLE _lsb_distribution OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
|
|
RESULT_VARIABLE _lsb_release_failed)
|
2016-04-23 07:42:05 +00:00
|
|
|
SET(CPACK_DEBIAN_DISTRIBUTION_NAME ${_lsb_distribution} CACHE STRING "Name of the distrubiton")
|
|
|
|
STRING(TOLOWER ${CPACK_DEBIAN_DISTRIBUTION_NAME} CPACK_DEBIAN_DISTRIBUTION_NAME)
|
|
|
|
IF( ${CPACK_DEBIAN_DISTRIBUTION_NAME} STREQUAL "ubuntu" )
|
|
|
|
SET(CPACK_DEBIAN_DISTRIBUTION_RELEASES lucid maverick natty oneiric precise CACHE STRING "Release code-names of the distrubiton release")
|
|
|
|
ENDIF()
|
|
|
|
SET(DPUT_HOST "" CACHE STRING "PPA repository to upload the debian sources")
|
2015-05-19 03:44:54 +00:00
|
|
|
include(CPack)
|
|
|
|
include(DebSourcePPA)
|
2016-04-23 07:42:05 +00:00
|
|
|
ENDIF()
|
2015-12-10 16:15:27 +00:00
|
|
|
|
|
|
|
if(WIN32)
|
2017-04-17 19:25:57 +00:00
|
|
|
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
|
|
|
|
SET(BIN_DIR "${PROJECT_SOURCE_DIR}/bin64/")
|
|
|
|
SET(LIB_DIR "${PROJECT_SOURCE_DIR}/lib64/")
|
|
|
|
elseif()
|
|
|
|
SET(BIN_DIR "${PROJECT_SOURCE_DIR}/bin32/")
|
|
|
|
SET(LIB_DIR "${PROJECT_SOURCE_DIR}/lib32/")
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
if(MSVC12)
|
|
|
|
SET(ASSIMP_MSVC_VERSION "vc120")
|
|
|
|
elseif(MSVC14)
|
|
|
|
SET(ASSIMP_MSVC_VERSION "vc140")
|
|
|
|
ENDIF(MSVC12)
|
|
|
|
|
|
|
|
if(MSVC12 OR MSVC14)
|
|
|
|
add_custom_target(UpdateAssimpLibsDebugSymbolsAndDLLs COMMENT "Copying Assimp Libraries ..." VERBATIM)
|
2017-07-29 11:45:25 +00:00
|
|
|
IF(CMAKE_GENERATOR MATCHES "^Visual Studio")
|
2017-07-31 12:25:00 +00:00
|
|
|
ADD_CUSTOM_COMMAND(TARGET UpdateAssimpLibsDebugSymbolsAndDLLs COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/code/Release/assimp-${ASSIMP_MSVC_VERSION}-mt.dll ${BIN_DIR}assimp-${ASSIMP_MSVC_VERSION}-mt.dll VERBATIM)
|
|
|
|
ADD_CUSTOM_COMMAND(TARGET UpdateAssimpLibsDebugSymbolsAndDLLs COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/code/Release/assimp-${ASSIMP_MSVC_VERSION}-mt.exp ${LIB_DIR}assimp-${ASSIMP_MSVC_VERSION}-mt.exp VERBATIM)
|
|
|
|
ADD_CUSTOM_COMMAND(TARGET UpdateAssimpLibsDebugSymbolsAndDLLs COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/code/Release/assimp-${ASSIMP_MSVC_VERSION}-mt.lib ${LIB_DIR}assimp-${ASSIMP_MSVC_VERSION}-mt.lib VERBATIM)
|
|
|
|
ADD_CUSTOM_COMMAND(TARGET UpdateAssimpLibsDebugSymbolsAndDLLs COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/code/Debug/assimp-${ASSIMP_MSVC_VERSION}-mtd.dll ${BIN_DIR}assimp-${ASSIMP_MSVC_VERSION}-mtd.dll VERBATIM)
|
|
|
|
ADD_CUSTOM_COMMAND(TARGET UpdateAssimpLibsDebugSymbolsAndDLLs COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/code/Debug/assimp-${ASSIMP_MSVC_VERSION}-mtd.exp ${LIB_DIR}assimp-${ASSIMP_MSVC_VERSION}-mtd.exp VERBATIM)
|
|
|
|
ADD_CUSTOM_COMMAND(TARGET UpdateAssimpLibsDebugSymbolsAndDLLs COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/code/Debug/assimp-${ASSIMP_MSVC_VERSION}-mtd.ilk ${LIB_DIR}assimp-${ASSIMP_MSVC_VERSION}-mtd.ilk VERBATIM)
|
|
|
|
ADD_CUSTOM_COMMAND(TARGET UpdateAssimpLibsDebugSymbolsAndDLLs COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/code/Debug/assimp-${ASSIMP_MSVC_VERSION}-mtd.lib ${LIB_DIR}assimp-${ASSIMP_MSVC_VERSION}-mtd.lib VERBATIM)
|
|
|
|
ADD_CUSTOM_COMMAND(TARGET UpdateAssimpLibsDebugSymbolsAndDLLs COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/code/Debug/assimp-${ASSIMP_MSVC_VERSION}-mtd.pdb ${LIB_DIR}assimp-${ASSIMP_MSVC_VERSION}-mtd.pdb VERBATIM)
|
2017-07-29 11:45:25 +00:00
|
|
|
ELSE()
|
2017-07-31 12:25:00 +00:00
|
|
|
ADD_CUSTOM_COMMAND(TARGET UpdateAssimpLibsDebugSymbolsAndDLLs COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/code/assimp-${ASSIMP_MSVC_VERSION}-mt.dll ${BIN_DIR}assimp-${ASSIMP_MSVC_VERSION}-mt.dll VERBATIM)
|
|
|
|
ADD_CUSTOM_COMMAND(TARGET UpdateAssimpLibsDebugSymbolsAndDLLs COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/code/assimp-${ASSIMP_MSVC_VERSION}-mt.exp ${LIB_DIR}assimp-${ASSIMP_MSVC_VERSION}-mt.exp VERBATIM)
|
|
|
|
ADD_CUSTOM_COMMAND(TARGET UpdateAssimpLibsDebugSymbolsAndDLLs COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/code/assimp-${ASSIMP_MSVC_VERSION}-mt.lib ${LIB_DIR}assimp-${ASSIMP_MSVC_VERSION}-mt.lib VERBATIM)
|
|
|
|
ADD_CUSTOM_COMMAND(TARGET UpdateAssimpLibsDebugSymbolsAndDLLs COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/code/assimp-${ASSIMP_MSVC_VERSION}-mtd.dll ${BIN_DIR}assimp-${ASSIMP_MSVC_VERSION}-mtd.dll VERBATIM)
|
|
|
|
ADD_CUSTOM_COMMAND(TARGET UpdateAssimpLibsDebugSymbolsAndDLLs COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/code/assimp-${ASSIMP_MSVC_VERSION}-mtd.exp ${LIB_DIR}assimp-${ASSIMP_MSVC_VERSION}-mtd.exp VERBATIM)
|
|
|
|
ADD_CUSTOM_COMMAND(TARGET UpdateAssimpLibsDebugSymbolsAndDLLs COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/code/assimp-${ASSIMP_MSVC_VERSION}-mtd.ilk ${LIB_DIR}assimp-${ASSIMP_MSVC_VERSION}-mtd.ilk VERBATIM)
|
|
|
|
ADD_CUSTOM_COMMAND(TARGET UpdateAssimpLibsDebugSymbolsAndDLLs COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/code/assimp-${ASSIMP_MSVC_VERSION}-mtd.lib ${LIB_DIR}assimp-${ASSIMP_MSVC_VERSION}-mtd.lib VERBATIM)
|
|
|
|
ADD_CUSTOM_COMMAND(TARGET UpdateAssimpLibsDebugSymbolsAndDLLs COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/code/assimp-${ASSIMP_MSVC_VERSION}-mtd.pdb ${LIB_DIR}assimp-${ASSIMP_MSVC_VERSION}-mtd.pdb VERBATIM)
|
|
|
|
ADD_CUSTOM_COMMAND(TARGET UpdateAssimpLibsDebugSymbolsAndDLLs COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/code/assimp-${ASSIMP_MSVC_VERSION}-mtd.pdb ${LIB_DIR}assimp-${ASSIMP_MSVC_VERSION}-mtd.pdb VERBATIM)
|
2017-07-29 11:45:25 +00:00
|
|
|
ENDIF()
|
2017-04-17 19:25:57 +00:00
|
|
|
ENDIF(MSVC12 OR MSVC14)
|
2016-04-23 07:42:05 +00:00
|
|
|
ENDIF (WIN32)
|