)
ENDIF(UNIX)
#-----------------------------------------------------------------------------
+
+#-----------------------------------------------------------------------------
+# Recurse into cmake folder to install files
+SUBDIRS(cmake)
+#-----------------------------------------------------------------------------
+
+
+# Set C preprocessor definitions
+ADD_DEF_WITH_VAL(BBTK_SHARE_REL_PATH ${BBTK_SHARE_REL_PATH})
+ADD_DEF_WITH_VAL(BBTK_DOC_REL_PATH ${BBTK_DOC_REL_PATH})
+ADD_DEF_WITH_VAL(BBTK_BBS_REL_PATH ${BBTK_BBS_REL_PATH})
+
#-----------------------------------------------------------------------------
# messages compilation options
IF (BBTK_COMPILE_MESSAGES)
# If not a core package must include necessary cmake scripts
IF(NOT BBTK_CORE_PACKAGE)
## TO DO
-# INCLUDE(${BBTK_DIR}/BBTKMacros.cmake)
-# INCLUDE(${BBTK_DIR}/BBTKFindLibraries.cmake)
+INCLUDE(${BBTK_CMAKE_DIR}/BBTKBuildAllOption.cmake)
+INCLUDE(${BBTK_CMAKE_DIR}/BBTKMacros.cmake)
+INCLUDE(${BBTK_CMAKE_DIR}/BBTKFindLibraries.cmake)
# etc.
ENDIF(NOT BBTK_CORE_PACKAGE)
#---------------------------------------------------------------------------
--- /dev/null
+# Use the installed appli
+# TO DO : use computed path for build/install tree
+SET(BBTK_BBI bbi)
+SET(BBTK_BBFY bbfy)
+SET(BBTK_BBDOC bbdoc)
+
+INCLUDE(${BBTK_CMAKE_DIR}/BBTKSetDeducedPaths.cmake)
+
ENDIF(BBTK_PACKAGE_INCLUDE_ALL_BBS_APPLI)
#----------------------------------------------------------------------------
-INCLUDE(${BBTK_DIR}/BBTKCreatePackageIncludeScript.cmake)
+INCLUDE(${BBTK_CMAKE_DIR}/BBTKCreatePackageIncludeScript.cmake)
BBTK_CREATE_PACKAGE_INCLUDE_SCRIPT(
"${BBTK_PACKAGE_NAME}"
# and include necessary cmake scripts
IF(NOT BBTK_CORE_PACKAGE)
## TO DO
-# INCLUDE(${BBTK_DIR}/BBTKMacros.cmake)
-# INCLUDE(${BBTK_DIR}/BBTKFindLibraries.cmake)
+# INCLUDE(${BBTK_CMAKE_DIR}/BBTKMacros.cmake)
+# INCLUDE(${BBTK_CMAKE_DIR}/BBTKFindLibraries.cmake)
# etc.
OPTION(BUILD_BBTK_PACKAGE_${BBTK_PACKAGE_NAME}_HTML_DOC
"Build the bbtk package ${BBTK_PACKAGE_NAME} html documentation ?" OFF)
#----------------------------------------------------------------------------
# CREATES bb${BBTK_PACKAGE_NAME}Package.h
CONFIGURE_FILE(
- ${BBTK_DIR}/bbPackage.h.in
+ ${BBTK_CMAKE_DIR}/bbPackage.h.in
${CMAKE_CURRENT_BINARY_DIR}/bb${BBTK_PACKAGE_NAME}Package.h
@ONLY IMMEDIATE
)
#----------------------------------------------------------------------------
# CREATES bb${BBTK_PACKAGE_NAME}Package.cxx
CONFIGURE_FILE(
- ${BBTK_DIR}/bbPackage.cxx.in
+ ${BBTK_CMAKE_DIR}/bbPackage.cxx.in
${CMAKE_CURRENT_BINARY_DIR}/bb${BBTK_PACKAGE_NAME}Package.cxx
@ONLY IMMEDIATE
)
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
-#OPTION(USE_WXWIDGETS "Build wxWidgets-based black boxes" OFF)
IF(USE_WXWIDGETS)
-
-IF(WIN32)
- # Search WXWIDGETS
-
- # WXWINDOWS_LIBRARY = full path to the wxWindows library and linker flags on unix
- # CMAKE_WX_CXX_FLAGS = compiler flags for building wxWindows
- # WXWINDOWS_INCLUDE_PATH = include path of wxWindows
- SET(WXWINDOWS_USE_GL 1)
-
- #wxWidgets build related stuff
- SET(WXW_USE_DEBUG ON)
- SET(WXW_USE_UNICODE OFF)
- SET(WXW_USE_SHARED ON)
- SET(WXW_USE_UNIV OFF)
- SET(WXW_USE_MONO OFF)
- SET(WXW_FILE_VERSION "28")
- SET(WXW_VERSION "2.8")
-
- #CMake Options
- # Why forcing verbosity ?
- # SET(CMAKE_VERBOSE_MAKEFILE TRUE)
-
- INCLUDE (${BBTK_DIR}/BBTKFindWX_WIN.cmake)
- #
- SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}${WXWIDGETS_CXX_FLAGS}")
- SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}${WXWIDGETS_EXE_LINKER_FLAGS}")
- ADD_DEFINITIONS( ${WXWIDGETS_DEFINITIONS} )
- #
- INCLUDE_DIRECTORIES(${WXWIDGETS_INCLUDE_DIR})
- LINK_DIRECTORIES( ${WXWIDGETS_LINK_DIRECTORIES} )
- SET(THE_WXWIDGETS_LIBRARIES
- ${WXWIDGETS_LIBRARIES}
- debug msvcrtd
- debug msvcprtd
- optimized msvcrt
- optimized msvcprt
- )
-ENDIF(WIN32)
-IF(UNIX)
- # GTK2
- INCLUDE(${BBTK_DIR}/BBTKFindGTK2.cmake)
- INCLUDE_DIRECTORIES(${GTK2_INCLUDE_DIRS})
- LINK_DIRECTORIES(${GTK2_LIBRARY_DIRS})
- LINK_LIBRARIES(${GTK2_LIBRARIES})
- # WX
- # LG : Do not force but use what is installed !
- # SET(wxWidgets_USE_LIBS base core gl)
- FIND_PACKAGE( wxWidgets REQUIRED)
- INCLUDE( ${wxWidgets_USE_FILE} )
- MARK_AS_ADVANCED(wxWidgets_CONFIG_EXECUTABLE)
- SET(THE_WXWIDGETS_LIBRARIES
- ${GTK2_LIBRARIES}
- ${wxWidgets_LIBRARIES}
- )
-ENDIF(UNIX)
-
-ADD_DEF( _USE_WXWIDGETS_ )
-SET(BBTK_WXWIDGETS_LIBRARIES
- ${THE_WXWIDGETS_LIBRARIES}
- )
-
+ INCLUDE(${BBTK_CMAKE_DIR}/BBTKWxWidgets.cmake)
+ BBTK_FIND_WXWIDGETS()
+ BBTK_USE_WXWIDGETS()
ENDIF(USE_WXWIDGETS)
#-----------------------------------------------------------------------------
+#-----------------------------------------------------------------------------
+# Path for binaries
+SET (EXECUTABLE_OUTPUT_REL_PATH bin)
+SET (LIBRARY_OUTPUT_REL_PATH bin)
+SET (EXECUTABLE_OUTPUT_PATH
+ ${PROJECT_BINARY_DIR}/${EXECUTABLE_OUTPUT_REL_PATH})
+SET (LIBRARY_OUTPUT_PATH
+ ${PROJECT_BINARY_DIR}/${LIBRARY_OUTPUT_REL_PATH})
+#-----------------------------------------------------------------------------
+
+
+
#-----------------------------------------------------------------------------
# The var BBTK_BIN_PATH
# gives the system-dependent path to output binaries
# BBTK_BBI, BBTK_BBFY and BBTK_BBDOC
# point to the system-dependent applications
# (.exe on win / no extension on lin)
+# WARNING :
+# On WIN32, these paths will only be right at *BUILD TIME* in VS6 or .net
+# Cannot be used at cmake run time !
IF(WIN32)
IF(CMAKE_GENERATOR STREQUAL "Visual Studio 6")
SET(BBTK_BIN_PATH ${EXECUTABLE_OUTPUT_PATH}/$(IntDir))
# from build tree root or install tree root
# (different on win/lin)
IF(WIN32)
+ SET(BBTK_SHARE_REL_PATH)
SET(BBTK_DOC_REL_PATH doc)
SET(BBTK_BBS_REL_PATH bbs)
ELSE(WIN32)
SET(BBTK_DOC_REL_PATH share/bbtk/doc)
SET(BBTK_BBS_REL_PATH share/bbtk/bbs)
ENDIF(WIN32)
-# Set C preprocessor definitions
-ADD_DEF_WITH_VAL(BBTK_DOC_REL_PATH ${BBTK_DOC_REL_PATH})
-ADD_DEF_WITH_VAL(BBTK_BBS_REL_PATH ${BBTK_BBS_REL_PATH})
-# Black box docs relative path
-SET(BBTK_BBDOC_REL_PATH ${BBTK_DOC_REL_PATH}/bbdoc)
-# Doxygen docs relative path
-SET(BBTK_DOXYGEN_REL_PATH ${BBTK_DOC_REL_PATH}/doxygen)
-
-# Now compute BUILD TREE and INSTALL TREE **ABSOLUTE PATHS**
-SET(BBTK_DOC_BUILD_PATH ${PROJECT_BINARY_DIR}/${BBTK_DOC_REL_PATH})
-SET(BBTK_BBDOC_BUILD_PATH ${PROJECT_BINARY_DIR}/${BBTK_BBDOC_REL_PATH})
-SET(BBTK_DOXYGEN_BUILD_PATH ${PROJECT_BINARY_DIR}/${BBTK_DOXYGEN_REL_PATH})
-SET(BBTK_BBS_BUILD_PATH ${PROJECT_BINARY_DIR}/${BBTK_BBS_REL_PATH})
-
-SET(BBTK_DOC_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/${BBTK_DOC_REL_PATH})
-SET(BBTK_BBDOC_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/${BBTK_BBDOC_REL_PATH})
-SET(BBTK_DOXYGEN_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/${BBTK_DOXYGEN_REL_PATH})
-SET(BBTK_BBS_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/${BBTK_BBS_REL_PATH})
-
-# Create build directories if necessary
-MKDIR(${BBTK_DOC_BUILD_PATH})
-MKDIR(${BBTK_BBDOC_BUILD_PATH})
-MKDIR(${BBTK_DOXYGEN_BUILD_PATH})
-MKDIR(${BBTK_DOXYGEN_BUILD_PATH})
-MKDIR(${BBTK_BBS_BUILD_PATH})
-
-#MESSAGE(STATUS "doc='${BBTK_DOC_INSTALL_PATH}'")
#-----------------------------------------------------------------------------
--- /dev/null
+# Black box docs relative path
+SET(BBTK_BBDOC_REL_PATH ${BBTK_DOC_REL_PATH}/bbdoc)
+# Doxygen docs relative path
+SET(BBTK_DOXYGEN_REL_PATH ${BBTK_DOC_REL_PATH}/doxygen)
+
+# Now compute BUILD TREE and INSTALL TREE **ABSOLUTE PATHS**
+SET(BBTK_DOC_BUILD_PATH ${PROJECT_BINARY_DIR}/${BBTK_DOC_REL_PATH})
+SET(BBTK_BBDOC_BUILD_PATH ${PROJECT_BINARY_DIR}/${BBTK_BBDOC_REL_PATH})
+SET(BBTK_DOXYGEN_BUILD_PATH ${PROJECT_BINARY_DIR}/${BBTK_DOXYGEN_REL_PATH})
+SET(BBTK_BBS_BUILD_PATH ${PROJECT_BINARY_DIR}/${BBTK_BBS_REL_PATH})
+
+SET(BBTK_DOC_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/${BBTK_DOC_REL_PATH})
+SET(BBTK_BBDOC_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/${BBTK_BBDOC_REL_PATH})
+SET(BBTK_DOXYGEN_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/${BBTK_DOXYGEN_REL_PATH})
+SET(BBTK_BBS_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/${BBTK_BBS_REL_PATH})
+
+# Create build directories if necessary
+MKDIR(${BBTK_DOC_BUILD_PATH})
+MKDIR(${BBTK_BBDOC_BUILD_PATH})
+MKDIR(${BBTK_DOXYGEN_BUILD_PATH})
+MKDIR(${BBTK_DOXYGEN_BUILD_PATH})
+MKDIR(${BBTK_BBS_BUILD_PATH})
+
+#-----------------------------------------------------------------------------
+SET (EXECUTABLE_OUTPUT_PATH
+ ${PROJECT_BINARY_DIR}/${EXECUTABLE_OUTPUT_REL_PATH})
+SET (LIBRARY_OUTPUT_PATH
+ ${PROJECT_BINARY_DIR}/${LIBRARY_OUTPUT_REL_PATH})
+#-----------------------------------------------------------------------------
+++ /dev/null
-#-----------------------------------------------------------------------------
-# Path for binaries : default = bin
-SET (EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin CACHE PATH "Single output directory for building all executables.")
-SET (LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin CACHE PATH "Single output directory for building all libraries.")
-MARK_AS_ADVANCED(LIBRARY_OUTPUT_PATH EXECUTABLE_OUTPUT_PATH)
-#-----------------------------------------------------------------------------
--- /dev/null
+#=======================================================================
+# Looks for WxWidgets
+# sets BBTK_WXWIDGETS_FOUND to true if found
+#=======================================================================
+MACRO(BBTK_FIND_WXWIDGETS)
+ IF(WIN32)
+ # Search WXWIDGETS
+
+ # WXWINDOWS_LIBRARY = full path to the wxWindows library and linker flags on unix
+ # CMAKE_WX_CXX_FLAGS = compiler flags for building wxWindows
+ # WXWINDOWS_INCLUDE_PATH = include path of wxWindows
+ SET(WXWINDOWS_USE_GL 1)
+
+ #wxWidgets build related stuff
+ SET(WXW_USE_DEBUG ON)
+ SET(WXW_USE_UNICODE OFF)
+ SET(WXW_USE_SHARED ON)
+ SET(WXW_USE_UNIV OFF)
+ SET(WXW_USE_MONO OFF)
+ SET(WXW_FILE_VERSION "28")
+ SET(WXW_VERSION "2.8")
+
+ #CMake Options
+ # Why forcing verbosity ?
+ # SET(CMAKE_VERBOSE_MAKEFILE TRUE)
+
+ INCLUDE (${BBTK_CMAKE_DIR}/BBTKFindWxWidgetsWIN32.cmake)
+ #
+
+ ELSE(WIN32)
+ # GTK2
+ INCLUDE(${BBTK_CMAKE_DIR}/BBTKFindGTK2.cmake)
+ # WX
+ # LG : Do not force but use what is installed !
+ # SET(wxWidgets_USE_LIBS base core gl)
+ FIND_PACKAGE( wxWidgets REQUIRED)
+ #
+ ENDIF(WIN32)
+
+
+
+ENDMACRO(BBTK_FIND_WXWIDGETS)
+#=======================================================================
+
+#=======================================================================
+MACRO(BBTK_USE_WXWIDGETS)
+ # Preprocessor settings
+ ADD_DEF( _USE_WXWIDGETS_ )
+ #
+ IF(WIN32)
+ # Clean ?
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}${WXWIDGETS_CXX_FLAGS}")
+ SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}${WXWIDGETS_EXE_LINKER_FLAGS}")
+ #
+ ADD_DEFINITIONS( ${WXWIDGETS_DEFINITIONS} )
+ #
+ INCLUDE_DIRECTORIES(${WXWIDGETS_INCLUDE_DIR})
+ LINK_DIRECTORIES( ${WXWIDGETS_LINK_DIRECTORIES} )
+ SET(BBTK_WXWIDGETS_LIBRARIES
+ ${WXWIDGETS_LIBRARIES}
+ debug msvcrtd
+ debug msvcprtd
+ optimized msvcrt
+ optimized msvcprt
+ )
+ ELSE(WIN32)
+ # GTK2
+ INCLUDE_DIRECTORIES(${GTK2_INCLUDE_DIRS})
+ LINK_DIRECTORIES(${GTK2_LIBRARY_DIRS})
+ LINK_LIBRARIES(${GTK2_LIBRARIES})
+ # WX
+ INCLUDE( ${wxWidgets_USE_FILE} )
+ MARK_AS_ADVANCED(wxWidgets_CONFIG_EXECUTABLE)
+ SET(BBTK_WXWIDGETS_LIBRARIES
+ ${GTK2_LIBRARIES}
+ ${wxWidgets_LIBRARIES}
+ )
+ ENDIF(WIN32)
+ENDMACRO(BBTK_USE_WXWIDGETS)
+#=======================================================================
--- /dev/null
+#-----------------------------------------------------------------------------
+# Macro CREATE_FIND_PACKAGE
+# Creates and install the cmake files which allow
+# to find a library by the cmake command FIND_PACKAGE.
+#
+# Inputs :
+# --------
+# LIBRARY_NAME : name of the library to find
+#
+# The following variables **MUST** have been set previously :
+#
+# * ${LIBRARY_NAME}_BUILD_TREE_RELATIVE_INCLUDE_PATHS
+# The list of include paths
+# when someone uses a *BUILD TREE* version of ${LIBRARY_NAME}.
+# NB :
+# THE PATHS *MUST BE RELATIVE* TO THE ROOT DIR OF THE PROJECT **SOURCES** !
+# Assume your project architecture is :
+# install/ : directory in which CREATE_FIND_PACKAGE is invoked
+# src/part1/include/ : first include dir
+# src/part2/include/ : second include dir
+# Then you should set the var with :
+# SET(${LIBRARY_NAME}_BUILD_TREE_RELATIVE_INCLUDE_PATHS
+# src/part1/include
+# src/part2/include )
+# Which will result in actual include paths :
+# ${PROJECT_SOURCE_DIR}/src/part1/include;
+# ${PROJECT_SOURCE_DIR}/src/part2/include
+# * ${LIBRARY_NAME}_BUILD_TREE_RELATIVE_LIBRARY_PATHS
+# Like the previous var but for the library paths.
+# NB :
+# THE PATHS *MUST BE RELATIVE* TO THE ROOT DIR OF THE **BUILD TREE**
+# THAT IS POINT TO THE FOLDERS WHERE THE LIBS WILL BE BUILD
+# Assume that your project architecture is :
+# src/part1/src/ : first source dir, in which the lib 'part1' is built
+# src/part2/src/ : first source dir, in which the lib 'part2' is built
+# Then you should set the var with
+# SET(${LIBRARY_NAME}_BUILD_TREE_RELATIVE_LIBRARY_PATHS
+# src/part1/src
+# src/part2/src
+# )
+# Which will result in actual library paths :
+# ${PROJECT_BINARY_DIR}/src/part1/src
+# ${PROJECT_BINARY_DIR}/src/part2/src
+# * ${LIBRARY_NAME}_INSTALL_TREE_RELATIVE_INCLUDE_PATHS
+# The list of include paths
+# when someone uses an *INSTALLED* version of ${LIBRARY_NAME}
+# The paths *MUST BE RELATIVE* to INSTALL_PREFIX
+# # A typical example is "include/${LIBRARY_NAME}"
+# * ${LIBRARY_NAME}_INSTALL_TREE_RELATIVE_LIBRARY_PATHS
+# Like the previous var but for library paths.
+# A typical example is ".."
+# * ${LIBRARY_NAME}_LIBRARIES
+# The list of libraries to link against when using ${LIBRARY_NAME}
+#
+# The following variables can be set optionally :
+#
+# * ${LIBRARY_NAME}_REQUIRED_C_FLAGS
+# * ${LIBRARY_NAME}_REQUIRED_CXX_FLAGS
+# * ${LIBRARY_NAME}_REQUIRED_LINK_FLAGS
+# * ${LIBRARY_NAME}_MAJOR_VERSION
+# * ${LIBRARY_NAME}_MINOR_VERSION
+# * ${LIBRARY_NAME}_BUILD_VERSION
+# * ${LIBRARY_NAME}_INSTALL_FOLDER : if set then install the stuff
+# in INSTALL_PREFIX/lib/${LIBRARY_NAME}_INSTALL_FOLDER
+# instead of INSTALL_PREFIX/lib/${LIBRARY_NAME}
+#
+#
+# To provide a user defined
+# couple of Config/Use file (in addition to the standard one) use :
+# SET( ${LIBRARY_NAME}_HAS_ADDITIONAL_CONFIG_FILE TRUE )
+# and store the *ABSOLUTE* paths to the additional files in the vars :
+# ${LIBRARY_NAME}_ADDITIONAL_CONFIG_FILE
+# ${LIBRARY_NAME}_ADDITIONAL_USE_FILE
+# (e.g. ${CMAKE_CURRENT_SOURCE_DIR}/MyConfig.cmake)
+#
+# Outputs :
+# --------
+# At cmake run-time, the macro creates the following files
+# in the current dir of the build tree (where the macro is invoked) :
+# Use${LIBRARY_NAME}.cmake
+# ${LIBRARY_NAME}Config.cmake
+# ${LIBRARY_NAME}BuildSettings.cmake
+# And if the vars ${LIBRARY_NAME}_ADDITIONAL_CONFIG_FILE and
+# ${LIBRARY_NAME}_ADDITIONAL_USE_FILE are set, it also creates :
+# Additional${LIBRARY_NAME}Config.cmake
+# AdditionalUse${LIBRARY_NAME}.cmake
+#
+# At install-time, the same files are installed
+# in INSTALL_PREFIX/lib/${LIBRARY_NAME}
+# and the file :
+# Find${LIBRARY_NAME}.cmake
+# is installed in ${CMAKE_ROOT}/Modules/
+#
+#
+#-----------------------------------------------------------------------------
+
+MACRO(CMAKE_CREATE_FIND_PACKAGE LIBRARY_NAME)
+
+ #---------------------------------------------------------------------------
+ # Sets the common values to build tree and install tree configs
+ SET(CFP_LIB_REQUIRED_C_FLAGS ${${LIBRARY_NAME}_REQUIRED_C_FLAGS})
+ SET(CFP_LIB_REQUIRED_CXX_FLAGS ${${LIBRARY_NAME}_REQUIRED_CXX_FLAGS})
+ SET(CFP_LIB_REQUIRED_LINK_FLAGS ${${LIBRARY_NAME}_REQUIRED_LINK_FLAGS})
+ SET(CFP_LIB_MAJOR_VERSION ${${LIBRARY_NAME}_MAJOR_VERSION})
+ SET(CFP_LIB_MINOR_VERSION ${${LIBRARY_NAME}_MINOR_VERSION})
+ SET(CFP_LIB_BUILD_VERSION ${${LIBRARY_NAME}_BUILD_VERSION})
+ SET(CFP_LIB_VERSION
+ ${CFP_LIB_MAJOR_VERSION}.${CFP_LIB_MINOR_VERSION}.${CFP_LIB_BUILD_VERSION})
+ SET(CFP_LIB_LIBRARIES ${${LIBRARY_NAME}_LIBRARIES})
+ IF (${LIBRARY_NAME}_HAS_ADDITIONAL_CONFIG_FILE)
+ SET(CFP_LIB_HAS_ADDITIONAL_CONFIG_FILE TRUE)
+ ELSE (${LIBRARY_NAME}_HAS_ADDITIONAL_CONFIG_FILE)
+ SET(CFP_LIB_HAS_ADDITIONAL_CONFIG_FILE FALSE)
+ ENDIF (${LIBRARY_NAME}_HAS_ADDITIONAL_CONFIG_FILE)
+ #---------------------------------------------------------------------------
+
+
+ #---------------------------------------------------------------------------
+ #-- BUILD TREE configuration
+ SET(CFP_BUILD_TREE_CONFIGURATION TRUE)
+ # UseLIBRARY_NAME.cmake
+ CONFIGURE_FILE(
+ ${CMakeCreateFindPackage_DIR}/CMakeCreateFindPackage_UseLibrary.cmake.in
+ ${PROJECT_BINARY_DIR}/Use${LIBRARY_NAME}.cmake
+ @ONLY IMMEDIATE
+ )
+ # LIBRARY_NAMEConfig.cmake
+ SET(CFP_LIB_RELATIVE_INCLUDE_PATHS
+ ${${LIBRARY_NAME}_BUILD_TREE_RELATIVE_INCLUDE_PATHS})
+ SET(CFP_LIB_RELATIVE_LIBRARY_PATHS
+ ${${LIBRARY_NAME}_BUILD_TREE_RELATIVE_LIBRARY_PATHS})
+ CONFIGURE_FILE(
+ ${CMakeCreateFindPackage_DIR}/CMakeCreateFindPackage_LibraryConfig.cmake.in
+ ${PROJECT_BINARY_DIR}/${LIBRARY_NAME}Config.cmake
+ @ONLY IMMEDIATE
+ )
+ # LIBRARY_NAMEBuildSettings.cmake :
+ # Save the compiler settings so another project can import them.
+ INCLUDE(${CMAKE_ROOT}/Modules/CMakeExportBuildSettings.cmake)
+ CMAKE_EXPORT_BUILD_SETTINGS(${PROJECT_BINARY_DIR}/${LIBRARY_NAME}BuildSettings.cmake)
+ # Additional Config and Use files
+ IF(CFP_LIB_HAS_ADDITIONAL_CONFIG_FILE)
+ CONFIGURE_FILE(
+ ${${LIBRARY_NAME}_ADDITIONAL_CONFIG_FILE}
+ ${PROJECT_BINARY_DIR}/Additional${LIBRARY_NAME}Config.cmake
+ @ONLY IMMEDIATE
+ )
+ CONFIGURE_FILE(
+ ${${LIBRARY_NAME}_ADDITIONAL_USE_FILE}
+ ${PROJECT_BINARY_DIR}/AdditionalUse${LIBRARY_NAME}.cmake
+ @ONLY IMMEDIATE
+ )
+ ENDIF(CFP_LIB_HAS_ADDITIONAL_CONFIG_FILE)
+ #---------------------------------------------------------------------------
+
+
+ #---------------------------------------------------------------------------
+ #-- INSTALL TREE configuration
+ SET(CFP_BUILD_TREE_CONFIGURATION FALSE)
+ # Create work directory to put the configured files because
+ # if the user invoked the macro at the root of the build tree the files
+ # would overwrite those configured for the build tree
+ SET(CFP_WORK_DIR ${CMAKE_CURRENT_BINARY_DIR}/CMakeCreateFindPackage_stuff)
+ IF(NOT IS_DIRECTORY ${CFP_WORK_DIR})
+ FILE(MAKE_DIRECTORY ${CFP_WORK_DIR})
+ ENDIF(NOT IS_DIRECTORY ${CFP_WORK_DIR})
+
+ #----------------------------------------------------------------------------
+ #INSTALLATION PATH
+ IF(WIN32)
+ SET(INSTALL_PATH .)
+ ELSE(WIN32)
+ IF(${LIBRARY_NAME}_INSTALL_FOLDER)
+ SET(INSTALL_PATH lib/${${LIBRARY_NAME}_INSTALL_FOLDER})
+ ELSE(${LIBRARY_NAME}_INSTALL_FOLDER)
+ SET(INSTALL_PATH lib/${LIBRARY_NAME})
+ ENDIF(${LIBRARY_NAME}_INSTALL_FOLDER)
+ ENDIF(WIN32)
+
+
+ # UseLIBRARY_NAME.cmake
+ CONFIGURE_FILE(
+ ${CMakeCreateFindPackage_DIR}/CMakeCreateFindPackage_UseLibrary.cmake.in
+ ${CFP_WORK_DIR}/Use${LIBRARY_NAME}.cmake
+ @ONLY IMMEDIATE
+ )
+ INSTALL(
+ FILES
+ ${CFP_WORK_DIR}/Use${LIBRARY_NAME}.cmake
+ DESTINATION ${INSTALL_PATH}
+ )
+ # LIBRARY_NAMEConfig.cmake
+ SET(CFP_LIB_RELATIVE_INCLUDE_PATHS
+ ${${LIBRARY_NAME}_INSTALL_TREE_RELATIVE_INCLUDE_PATHS})
+ SET(CFP_LIB_RELATIVE_LIBRARY_PATHS
+ ${${LIBRARY_NAME}_INSTALL_TREE_RELATIVE_LIBRARY_PATHS})
+ CONFIGURE_FILE(
+ ${CMakeCreateFindPackage_DIR}/CMakeCreateFindPackage_LibraryConfig.cmake.in
+ ${CFP_WORK_DIR}/${LIBRARY_NAME}Config.cmake
+ @ONLY IMMEDIATE
+ )
+ INSTALL(
+ FILES
+ ${CFP_WORK_DIR}/${LIBRARY_NAME}Config.cmake
+ DESTINATION ${INSTALL_PATH}
+ )
+ # LIBRARY_NAMEBuildSettings.cmake :
+ CMAKE_EXPORT_BUILD_SETTINGS(${CFP_WORK_DIR}/${LIBRARY_NAME}BuildSettings.cmake)
+ INSTALL(
+ FILES
+ ${CFP_WORK_DIR}/${LIBRARY_NAME}BuildSettings.cmake
+ DESTINATION ${INSTALL_PATH}
+ )
+ # Additional Config and Use files
+ IF(CFP_LIB_HAS_ADDITIONAL_CONFIG_FILE)
+ CONFIGURE_FILE(
+ ${${LIBRARY_NAME}_ADDITIONAL_CONFIG_FILE}
+ ${CFP_WORK_DIR}/Additional${LIBRARY_NAME}Config.cmake
+ @ONLY IMMEDIATE
+ )
+ INSTALL(
+ FILES
+ ${CFP_WORK_DIR}/Additional${LIBRARY_NAME}Config.cmake
+ DESTINATION ${INSTALL_PATH}
+ )
+ CONFIGURE_FILE(
+ ${${LIBRARY_NAME}_ADDITIONAL_USE_FILE}
+ ${CFP_WORK_DIR}/AdditionalUse${LIBRARY_NAME}.cmake
+ @ONLY IMMEDIATE
+ )
+ INSTALL(
+ FILES
+ ${CFP_WORK_DIR}/AdditionalUse${LIBRARY_NAME}.cmake
+ DESTINATION ${INSTALL_PATH}
+ )
+ ENDIF(CFP_LIB_HAS_ADDITIONAL_CONFIG_FILE)
+ # Specific to install tree
+ # FindLIBRARY_NAME.cmake in CMake/Modules dir
+ CONFIGURE_FILE(
+ ${CMakeCreateFindPackage_DIR}/CMakeCreateFindPackage_FindLibrary.cmake.in
+ ${CFP_WORK_DIR}/Find${LIBRARY_NAME}.cmake
+ @ONLY IMMEDIATE
+ )
+ INSTALL(
+ FILES ${CFP_WORK_DIR}/Find${LIBRARY_NAME}.cmake
+ DESTINATION ${CMAKE_ROOT}/Modules
+ )
+ #---------------------------------------------------------------------------
+
+
+
+
+ENDMACRO(CMAKE_CREATE_FIND_PACKAGE)
+#-----------------------------------------------------------------------------
--- /dev/null
+# - Find a library installation or build tree.
+#
+# The following variables are set if @LIBRARY_NAME@ is found.
+# If @LIBRARY_NAME@ is not found, @LIBRARY_NAME@_FOUND is set to false.
+# @LIBRARY_NAME@_FOUND - Set to true when @LIBRARY_NAME@ is found.
+# @LIBRARY_NAME@_USE_FILE - CMake file to use @LIBRARY_NAME@.
+# @LIBRARY_NAME@_MAJOR_VERSION - The @LIBRARY_NAME@ major version number.
+# @LIBRARY_NAME@_MINOR_VERSION - The @LIBRARY_NAME@ minor version number
+# (odd non-release).
+# @LIBRARY_NAME@_BUILD_VERSION - The @LIBRARY_NAME@ patch level
+# (meaningless for odd minor).
+# @LIBRARY_NAME@_INCLUDE_DIRS - Include directories for @LIBRARY_NAME@
+# @LIBRARY_NAME@_LIBRARY_DIRS - Link directories for @LIBRARY_NAME@ libraries
+# @LIBRARY_NAME@_LIBRARIES - List of libraries to link against
+#
+# The following cache entries must be set by the user to locate @LIBRARY_NAME@:
+# @LIBRARY_NAME@_DIR - The directory containing @LIBRARY_NAME@Config.cmake.
+# This is either the root of the build tree,
+# or the lib/@LIBRARY_NAME@ directory. This is the
+# only cache entry.
+
+
+# Construct consitent error messages for use below.
+SET(@LIBRARY_NAME@_DIR_DESCRIPTION "directory containing @LIBRARY_NAME@Config.cmake. This is either the root of the build tree, or PREFIX/lib/@LIBRARY_NAME@ for an installation.")
+SET(@LIBRARY_NAME@_NOT_FOUND_MESSAGE "@LIBRARY_NAME@ not found. Set the @LIBRARY_NAME@_DIR cmake cache entry to the ${@LIBRARY_NAME@_DIR_DESCRIPTION}")
+
+# Search only if the location is not already known.
+IF(NOT @LIBRARY_NAME@_DIR)
+ # Get the system search path as a list.
+ IF(UNIX)
+ STRING(REGEX MATCHALL "[^:]+" @LIBRARY_NAME@_DIR_SEARCH1 "$ENV{PATH}")
+ ELSE(UNIX)
+ STRING(REGEX REPLACE "\\\\" "/" @LIBRARY_NAME@_DIR_SEARCH1 "$ENV{PATH}")
+ ENDIF(UNIX)
+ STRING(REGEX REPLACE "/;" ";" @LIBRARY_NAME@_DIR_SEARCH2 "${@LIBRARY_NAME@_DIR_SEARCH1}")
+
+ # Construct a set of paths relative to the system search path.
+ SET(@LIBRARY_NAME@_DIR_SEARCH "")
+ FOREACH(dir ${@LIBRARY_NAME@_DIR_SEARCH2})
+ SET(@LIBRARY_NAME@_DIR_SEARCH ${@LIBRARY_NAME@_DIR_SEARCH}
+ ${dir}/../lib/@INSTALL_PATH@
+ )
+ ENDFOREACH(dir)
+
+ #
+ # Look for an installation or build tree.
+ #
+ FIND_PATH(@LIBRARY_NAME@_DIR Use@LIBRARY_NAME@.cmake
+ # Look for an environment variable @LIBRARY_NAME@_DIR.
+ $ENV{@LIBRARY_NAME@_DIR}
+
+ # Look in places relative to the system executable search path.
+ ${@LIBRARY_NAME@_DIR_SEARCH}
+
+ # Look in standard WIN install locations.
+ "$ENV{ProgramFiles}/@LIBRARY_NAME@"
+
+ # Look in standard UNIX install locations.
+ /usr/local/@INSTALL_PATH@
+ /usr/@INSTALL_PATH@
+
+ # Read from the CMakeSetup registry entries. It is likely that
+ # @LIBRARY_NAME@ will have been recently built.
+ [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild1]
+ [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild2]
+ [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild3]
+ [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild4]
+ [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild5]
+ [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild6]
+ [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild7]
+ [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild8]
+ [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild9]
+ [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild10]
+
+ # Help the user find it if we cannot.
+ DOC "The ${@LIBRARY_NAME@_DIR_DESCRIPTION}"
+ )
+ENDIF(NOT @LIBRARY_NAME@_DIR)
+
+# If @LIBRARY_NAME@ was found, load the configuration file to get the rest of the
+# settings.
+IF(@LIBRARY_NAME@_DIR)
+ # Make sure the @LIBRARY_NAME@Config.cmake file exists in the directory provided.
+ IF(EXISTS ${@LIBRARY_NAME@_DIR}/@LIBRARY_NAME@Config.cmake)
+
+ # We found @LIBRARY_NAME@. Load the settings.
+ SET(@LIBRARY_NAME@_FOUND 1)
+ INCLUDE(${@LIBRARY_NAME@_DIR}/@LIBRARY_NAME@Config.cmake)
+
+ ENDIF(EXISTS ${@LIBRARY_NAME@_DIR}/@LIBRARY_NAME@Config.cmake)
+ELSE(@LIBRARY_NAME@_DIR)
+ # We did not find @LIBRARY_NAME@.
+ SET(@LIBRARY_NAME@_FOUND 0)
+ENDIF(@LIBRARY_NAME@_DIR)
+
+#-----------------------------------------------------------------------------
+IF(NOT @LIBRARY_NAME@_FOUND)
+ # @LIBRARY_NAME@ not found, explain to the user how to specify its location.
+ IF(NOT @LIBRARY_NAME@_FIND_QUIETLY)
+ MESSAGE(FATAL_ERROR ${@LIBRARY_NAME@_NOT_FOUND_MESSAGE})
+ ELSE(NOT @LIBRARY_NAME@_FIND_QUIETLY)
+ IF(@LIBRARY_NAME@_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR ${@LIBRARY_NAME@_NOT_FOUND_MESSAGE})
+ ENDIF(@LIBRARY_NAME@_FIND_REQUIRED)
+ ENDIF(NOT @LIBRARY_NAME@_FIND_QUIETLY)
+ENDIF(NOT @LIBRARY_NAME@_FOUND)
--- /dev/null
+#-----------------------------------------------------------------------------
+#
+# @LIBRARY_NAME@Config.cmake - CMake configuration file for external projects.
+# Created by the cmake macro CREATE_FIND_PACKAGE of the CreateFindPackage suite
+#
+# This file is configured by cmake and used by the
+# Use@LIBRARY_NAME@.cmake module to load the lib settings
+# for an external project.
+
+# Build tree config ?
+SET(CFP_BUILD_TREE_CONFIGURATION @CFP_BUILD_TREE_CONFIGURATION@)
+
+
+IF(UNIX)
+SET(GOTO_INSTALL_PREFIX /../..)
+ENDIF(UNIX)
+
+
+# The @LIBRARY_NAME@ include file *RELATIVE* directories.
+SET(CFP_RELATIVE_INCLUDE_PATHS "@CFP_LIB_RELATIVE_INCLUDE_PATHS@")
+# Compute the prefix for include and library paths
+IF(CFP_BUILD_TREE_CONFIGURATION)
+ # In build tree
+ # the include paths are relative to the source tree *AND* the binary tree
+ # for generated files
+ SET(CFP_INCLUDE_PATH_PREFIX @PROJECT_SOURCE_DIR@)
+ # Build the *ABSOLUTE* directories
+ FOREACH(path ${CFP_RELATIVE_INCLUDE_PATHS})
+ SET(@LIBRARY_NAME@_INCLUDE_DIRS
+ ${@LIBRARY_NAME@_INCLUDE_DIRS}
+ ${CFP_INCLUDE_PATH_PREFIX}/${path}
+ )
+ ENDFOREACH(path ${CFP_RELATIVE_INCLUDE_PATHS})
+ SET(CFP_INCLUDE_PATH_PREFIX @PROJECT_BINARY_DIR@)
+ # Build the *ABSOLUTE* directories
+ FOREACH(path ${CFP_RELATIVE_INCLUDE_PATHS})
+ SET(@LIBRARY_NAME@_INCLUDE_DIRS
+ ${@LIBRARY_NAME@_INCLUDE_DIRS}
+ ${CFP_INCLUDE_PATH_PREFIX}/${path}
+ )
+ ENDFOREACH(path ${CFP_RELATIVE_INCLUDE_PATHS})
+ELSE(CFP_BUILD_TREE_CONFIGURATION)
+ # In install tree
+ # the include paths are relative to install prefix
+ # On unix , GOTO_INSTALL_PREFIX allows to get back to the
+ # installation prefix from @LIBRARY_NAME@_DIR
+ SET(CFP_INCLUDE_PATH_PREFIX ${@LIBRARY_NAME@_DIR}${GOTO_INSTALL_PREFIX})
+ # Build the *ABSOLUTE* directories
+ FOREACH(path ${CFP_RELATIVE_INCLUDE_PATHS})
+ SET(@LIBRARY_NAME@_INCLUDE_DIRS
+ ${@LIBRARY_NAME@_INCLUDE_DIRS}
+ ${CFP_INCLUDE_PATH_PREFIX}/${path}
+ )
+ ENDFOREACH(path ${CFP_RELATIVE_INCLUDE_PATHS})
+ENDIF(CFP_BUILD_TREE_CONFIGURATION)
+
+
+
+# Compute the prefix for library paths
+IF(CFP_BUILD_TREE_CONFIGURATION)
+ # In build tree
+ # the library paths are relative to the binary tree
+ SET(CFP_LIBRARY_PATH_PREFIX @PROJECT_BINARY_DIR@)
+ELSE(CFP_BUILD_TREE_CONFIGURATION)
+ # In install tree
+ # the library paths are relative to install prefix
+ SET(CFP_LIBRARY_PATH_PREFIX ${@LIBRARY_NAME@_DIR}${GOTO_INSTALL_PREFIX})
+ENDIF(CFP_BUILD_TREE_CONFIGURATION)
+# The @LIBRARY_NAME@ library file *RELATIVE* directories.
+SET(CFP_RELATIVE_LIBRARY_PATHS "@CFP_LIB_RELATIVE_LIBRARY_PATHS@")
+# Build the *ABSOLUTE* directories
+FOREACH(path ${CFP_RELATIVE_LIBRARY_PATHS})
+ SET(@LIBRARY_NAME@_LIBRARY_DIRS
+ ${@LIBRARY_NAME@_LIBRARY_DIRS}
+ ${CFP_LIBRARY_PATH_PREFIX}/${path}
+ )
+ENDFOREACH(path ${CFP_RELATIVE_LIBRARY_PATHS})
+
+
+# The C and C++ flags added by @LIBRARY_NAME@ to the cmake-configured flags.
+SET(@LIBRARY_NAME@_REQUIRED_C_FLAGS "@CFP_LIB_REQUIRED_C_FLAGS@")
+SET(@LIBRARY_NAME@_REQUIRED_CXX_FLAGS "@CFP_LIB_REQUIRED_CXX_FLAGS@")
+SET(@LIBRARY_NAME@_REQUIRED_LINK_FLAGS "@CFP_LIB_REQUIRED_LINK_FLAGS@")
+
+# The @LIBRARY_NAME@ version
+SET(@LIBRARY_NAME@_MAJOR_VERSION @CFP_LIB_MAJOR_VERSION@)
+SET(@LIBRARY_NAME@_MINOR_VERSION @CFP_LIB_MINOR_VERSION@)
+SET(@LIBRARY_NAME@_BUILD_VERSION @CFP_LIB_BUILD_VERSION@)
+SET(@LIBRARY_NAME@_VERSION @CFP_LIB_VERSION@)
+
+# The location of the Use@LIBRARY_NAME@.cmake file.
+SET(@LIBRARY_NAME@_USE_FILE "${@LIBRARY_NAME@_DIR}/Use@LIBRARY_NAME@.cmake")
+
+# The build settings file.
+SET(@LIBRARY_NAME@_BUILD_SETTINGS_FILE
+ "${@LIBRARY_NAME@_DIR}/@LIBRARY_NAME@BuildSettings.cmake")
+
+# A list of all libraries for @LIBRARY_NAME@. Those listed here should
+# automatically pull in their dependencies.
+SET(@LIBRARY_NAME@_LIBRARIES @CFP_LIB_LIBRARIES@)
+
+# Messages
+IF(FIND_PACKAGE_VERBOSE)
+ MESSAGE(STATUS "Looking for @LIBRARY_NAME@... found - configuration :")
+ MESSAGE(STATUS "* @LIBRARY_NAME@_DIR = ${@LIBRARY_NAME@_DIR}")
+ MESSAGE(STATUS "* @LIBRARY_NAME@_VERSION = ${@LIBRARY_NAME@_VERSION}")
+ MESSAGE(STATUS "* @LIBRARY_NAME@_USE_FILE = ${@LIBRARY_NAME@_USE_FILE}")
+
+ MESSAGE(STATUS "* @LIBRARY_NAME@_INCLUDE_DIRS = ${@LIBRARY_NAME@_INCLUDE_DIRS}")
+ MESSAGE(STATUS "* @LIBRARY_NAME@_LIBRARY_DIRS = ${@LIBRARY_NAME@_LIBRARY_DIRS}")
+ MESSAGE(STATUS "* @LIBRARY_NAME@_LIBRARIES = ${@LIBRARY_NAME@_LIBRARIES}")
+ENDIF(FIND_PACKAGE_VERBOSE)
+
+# Does the library has an additional config file (user provided) ?
+SET(@LIBRARY_NAME@_HAS_ADDITIONAL_CONFIG_FILE @CFP_LIB_HAS_ADDITIONAL_CONFIG_FILE@)
+
+IF (@LIBRARY_NAME@_HAS_ADDITIONAL_CONFIG_FILE)
+ IF(FIND_PACKAGE_VERBOSE)
+ MESSAGE(STATUS "Reading @LIBRARY_NAME@ additional configuration file")
+ ENDIF(FIND_PACKAGE_VERBOSE)
+ # Include it
+ INCLUDE(${@LIBRARY_NAME@_DIR}/Additional@LIBRARY_NAME@Config.cmake)
+ENDIF (@LIBRARY_NAME@_HAS_ADDITIONAL_CONFIG_FILE)
--- /dev/null
+# This is an implementation detail for using @LIBRARY_NAME@ with the
+# Find@LIBRARY_NAME@.cmake module. Do not include directly by name.
+# This should be included only when Find@LIBRARY_NAME@.cmake sets
+# the @LIBRARY_NAME@_USE_FILE variable to point here.
+
+IF(FIND_PACKAGE_VERBOSE)
+ MESSAGE(STATUS "Using @LIBRARY_NAME@")
+ENDIF(FIND_PACKAGE_VERBOSE)
+
+# Load the compiler settings used for @LIBRARY_NAME@.
+IF(@LIBRARY_NAME@_BUILD_SETTINGS_FILE)
+ INCLUDE(CMakeImportBuildSettings)
+ CMAKE_IMPORT_BUILD_SETTINGS(${@LIBRARY_NAME@_BUILD_SETTINGS_FILE})
+ENDIF(@LIBRARY_NAME@_BUILD_SETTINGS_FILE)
+
+# Add compiler flags needed to use @LIBRARY_NAME@.
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${@LIBRARY_NAME@_REQUIRED_C_FLAGS}")
+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${@LIBRARY_NAME@_REQUIRED_CXX_FLAGS}")
+SET(CMAKE_LINK_FLAGS "${CMAKE_LINK_FLAGS} ${@LIBRARY_NAME@_REQUIRED_LINK_FLAGS}")
+
+# Add include directories needed to use @LIBRARY_NAME@.
+INCLUDE_DIRECTORIES(${@LIBRARY_NAME@_INCLUDE_DIRS})
+
+# Add link directories needed to use @LIBRARY_NAME@.
+LINK_DIRECTORIES(${@LIBRARY_NAME@_LIBRARY_DIRS})
+
+# Set the version
+ADD_DEFINITIONS( -D@LIBRARY_NAME@_VERSION="${@LIBRARY_NAME@_VERSION}" )
+
+# Additional use file
+IF (@LIBRARY_NAME@_HAS_ADDITIONAL_CONFIG_FILE)
+ # Include it
+ INCLUDE(${@LIBRARY_NAME@_DIR}/AdditionalUse@LIBRARY_NAME@.cmake)
+ENDIF (@LIBRARY_NAME@_HAS_ADDITIONAL_CONFIG_FILE)
${PROJECT_SOURCE_DIR}/kernel/appli
)
-INCLUDE(${BBTK_DIR}/BBTKBuildDoxygenDoc.cmake)
+INCLUDE(${BBTK_CMAKE_DIR}/BBTKBuildDoxygenDoc.cmake)
BBTK_BUILD_DOXYGEN_DOC(
"BBTK"
"${INPUT}"
-#-----------------------------------------------------------------------------
+
+#=============================================================================
# bbtk library installation
-#-----------------------------------------------------------------------------
+#=============================================================================
+
#-----------------------------------------------------------------------------
-INSTALL_FILES(/include/bbtk "\\.h$")
-INSTALL_TARGETS(/lib bbtk)
+FILE(GLOB BBTK_HEADERS "*.h")
+INSTALL(FILES ${BBTK_HEADERS} DESTINATION include/bbtk)
+INSTALL(TARGETS bbtk DESTINATION lib)
#-----------------------------------------------------------------------------
+#-----------------------------------------------------------------------------
+# Code installing the files needed to find the lib by FIND_PACKAGE
+# Uses CMakeCreateFindPackage
+#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
-# TO DO : create FindBBTK.cmake
-#INCLUDE(InstallFindBBTK.cmake)
+# Today CMakeCreateFindPackage is copied in kernel/cmake
+# When installed as a separate project will have to find it with FIND_PACKAGE
+SET(CMakeCreateFindPackage_DIR ${PROJECT_SOURCE_DIR}/kernel/cmake)
#-----------------------------------------------------------------------------
+#-----------------------------------------------------------------------------
+# - Set the variable LIBRARY_NAME to the name of your library
+SET(LIBRARY_NAME BBTK)
+SET(${LIBRARY_NAME}_INSTALL_FOLDER bbtk)
+SET(${LIBRARY_NAME}_LIBRARIES bbtk)
+SET(${LIBRARY_NAME}_BUILD_TREE_RELATIVE_INCLUDE_PATHS kernel/src)
+IF(UNIX)
+ SET(${LIBRARY_NAME}_BUILD_TREE_RELATIVE_LIBRARY_PATHS
+ ${EXECUTABLE_OUTPUT_REL_PATH})
+ELSE(UNIX)
+ SET(${LIBRARY_NAME}_BUILD_TREE_RELATIVE_LIBRARY_PATHS
+ ${EXECUTABLE_OUTPUT_REL_PATH}/Debug
+ ${EXECUTABLE_OUTPUT_REL_PATH}/Release)
+ENDIF(UNIX)
+SET(${LIBRARY_NAME}_INSTALL_TREE_RELATIVE_INCLUDE_PATHS include/bbtk)
+SET(${LIBRARY_NAME}_INSTALL_TREE_RELATIVE_LIBRARY_PATHS lib)
+
+# OPTIONAL
+# - Set the version of your library
+# SET YOUR LIB VERSION
+#SET(${LIBRARY_NAME}_MAJOR_VERSION 1)
+#SET(${LIBRARY_NAME}_MINOR_VERSION 0)
+#SET(${LIBRARY_NAME}_BUILD_VERSION 0)
+# REQUIRED BUILD FLAGS
+#SET(${LIBRARY_NAME}_REQUIRED_C_FLAGS "")
+#SET(${LIBRARY_NAME}_REQUIRED_CXX_FLAGS "")
+#SET(${LIBRARY_NAME}_REQUIRED_LINK_FLAGS "")
+# ADDITIONAL CONFIG FILE
+# HERE WE USE ONE TO EXPORT testLib_EXPORTED_VALUE
+#
+SET(${LIBRARY_NAME}_HAS_ADDITIONAL_CONFIG_FILE TRUE)
+SET(${LIBRARY_NAME}_ADDITIONAL_CONFIG_FILE
+ ${PROJECT_SOURCE_DIR}/kernel/cmake/AdditionalBBTKConfig.cmake.in)
+SET(${LIBRARY_NAME}_ADDITIONAL_USE_FILE
+ ${PROJECT_SOURCE_DIR}/kernel/cmake/AdditionalUseBBTK.cmake.in)
+#-----------------------------------------------------------------------------
+
+#-----------------------------------------------------------------------------
+# Includes CMakeCreateFindPackage
+INCLUDE(${CMakeCreateFindPackage_DIR}/CMakeCreateFindPackage.cmake)
+CMAKE_CREATE_FIND_PACKAGE(${LIBRARY_NAME})
+#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# EO bbtk library installation
#===========================================================================
# Include package configuration cmake script from bbtk dir
-INCLUDE(${BBTK_DIR}/BBTKConfigurePackage.cmake)
+INCLUDE(${BBTK_CMAKE_DIR}/BBTKConfigurePackage.cmake)
#===========================================================================
-INCLUDE(${BBTK_DIR}/BBTKConfigurePackage_bbs.cmake)
+INCLUDE(${BBTK_CMAKE_DIR}/BBTKConfigurePackage_bbs.cmake)
#===========================================================================
# Include package doc configuration cmake script
-INCLUDE(${BBTK_DIR}/BBTKConfigurePackage_doc.cmake)
+INCLUDE(${BBTK_CMAKE_DIR}/BBTKConfigurePackage_doc.cmake)
#===========================================================================
-INCLUDE(${BBTK_DIR}/BBTKCreatePackageBBdoc.cmake)
+INCLUDE(${BBTK_CMAKE_DIR}/BBTKCreatePackageBBdoc.cmake)
BBTK_CREATE_PACKAGE_BBDOC(${BBTK_PACKAGE_NAME})
)
-INCLUDE(${BBTK_DIR}/BBTKBuildDoxygenDoc.cmake)
+INCLUDE(${BBTK_CMAKE_DIR}/BBTKBuildDoxygenDoc.cmake)
BBTK_BUILD_DOXYGEN_DOC(
"${BBTK_PACKAGE_NAME}"
#---------------------------------------------------------------------------
# Include src configuration cmake script
-INCLUDE(${BBTK_DIR}/BBTKConfigurePackage_src.cmake)
+INCLUDE(${BBTK_CMAKE_DIR}/BBTKConfigurePackage_src.cmake)
#---------------------------------------------------------------------------
#===========================================================================
# Include package configuration cmake script from bbtk dir
-INCLUDE(${BBTK_DIR}/BBTKConfigurePackage.cmake)
+INCLUDE(${BBTK_CMAKE_DIR}/BBTKConfigurePackage.cmake)
#===========================================================================
-INCLUDE(${BBTK_DIR}/BBTKConfigurePackage_bbs.cmake)
+INCLUDE(${BBTK_CMAKE_DIR}/BBTKConfigurePackage_bbs.cmake)
#===========================================================================
# Include package doc configuration cmake script
-INCLUDE(${BBTK_DIR}/BBTKConfigurePackage_doc.cmake)
+INCLUDE(${BBTK_CMAKE_DIR}/BBTKConfigurePackage_doc.cmake)
#===========================================================================
-INCLUDE(${BBTK_DIR}/BBTKCreatePackageBBdoc.cmake)
+INCLUDE(${BBTK_CMAKE_DIR}/BBTKCreatePackageBBdoc.cmake)
BBTK_CREATE_PACKAGE_BBDOC(${BBTK_PACKAGE_NAME})
)
-INCLUDE(${BBTK_DIR}/BBTKBuildDoxygenDoc.cmake)
+INCLUDE(${BBTK_CMAKE_DIR}/BBTKBuildDoxygenDoc.cmake)
BBTK_BUILD_DOXYGEN_DOC(
"${BBTK_PACKAGE_NAME}"
#---------------------------------------------------------------------------
# Include src configuration cmake script
-INCLUDE(${BBTK_DIR}/BBTKConfigurePackage_src.cmake)
+INCLUDE(${BBTK_CMAKE_DIR}/BBTKConfigurePackage_src.cmake)
#---------------------------------------------------------------------------