-INCLUDE(${crea_CMAKE_DIR}/Macros.cmake)
-INCLUDE(${crea_CMAKE_DIR}/creaResolveOptions.cmake)
+INCLUDE(${CREA_CMAKE_DIR}/CREAMacros.cmake)
+INCLUDE(${CREA_CMAKE_DIR}/CREAResolveOptions.cmake)
#-----------------------------------------------------------------------------
-SET(crea_CMAKE_REL_PATH @crea_CMAKE_REL_PATH@)
-SET(crea_CMAKE_DIR ${crea_DIR}/${crea_CMAKE_REL_PATH})
+SET(CREA_CMAKE_REL_PATH @CREA_CMAKE_REL_PATH@)
+SET(CREA_CMAKE_DIR ${crea_DIR}/${CREA_CMAKE_REL_PATH})
#-----------------------------------------------------------------------------
-SET(crea_COMPILE_MESSAGES @crea_COMPILE_MESSAGES@)
-SET(crea_COMPILE_DEBUG_MESSAGES @crea_COMPILE_DEBUG_MESSAGES@)
-SET(crea_COMPILE_WARNING_MESSAGES @crea_COMPILE_WARNING_MESSAGES@)
-SET(crea_COMPILE_ERROR_MESSAGES @crea_COMPILE_ERROR_MESSAGES@)
+SET(CREA_COMPILE_MESSAGES @CREA_COMPILE_MESSAGES@)
+SET(CREA_COMPILE_DEBUG_MESSAGES @CREA_COMPILE_DEBUG_MESSAGES@)
+SET(CREA_COMPILE_WARNING_MESSAGES @CREA_COMPILE_WARNING_MESSAGES@)
+SET(CREA_COMPILE_ERROR_MESSAGES @CREA_COMPILE_ERROR_MESSAGES@)
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
-IF(crea_VERBOSE_FIND_LIBRARY)
-# MESSAGE(STATUS "* crea_BUILT_WITH_WX = ${crea_BUILT_WITH_WX}")
- MESSAGE(STATUS "* crea_CMAKE_DIR = ${crea_CMAKE_DIR}")
- MESSAGE(STATUS "* crea_COMPILE_MESSAGES = ${crea_COMPILE_MESSAGES}")
- MESSAGE(STATUS "* crea_COMPILE_WARNING_MESSAGES = ${crea_COMPILE_WARNING_MESSAGES}")
- MESSAGE(STATUS "* crea_COMPILE_ERROR_MESSAGES = ${crea_COMPILE_ERROR_MESSAGES}")
- MESSAGE(STATUS "* crea_COMPILE_DEBUG_MESSAGES = ${crea_COMPILE_DEBUG_MESSAGES}")
-ENDIF(crea_VERBOSE_FIND_LIBRARY)
+IF(CREA_VERBOSE_CMAKE)
+# MESSAGE(STATUS "* CREA_BUILT_WITH_WX = ${CREA_BUILT_WITH_WX}")
+ MESSAGE(STATUS "* CREA_CMAKE_DIR = ${CREA_CMAKE_DIR}")
+ MESSAGE(STATUS "* CREA_COMPILE_MESSAGES = ${CREA_COMPILE_MESSAGES}")
+ MESSAGE(STATUS "* CREA_COMPILE_WARNING_MESSAGES = ${CREA_COMPILE_WARNING_MESSAGES}")
+ MESSAGE(STATUS "* CREA_COMPILE_ERROR_MESSAGES = ${CREA_COMPILE_ERROR_MESSAGES}")
+ MESSAGE(STATUS "* CREA_COMPILE_DEBUG_MESSAGES = ${CREA_COMPILE_DEBUG_MESSAGES}")
+ENDIF(CREA_VERBOSE_CMAKE)
#-----------------------------------------------------------------------------
-# If bbtk was compiled with WxWidget then have to find it
-#IF(crea_BUILT_WITH_WX)
-# INCLUDE(${crea_CMAKE_DIR}/creaWxWidgets.cmake)
-# crea_FIND_WXWIDGETS()
-#ENDIF(crea_BUILT_WITH_WX)
+# If crea was compiled with WxWidget then have to find it
+#IF(CREA_BUILT_WITH_WX)
+# INCLUDE(${CREA_CMAKE_DIR}/CREAWxWidgets.cmake)
+# CREA_FIND_WXWIDGETS()
+#ENDIF(CREA_BUILT_WITH_WX)
-PROJECT(crea)
-
-SET(crea_CMAKE_REL_PATH cmake)
-SET(crea_CMAKE_DIR ${PROJECT_SOURCE_DIR}/${crea_CMAKE_REL_PATH})
-
-INCLUDE(${crea_CMAKE_DIR}/PreventInSourceBuild.cmake)
+PROJECT(CREA)
INCLUDE(Version.cmake)
-INCLUDE(${crea_CMAKE_DIR}/Macros.cmake)
+SET(CREA_CMAKE_REL_PATH cmake)
+SET(CREA_CMAKE_DIR ${PROJECT_SOURCE_DIR}/${CREA_CMAKE_REL_PATH})
+INCLUDE(${CREA_CMAKE_DIR}/CREAMacros.cmake)
+
+CREA_PREVENT_IN_SOURCE_BUILD()
SET(USE_VTK ON)
SET(USE_BOOST ON)
SET(USE_WXWIDGETS ON)
-INCLUDE(${crea_CMAKE_DIR}/FindAndUseLibraries.cmake)
+CREA_FIND_AND_USE_LIBRARIES()
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR})
SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR})
)
#-----------------------------------------------------------------------------
# messages compilation options
-OPTION ( crea_COMPILE_DEBUG_MESSAGES "Compile crea debug messages ?" OFF)
-OPTION ( crea_COMPILE_ERROR_MESSAGES "Compile crea error messages ?" ON)
-OPTION ( crea_COMPILE_MESSAGES "Compile crea messages ?" ON)
-OPTION ( crea_COMPILE_WARNING_MESSAGES "Compile crea warning messages ?" ON)
+OPTION ( CREA_COMPILE_DEBUG_MESSAGES "Compile CREA debug messages ?" OFF)
+OPTION ( CREA_COMPILE_ERROR_MESSAGES "Compile CREA error messages ?" ON)
+OPTION ( CREA_COMPILE_MESSAGES "Compile CREA messages ?" ON)
+OPTION ( CREA_COMPILE_WARNING_MESSAGES "Compile CREA warning messages ?" ON)
#-----------------------------------------------------------------------------
-INCLUDE(${crea_CMAKE_DIR}/creaResolveOptions.cmake)
+INCLUDE(${CREA_CMAKE_DIR}/CREAResolveOptions.cmake)
SUBDIRS(cmake)
SUBDIRS(src)
#-----------------------------------------------------------------------------
# Code installing the files needed to find the library
# with the cmake command FIND_PACKAGE
-# Uses crea_INSTALL_LIBRARY_FOR_CMAKE macro
+# Uses CREA_ADVANCED_INSTALL_LIBRARY macro
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
${PROJECT_SOURCE_DIR}/AdditionalUsecrea.cmake.in)
# Invoke the macro
-crea_INSTALL_LIBRARY_FOR_CMAKE(${LIBRARY_NAME})
+CREA_ADVANCED_INSTALL_LIBRARY(${LIBRARY_NAME})
#-----------------------------------------------------------------------------
-FILE(GLOB crea_CMAKE_FILES "*.cmake" "*.in")
-#MESSAGE(STATUS "cmake files = ${crea_CMAKE_FILES}")
-FOREACH(file ${crea_CMAKE_FILES})
+
+
+FILE(GLOB CREA_CMAKE_FILES "*.cmake" "*.in")
+#MESSAGE(STATUS "cmake files = ${CREA_CMAKE_FILES}")
+
+FOREACH(file ${CREA_CMAKE_FILES})
GET_FILENAME_COMPONENT(filename "${file}" NAME)
CONFIGURE_FILE(
${file}
${CMAKE_CURRENT_BINARY_DIR}/${filename}
COPYONLY
)
-ENDFOREACH(file ${crea_CMAKE_FILES})
+ENDFOREACH(file ${CREA_CMAKE_FILES})
IF(UNIX)
SET(PREFIX lib/crea/)
ENDIF(UNIX)
INSTALL(
- FILES ${crea_CMAKE_FILES}
- DESTINATION ${PREFIX}${crea_CMAKE_REL_PATH}
+ FILES ${CREA_CMAKE_FILES}
+ DESTINATION ${PREFIX}${CREA_CMAKE_REL_PATH}
)
# MACRO TO ADD A COMPILER DEFINITION WHICH ADDS ALSO THE DEF
# INTO DOXYGEN PREDEFINED VAR
# (OTHERWISE DOXYGEN WOULD NOT PARSE THE FILES BLOCKED)
-MACRO(crea_DEFINE DEF)
+MACRO(CREA_DEFINE DEF)
MESSAGE(STATUS "* Added definition -D${DEF}")
ADD_DEFINITIONS( -D${DEF} )
SET(DOXYGEN_DOC_PREDEFINED
""
FORCE)
MARK_AS_ADVANCED(DOXYGEN_DOC_PREDEFINED)
-ENDMACRO(crea_DEFINE)
+ENDMACRO(CREA_DEFINE)
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# MACRO TO ADD A COMPILER DEFINITION WITH VALUE WHICH ADDS ALSO THE DEF
# INTO DOXYGEN PREDEFINED VAR
# (OTHERWISE DOXYGEN WOULD NOT PARSE THE FILES BLOCKED)
-MACRO(crea_DEFINE_WITH_VAL DEF VAL)
+MACRO(CREA_DEFINE_WITH_VAL DEF VAL)
MESSAGE(STATUS "* Added definition -D${DEF}=\"${VAL}\"")
ADD_DEFINITIONS( -D${DEF}="${VAL}" )
SET(DOXYGEN_DOC_PREDEFINED
""
FORCE)
MARK_AS_ADVANCED(DOXYGEN_DOC_PREDEFINED)
-ENDMACRO(crea_DEFINE_WITH_VAL)
+ENDMACRO(CREA_DEFINE_WITH_VAL)
#-----------------------------------------------------------------------------
-
-#========================================================================
-# Creates a directory if it does not exist
-MACRO(crea_MKDIR DIR)
- IF(NOT IS_DIRECTORY ${DIR})
- MESSAGE(STATUS "* Creating directory '${DIR}'")
- FILE(MAKE_DIRECTORY ${DIR})
- ENDIF(NOT IS_DIRECTORY ${DIR})
-ENDMACRO(crea_MKDIR)
-#========================================================================
-
-
-#========================================================================
-INCLUDE( ${crea_CMAKE_DIR}/InstallLibraryForCMakeMacro.cmake )
-#========================================================================
-
+MACRO(CREA_FIND_AND_USE_LIBRARIES)
+
#-----------------------------------------------------------------------------
IF(USE_VTK)
# Search VTK
MESSAGE ( STATUS "* Dir = ${VTK_DIR}")
MESSAGE ( STATUS "* Version = ${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}.${VTK_BUILD_VERSION}")
INCLUDE(${VTK_USE_FILE})
- crea_DEFINE( USE_VTK )
+ CREA_DEFINE( USE_VTK )
SET(VTK_LIBRARIES
vtkImaging vtkGraphics vtkRendering vtkFiltering vtkCommon vtkWidgets
vtkVolumeRendering
MESSAGE ( STATUS "* Dir = ${ITK_DIR}")
MESSAGE ( STATUS "* Version = ${ITK_VERSION_MAJOR}.${ITK_VERSION_MINOR}.${ITK_VERSION_PATCH}")
INCLUDE(${ITK_USE_FILE})
- crea_DEFINE( USE_ITK )
+ CREA_DEFINE( USE_ITK )
SET(ITK_LIBRARIES
ITKCommon ITKIO ITKBasicFilters ITKAlgorithms
)
OPTION ( itk_IMAGE_TYPE_DOUBLE "itk : Compile double images" ON)
IF ( itk_IMAGE_DIM_2 )
- crea_DEFINE( BBTK_ITK_IMAGE_DIM_2 )
+ CREA_DEFINE( BBTK_ITK_IMAGE_DIM_2 )
ENDIF ( itk_IMAGE_DIM_2 )
IF ( itk_IMAGE_DIM_3 )
- crea_DEFINE( BBTK_ITK_IMAGE_DIM_3 )
+ CREA_DEFINE( BBTK_ITK_IMAGE_DIM_3 )
ENDIF ( itk_IMAGE_DIM_3 )
IF ( itk_IMAGE_DIM_4 )
- crea_DEFINE( BBTK_ITK_IMAGE_DIM_4 )
+ CREA_DEFINE( BBTK_ITK_IMAGE_DIM_4 )
ENDIF ( itk_IMAGE_DIM_4 )
IF ( itk_IMAGE_TYPE_CHAR )
- crea_DEFINE( BBTK_ITK_IMAGE_TYPE_int8_t )
+ CREA_DEFINE( BBTK_ITK_IMAGE_TYPE_int8_t )
ENDIF ( itk_IMAGE_TYPE_CHAR )
IF ( itk_IMAGE_TYPE_UCHAR )
- crea_DEFINE( BBTK_ITK_IMAGE_TYPE_uint8_t )
+ CREA_DEFINE( BBTK_ITK_IMAGE_TYPE_uint8_t )
ENDIF ( itk_IMAGE_TYPE_UCHAR )
IF ( itk_IMAGE_TYPE_SHORT )
- crea_DEFINE( BBTK_ITK_IMAGE_TYPE_int16_t )
+ CREA_DEFINE( BBTK_ITK_IMAGE_TYPE_int16_t )
ENDIF ( itk_IMAGE_TYPE_SHORT )
IF ( itk_IMAGE_TYPE_USHORT )
- crea_DEFINE( BBTK_ITK_IMAGE_TYPE_uint16_t )
+ CREA_DEFINE( BBTK_ITK_IMAGE_TYPE_uint16_t )
ENDIF ( itk_IMAGE_TYPE_USHORT )
IF ( itk_IMAGE_TYPE_INT )
- crea_DEFINE( BBTK_ITK_IMAGE_TYPE_int32_t )
+ CREA_DEFINE( BBTK_ITK_IMAGE_TYPE_int32_t )
ENDIF ( itk_IMAGE_TYPE_INT )
IF ( itk_IMAGE_TYPE_UINT )
- crea_DEFINE( BBTK_ITK_IMAGE_TYPE_uint32_t )
+ CREA_DEFINE( BBTK_ITK_IMAGE_TYPE_uint32_t )
ENDIF ( itk_IMAGE_TYPE_UINT )
IF ( itk_IMAGE_TYPE_FLOAT )
- crea_DEFINE( BBTK_ITK_IMAGE_TYPE_float )
+ CREA_DEFINE( BBTK_ITK_IMAGE_TYPE_float )
ENDIF ( itk_IMAGE_TYPE_FLOAT )
IF ( itk_IMAGE_TYPE_DOUBLE )
- crea_DEFINE( BBTK_ITK_IMAGE_TYPE_double )
+ CREA_DEFINE( BBTK_ITK_IMAGE_TYPE_double )
ENDIF ( itk_IMAGE_TYPE_DOUBLE )
ELSE(ITK_FOUND)
message(FATAL_ERROR "ITK_DIR not found")
# If gdcm found
IF(GDCM_FOUND)
INCLUDE(${GDCM_USE_FILE})
- crea_DEFINE( USE_GDCM )
+ CREA_DEFINE( USE_GDCM )
MESSAGE ( STATUS "Looking for GDCM... found")
MESSAGE ( STATUS "* Dir = ${GDCM_DIR}")
#-----------------------------------------------------------------------------
IF(USE_WXWIDGETS)
- INCLUDE(${crea_CMAKE_DIR}/wxWidgetsMacros.cmake)
- crea_FIND_WXWIDGETS()
- crea_USE_WXWIDGETS()
+ INCLUDE(${CREA_CMAKE_DIR}/CREAMacro_wxWidgets.cmake)
+ CREA_FIND_WXWIDGETS()
+ CREA_USE_WXWIDGETS()
ENDIF(USE_WXWIDGETS)
#-----------------------------------------------------------------------------
MESSAGE(STATUS "Looking for boost C++ library... - found in ${Boost_INCLUDE_DIR}")
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
LINK_DIRECTORIES( ${Boost_LIBRARY_DIRS} )
- crea_DEFINE( USE_BOOST )
+ CREA_DEFINE( USE_BOOST )
SET(BOOST_LIBRARIES
boost_signals
boost_filesystem
ENDIF(Boost_FOUND)
ENDIF(USE_BOOST)
#-----------------------------------------------------------------------------
+
+
+ENDMACRO(CREA_FIND_AND_USE_LIBRARIES)
#-----------------------------------------------------------------------------
-# Macro crea_INSTALL_LIBRARY_FOR_CMAKE
+# Macro CREA_ADVANCED_INSTALL_LIBRARY
# Creates and install the cmake files which allow
# to find a library by the cmake command FIND_PACKAGE.
#
#
#-----------------------------------------------------------------------------
-MACRO(crea_INSTALL_LIBRARY_FOR_CMAKE LIBRARY_NAME)
+MACRO(CREA_ADVANCED_INSTALL_LIBRARY LIBRARY_NAME)
#---------------------------------------------------------------------------
# Sets the common values to build tree and install tree configs
SET(CILC_BUILD_TREE_CONFIGURATION TRUE)
# UseLIBRARY_NAME.cmake
CONFIGURE_FILE(
- ${crea_CMAKE_DIR}/InstallLibraryForCMake_UseLibrary.cmake.in
+ ${CREA_CMAKE_DIR}/InstallLibraryForCMake_UseLibrary.cmake.in
${PROJECT_BINARY_DIR}/Use${LIBRARY_NAME}.cmake
@ONLY IMMEDIATE
)
SET(CILC_LIB_RELATIVE_LIBRARY_PATHS
${${LIBRARY_NAME}_BUILD_TREE_RELATIVE_LIBRARY_PATHS})
CONFIGURE_FILE(
- ${crea_CMAKE_DIR}/InstallLibraryForCMake_LibraryConfig.cmake.in
+ ${CREA_CMAKE_DIR}/InstallLibraryForCMake_LibraryConfig.cmake.in
${PROJECT_BINARY_DIR}/${LIBRARY_NAME}Config.cmake
@ONLY IMMEDIATE
)
#---------------------------------------------------------------------------
#-- INSTALL TREE configuration
SET(CILC_BUILD_TREE_CONFIGURATION FALSE)
- # Create work directory to put the configured files because
+ # 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(CILC_WORK_DIR ${CMAKE_CURRENT_BINARY_DIR}/InstallLibraryForCMake_tmp)
# UseLIBRARY_NAME.cmake
CONFIGURE_FILE(
- ${crea_CMAKE_DIR}/InstallLibraryForCMake_UseLibrary.cmake.in
+ ${CREA_CMAKE_DIR}/InstallLibraryForCMake_UseLibrary.cmake.in
${CILC_WORK_DIR}/Use${LIBRARY_NAME}.cmake
@ONLY IMMEDIATE
)
SET(CILC_LIB_RELATIVE_LIBRARY_PATHS
${${LIBRARY_NAME}_INSTALL_TREE_RELATIVE_LIBRARY_PATHS})
CONFIGURE_FILE(
- ${crea_CMAKE_DIR}/InstallLibraryForCMake_LibraryConfig.cmake.in
+ ${CREA_CMAKE_DIR}/InstallLibraryForCMake_LibraryConfig.cmake.in
${CILC_WORK_DIR}/${LIBRARY_NAME}Config.cmake
@ONLY IMMEDIATE
)
# Specific to install tree
# FindLIBRARY_NAME.cmake in CMake/Modules dir
CONFIGURE_FILE(
- ${crea_CMAKE_DIR}/InstallLibraryForCMake_FindLibrary.cmake.in
+ ${CREA_CMAKE_DIR}/InstallLibraryForCMake_FindLibrary.cmake.in
${CILC_WORK_DIR}/Find${LIBRARY_NAME}.cmake
@ONLY IMMEDIATE
)
-ENDMACRO(crea_INSTALL_LIBRARY_FOR_CMAKE)
+ENDMACRO(CREA_ADVANCED_INSTALL_LIBRARY)
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
-MACRO(crea_DEFAULT_INSTALL_LIBRARY_FOR_CMAKE LIBRARY_NAME)
+MACRO(CREA_INSTALL_LIBRARY LIBRARY_NAME)
+ # Sets the settings to default values
SET(${LIBRARY_NAME}_INSTALL_FOLDER ${LIBRARY_NAME})
SET(${LIBRARY_NAME}_LIBRARIES ${LIBRARY_NAME})
SET(${LIBRARY_NAME}_INSTALL_TREE_RELATIVE_INCLUDE_PATHS include/${LIBRARY_NAME})
SET(${LIBRARY_NAME}_INSTALL_TREE_RELATIVE_LIBRARY_PATHS lib)
- # Invoke the macro
- crea_INSTALL_LIBRARY_FOR_CMAKE(${LIBRARY_NAME})
+ # Invoke the advanced macro
+ CREA_ADVANCED_INSTALL_LIBRARY(${LIBRARY_NAME})
-ENDMACRO(crea_DEFAULT_INSTALL_LIBRARY_FOR_CMAKE)
+ENDMACRO(CREA_INSTALL_LIBRARY)
#-----------------------------------------------------------------------------
--- /dev/null
+
+MACRO(CREA_PREVENT_IN_SOURCE_BUILD)
+ IF(NOT CREA_ALLOW_IN_SOURCE_BUILD)
+ #------------------------------------------------------------------------
+ # Building in the source tree is forbidden !
+ # except if CREA_ALLOW_IN_SOURCE_BUILD is set,
+ # e.g. for packaging with rpmbuild
+ IF(PROJECT_BINARY_DIR STREQUAL ${PROJECT_SOURCE_DIR})
+ MESSAGE(FATAL_ERROR "Building in the source tree is not allowed !! Quit; remove the file 'CMakeCache.txt' and the folder 'CMakeFiles' and build outside the sources")
+ ENDIF(PROJECT_BINARY_DIR STREQUAL ${PROJECT_SOURCE_DIR})
+ #------------------------------------------------------------------------
+ ENDIF(NOT CREA_ALLOW_IN_SOURCE_BUILD)
+ENDMACRO(CREA_PREVENT_IN_SOURCE_BUILD)
#=======================================================================
# Looks for WxWidgets
#=======================================================================
-MACRO(crea_FIND_WXWIDGETS)
+MACRO(CREA_FIND_WXWIDGETS)
IF(WIN32)
# Search WXWIDGETS
# Why forcing verbosity ?
# SET(CMAKE_VERBOSE_MAKEFILE TRUE)
- INCLUDE (${crea_CMAKE_DIR}/FindWxWidgetsWin32.cmake)
+ INCLUDE (${CREA_CMAKE_DIR}/FindWxWidgetsWin32.cmake)
#
ELSE(WIN32)
# GTK2
- INCLUDE(${crea_CMAKE_DIR}/FindGTK2.cmake)
+ INCLUDE(${CREA_CMAKE_DIR}/FindGTK2.cmake)
# WX
# LG : Do not force but use what is installed !
# SET(wxWidgets_USE_LIBS base core gl)
-ENDMACRO(crea_FIND_WXWIDGETS)
+ENDMACRO(CREA_FIND_WXWIDGETS)
#=======================================================================
#=======================================================================
-MACRO(crea_USE_WXWIDGETS)
+MACRO(CREA_USE_WXWIDGETS)
# Preprocessor settings
- crea_DEFINE( USE_WXWIDGETS )
+ CREA_DEFINE( USE_WXWIDGETS )
#
IF(WIN32)
# Clean ?
${wxWidgets_LIBRARIES}
)
ENDIF(WIN32)
-ENDMACRO(crea_USE_WXWIDGETS)
+ENDMACRO(CREA_USE_WXWIDGETS)
#=======================================================================
--- /dev/null
+#========================================================================
+INCLUDE( ${CREA_CMAKE_DIR}/CREAMacro_Define.cmake)
+#========================================================================
+
+#========================================================================
+INCLUDE( ${CREA_CMAKE_DIR}/CREAMacro_FindAndUseLibraries.cmake)
+#========================================================================
+
+#========================================================================
+INCLUDE( ${CREA_CMAKE_DIR}/CREAMacro_InstallLibrary.cmake )
+#========================================================================
+
+#========================================================================
+INCLUDE( ${CREA_CMAKE_DIR}/CREAMacro_PreventInSourceBuild.cmake )
+#========================================================================
+
+
+
+#========================================================================
+# Creates a directory if it does not exist
+MACRO(CREA_MKDIR DIR)
+ IF(NOT IS_DIRECTORY ${DIR})
+ MESSAGE(STATUS "* Creating directory '${DIR}'")
+ FILE(MAKE_DIRECTORY ${DIR})
+ ENDIF(NOT IS_DIRECTORY ${DIR})
+ENDMACRO(CREA_MKDIR)
+#========================================================================
--- /dev/null
+# messages compilation options
+IF (CREA_COMPILE_MESSAGES)
+ CREA_DEFINE( CREA_COMPILE_MESSAGES )
+ENDIF (CREA_COMPILE_MESSAGES)
+
+IF (CREA_COMPILE_DEBUG_MESSAGES)
+ CREA_DEFINE( CREA_COMPILE_DEBUG_MESSAGES )
+ENDIF (CREA_COMPILE_DEBUG_MESSAGES)
+
+IF (CREA_COMPILE_WARNING_MESSAGES)
+ CREA_DEFINE( CREA_COMPILE_WARNING_MESSAGES )
+ENDIF (CREA_COMPILE_WARNING_MESSAGES)
+
+IF (CREA_COMPILE_ERROR_MESSAGES)
+ CREA_DEFINE( CREA_COMPILE_ERROR_MESSAGES )
+ENDIF (CREA_COMPILE_ERROR_MESSAGES)
#
# @LIBRARY_NAME@Config.cmake - CMake configuration file for external projects.
# This file was automatically generated by the cmake macro
-# crea_INSTALL_LIBRARY_FOR_CMAKE of the package crea
+# CREA_INSTALL_LIBRARY_FOR_CMAKE of the package CREA
#
# This file is configured by cmake and used by the
# Use@LIBRARY_NAME@.cmake module to load the lib settings
SET(@LIBRARY_NAME@_LIBRARIES @CILC_LIB_LIBRARIES@)
# Messages
-IF(crea_VERBOSE_FIND_LIBRARY)
+IF(CREA_VERBOSE_CMAKE)
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@_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(crea_VERBOSE_FIND_LIBRARY)
+ENDIF(CREA_VERBOSE_CMAKE)
# Does the library has an additional config file (user provided) ?
SET(@LIBRARY_NAME@_HAS_ADDITIONAL_CONFIG_FILE @CILC_LIB_HAS_ADDITIONAL_CONFIG_FILE@)
IF (@LIBRARY_NAME@_HAS_ADDITIONAL_CONFIG_FILE)
- IF(crea_VERBOSE_FIND_LIBRARY)
+ IF(CREA_VERBOSE_CMAKE)
MESSAGE(STATUS "Reading @LIBRARY_NAME@ additional configuration file")
- ENDIF(crea_VERBOSE_FIND_LIBRARY)
+ ENDIF(CREA_VERBOSE_CMAKE)
# Include it
INCLUDE(${@LIBRARY_NAME@_DIR}/Additional@LIBRARY_NAME@Config.cmake)
ENDIF (@LIBRARY_NAME@_HAS_ADDITIONAL_CONFIG_FILE)
# This should be included only when Find@LIBRARY_NAME@.cmake sets
# the @LIBRARY_NAME@_USE_FILE variable to point here.
-IF(crea_VERBOSE_FIND_LIBRARY)
+IF(CREA_VERBOSE_CMAKE)
MESSAGE(STATUS "Using @LIBRARY_NAME@")
-ENDIF(crea_VERBOSE_FIND_LIBRARY)
+ENDIF(CREA_VERBOSE_CMAKE)
# Load the compiler settings used for @LIBRARY_NAME@.
IF(@LIBRARY_NAME@_BUILD_SETTINGS_FILE)
+++ /dev/null
-IF(NOT ALLOW_IN_SOURCE_BUILD)
- #---------------------------------------------------------------------------
- # Building in the source tree is forbidden !
- # (except if ALLOW_IN_SOURCE_BUILD is set, e.g. for packaging with rpmbuild)
- IF(PROJECT_BINARY_DIR STREQUAL ${PROJECT_SOURCE_DIR})
- MESSAGE(FATAL_ERROR "Building in the source tree is not allowed !! Quit; remove the file 'CMakeCache.txt' and the folder 'CMakeFiles' and build outside the sources")
- ENDIF(PROJECT_BINARY_DIR STREQUAL ${PROJECT_SOURCE_DIR})
- #---------------------------------------------------------------------------
-ENDIF(NOT ALLOW_IN_SOURCE_BUILD)
+++ /dev/null
-# messages compilation options
-IF (crea_COMPILE_MESSAGES)
- crea_DEFINE( crea_COMPILE_MESSAGES )
-ENDIF (crea_COMPILE_MESSAGES)
-
-IF (crea_COMPILE_DEBUG_MESSAGES)
- crea_DEFINE( crea_COMPILE_DEBUG_MESSAGES )
-ENDIF (crea_COMPILE_DEBUG_MESSAGES)
-
-IF (crea_COMPILE_WARNING_MESSAGES)
- crea_DEFINE( crea_COMPILE_WARNING_MESSAGES )
-ENDIF (crea_COMPILE_WARNING_MESSAGES)
-
-IF (crea_COMPILE_ERROR_MESSAGES)
- crea_DEFINE( crea_COMPILE_ERROR_MESSAGES )
-ENDIF (crea_COMPILE_ERROR_MESSAGES)
)
-OPTION(crea_BUILD_SHARED "Build crea as a shared library (dynamic) ?" ON)
-IF (crea_BUILD_SHARED)
+OPTION(CREA_BUILD_SHARED "Build CREA as a shared library (dynamic) ?" ON)
+IF (CREA_BUILD_SHARED)
SET(CREA_BUILD_SHARED SHARED)
- crea_DEFINE(CREA_BUILD_SHARED)
-ENDIF(crea_BUILD_SHARED)
+ CREA_DEFINE(CREA_BUILD_SHARED)
+ENDIF(CREA_BUILD_SHARED)
-crea_DEFINE(CREA_EXPORT_SYMBOLS)
+CREA_DEFINE(CREA_EXPORT_SYMBOLS)
ADD_LIBRARY(crea ${CREA_BUILD_SHARED} ${SRCS})