From 9d00c18761609cb02e667bcaa68f652f5dbb176b Mon Sep 17 00:00:00 2001 From: kimmi Date: Mon, 28 May 2012 19:20:56 +0000 Subject: [PATCH] Feature : Prepare FindPackage feature. git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1251 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- AssimpBuildTreeSettings.cmake.in | 3 +++ AssimpConfig.cmake.in | 21 +++++++++++++++++++++ AssimpConfigVersion.cmake.in | 11 +++++++++++ 3 files changed, 35 insertions(+) create mode 100644 AssimpBuildTreeSettings.cmake.in create mode 100644 AssimpConfig.cmake.in create mode 100644 AssimpConfigVersion.cmake.in diff --git a/AssimpBuildTreeSettings.cmake.in b/AssimpBuildTreeSettings.cmake.in new file mode 100644 index 000000000..342da1b08 --- /dev/null +++ b/AssimpBuildTreeSettings.cmake.in @@ -0,0 +1,3 @@ +set(ASSIMP_INCLUDE_DIRS + "@PROJECT_SOURCE_DIR@" + "@PROJECT_BINARY_DIR@") diff --git a/AssimpConfig.cmake.in b/AssimpConfig.cmake.in new file mode 100644 index 000000000..d46fa8315 --- /dev/null +++ b/AssimpConfig.cmake.in @@ -0,0 +1,21 @@ +# - Config file for the FooBar package +# It defines the following variables +# FOOBAR_INCLUDE_DIRS - include directories for FooBar +# FOOBAR_LIBRARIES - libraries to link against +# FOOBAR_EXECUTABLE - the bar executable + +# Compute paths +get_filename_component(FOOBAR_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) +if(EXISTS "${FOOBAR_CMAKE_DIR}/CMakeCache.txt") + # In build tree + include("${FOOBAR_CMAKE_DIR}/FooBarBuildTreeSettings.cmake") +else() + set(FOOBAR_INCLUDE_DIRS "${FOOBAR_CMAKE_DIR}/@CONF_REL_INCLUDE_DIR@") +endif() + +# Our library dependencies (contains definitions for IMPORTED targets) +include("${FOOBAR_CMAKE_DIR}/FooBarLibraryDepends.cmake") + +# These are IMPORTED targets created by FooBarLibraryDepends.cmake +set(FOOBAR_LIBRARIES foo) +set(FOOBAR_EXECUTABLE bar) diff --git a/AssimpConfigVersion.cmake.in b/AssimpConfigVersion.cmake.in new file mode 100644 index 000000000..7ffe759d5 --- /dev/null +++ b/AssimpConfigVersion.cmake.in @@ -0,0 +1,11 @@ +set(PACKAGE_VERSION "@ASSIMP_SOVERSION@") + +# Check whether the requested PACKAGE_FIND_VERSION is compatible +if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}") + set(PACKAGE_VERSION_COMPATIBLE FALSE) +else() + set(PACKAGE_VERSION_COMPATIBLE TRUE) + if ("${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}") + set(PACKAGE_VERSION_EXACT TRUE) + endif() +endif()