From 16744d78d73e82125348a0b5130e9793d980ed96 Mon Sep 17 00:00:00 2001 From: rdiankov Date: Tue, 26 Feb 2013 14:02:35 +0900 Subject: [PATCH] fixed the broken cmake config files (assimp-cmake), adding version suffix libraries --- CMakeLists.txt | 8 ++++---- assimp-config-version.cmake.in | 16 ++++++++-------- assimp-config.cmake.in | 4 ++-- code/CMakeLists.txt | 1 + 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f5391f7d2..e6f89d62c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,10 +2,9 @@ cmake_minimum_required( VERSION 2.6 ) PROJECT( Assimp ) # Define here the needed parameters -set (ASSIMP_SV_REVISION 1264) set (ASSIMP_VERSION_MAJOR 3) set (ASSIMP_VERSION_MINOR 0) -set (ASSIMP_VERSION_PATCH ${ASSIMP_SV_REVISION}) # subversion revision? +set (ASSIMP_VERSION_PATCH 1) # subversion revision? set (ASSIMP_VERSION ${ASSIMP_VERSION_MAJOR}.${ASSIMP_VERSION_MINOR}.${ASSIMP_VERSION_PATCH}) set (ASSIMP_SOVERSION 3) SET ( PROJECT_VERSION "${ASSIMP_VERSION}" ) @@ -14,9 +13,10 @@ set(ASSIMP_PACKAGE_VERSION "0" CACHE STRING "the package-specific version used f option(ASSIMP_OPT_BUILD_PACKAGES "Set to ON to generate CPack configuration files and packaging targets" OFF) set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake-modules") -set(LIBASSIMP_COMPONENT libassimp${ASSIMP_VERSION_MAJOR}.${ASSIMP_VERSION_MINOR}-r${ASSIMP_SV_REVISION}) -set(LIBASSIMP-DEV_COMPONENT libassimp${ASSIMP_VERSION_MAJOR}.${ASSIMP_VERSION_MINOR}-r${ASSIMP_SV_REVISION}-dev) +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 "${ASSIMP_VERSION_MAJOR}.${ASSIMP_VERSION_MINOR}" CACHE STRING "Suffix to append to library names") if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) add_definitions(-fPIC) # this is a very important switch and some libraries seem now to have it.... diff --git a/assimp-config-version.cmake.in b/assimp-config-version.cmake.in index 2698a53ac..ff48b4822 100644 --- a/assimp-config-version.cmake.in +++ b/assimp-config-version.cmake.in @@ -1,13 +1,13 @@ -set( ASSIMP_PACKAGE_VERSION "@ASSIMP_VERSION@" ) -if( "${ASSIMP_PACKAGE_FIND_VERSION}" VERSION_EQUAL "@ASSIMP_VERSION@") - set(ASSIMP_PACKAGE_VERSION_EXACT 1) +set( PACKAGE_VERSION "@ASSIMP_VERSION@" ) +if( "${PACKAGE_FIND_VERSION}" VERSION_EQUAL "@ASSIMP_VERSION@") + set(PACKAGE_VERSION_EXACT 1) endif() -if( "${ASSIMP_PACKAGE_FIND_VERSION_MAJOR}.${ASSIMP_PACKAGE_FIND_VERSION_MINOR}" EQUAL "@ASSIMP_SOVERSION@" ) - set(ASSIMP_PACKAGE_VERSION_COMPATIBLE 1) -elseif( "${ASSIMP_PACKAGE_FIND_VERSION_MAJOR}" EQUAL "@ASSIMP_VERSION_MAJOR@" ) +if( "${PACKAGE_FIND_VERSION_MAJOR}.${PACKAGE_FIND_VERSION_MINOR}" EQUAL "@ASSIMP_SOVERSION@" ) + set(PACKAGE_VERSION_COMPATIBLE 1) +elseif( "${PACKAGE_FIND_VERSION_MAJOR}" EQUAL "@ASSIMP_VERSION_MAJOR@" ) # for now backward compatible if minor version is less - if( ${ASSIMP_PACKAGE_FIND_VERSION_MINOR} LESS @ASSIMP_VERSION_MINOR@ ) - set(ASSIMP_PACKAGE_VERSION_COMPATIBLE 1) + if( ${PACKAGE_FIND_VERSION_MINOR} LESS @ASSIMP_VERSION_MINOR@ ) + set(PACKAGE_VERSION_COMPATIBLE 1) endif() endif() set( ASSIMP_STATIC_LIB "@ASSIMP_BUILD_STATIC_LIB@") diff --git a/assimp-config.cmake.in b/assimp-config.cmake.in index 1d581b20a..75d233a0e 100644 --- a/assimp-config.cmake.in +++ b/assimp-config.cmake.in @@ -37,8 +37,8 @@ if( WIN32 ) set( ASSIMP_CXX_FLAGS " -DBOOST_ALL_DYN_LINK -DBOOST_ALL_NO_LIB") endif() set( ASSIMP_LINK_FLAGS "" ) -set( ASSIMP_LIBRARY_DIRS "${ASSIMP_ROOT_DIR}/@LIB_INSTALL_DIR@") -set( ASSIMP_INCLUDE_DIRS "${ASSIMP_ROOT_DIR}/@INCLUDE_INSTALL_DIR@") +set( ASSIMP_LIBRARY_DIRS "${ASSIMP_ROOT_DIR}/@ASSIMP_LIB_INSTALL_DIR@") +set( ASSIMP_INCLUDE_DIRS "${ASSIMP_ROOT_DIR}/@ASSIMP_INCLUDE_INSTALL_DIR@") set( ASSIMP_LIBRARIES assimp${ASSIMP_LIBRARY_SUFFIX}) # the boost version assimp was compiled with diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index fe3d28219..9746ffd87 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -696,6 +696,7 @@ TARGET_LINK_LIBRARIES(assimp ${ZLIB_LIBRARIES}) SET_TARGET_PROPERTIES( assimp PROPERTIES VERSION ${ASSIMP_VERSION} SOVERSION ${ASSIMP_SOVERSION} # use full version + OUTPUT_NAME assimp${ASSIMP_LIBRARY_SUFFIX} ) # Build against external unzip, or add ../contrib/unzip so # assimp can #include "unzip.h"