Commit 26a2c257 authored by David Bommes's avatar David Bommes

improved some cmake finder to be standard conform

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@16216 383ad7c9-94d9-4d36-a494-682f7c89f535
parent bf87646e
# - Find ADOL-C
# Find the native ADOL-C headers and libraries.
#
# ADOLC_INCLUDE_DIR - Where to find <adolc/adolc.h>, etc.
# ADOLC_FOUND - True if ADOL-C found.
# ADOLC_LIBRARY_DIR - Where to find the library files
# ADOLC_LIBRARIES - Which libraries are available
IF (ADOLC_INCLUDE_DIR)
# Already in cache, be silent
SET(ADOLC_FIND_QUIETLY TRUE)
ENDIF (ADOLC_INCLUDE_DIR)
GET_FILENAME_COMPONENT(module_file_path ${CMAKE_CURRENT_LIST_FILE} PATH )
# Look for the header files
FIND_PATH(ADOLC_INCLUDE_DIR NAMES adolc/adolc.h
PATHS /usr/include/adolc
/usr/local/include
/usr/local/include/adolc/
/opt/local/include/adolc/
${ADOLC_DIR}/include
"c:\\libs\\adolc\\include"
"c:\\libs\\adolc\\include"
${PROJECT_SOURCE_DIR}/MacOS/Libs/adolc/include
../../External/include
${module_file_path}/../../../External/include)
# Copy the results to the output variables.
IF(ADOLC_INCLUDE_DIR )
SET(ADOLC_FOUND 1)
SET(ADOLC_INCLUDE_DIR ${ADOLC_INCLUDE_DIR})
ELSE(ADOLC_INCLUDE_DIR )
SET(ADOLC_FOUND 0)
SET(ADOLC_INCLUDE_DIR)
ENDIF(ADOLC_INCLUDE_DIR )
# Look for the libraries
find_library(ADOLC_LIBRARIES NAMES adolc
PATHS
${ADOLC_INCLUDE_DIR}/../lib
${ADOLC_INCLUDE_DIR}/../lib64
# - Try to find ADOLC
# Once done this will define
# ADOLC_FOUND - System has ADOLC
# ADOLC_INCLUDE_DIRS - The ADOLC include directories
# ADOLC_LIBRARIES - The libraries needed to use ADOLC
if (ADOLC_INCLUDE_DIR)
# in cache already
set(ADOLC_FOUND TRUE)
set(ADOLC_INCLUDE_DIRS "${ADOLC_INCLUDE_DIR}" )
set(ADOLC_LIBRARIES "${ADOLC_LIBRARY}" )
else (ADOLC_INCLUDE_DIR)
message( status "adolc include dir: ${ADOLC_DIR}/include/")
find_path( ADOLC_INCLUDE_DIR
NAMES adolc/adolc.h
PATHS $ENV{ADOLC_DIR}/include/
/usr/include/adolc
/usr/local/include
/usr/local/include/adolc/
/opt/local/include/adolc/
"c:\\libs\\adolc\\include"
"c:\\libs\\adolc\\include"
${PROJECT_SOURCE_DIR}/MacOS/Libs/adolc/include
../../External/include
${module_file_path}/../../../External/include
)
find_library( ADOLC_LIBRARY
adolc
PATHS $ENV{ADOLC_DIR}/lib
$ENV{ADOLC_DIR}/lib64
/usr/lib/adolc
/usr/local/lib
/usr/local/lib/adolc/
/opt/local/lib/adolc/
"c:\\libs\\adolc\\lib"
"c:\\libs\\adolc\\lib"
${PROJECT_SOURCE_DIR}/MacOS/Libs/adolc/lib
${ADOLC_DIR}/include
/usr/lib64/adolc
${PROJECT_SOURCE_DIR}/MacOS/Libs/adolc/lib
/usr/lib64/adolc
/usr/local/lib64
/usr/local/lib64/adolc/
/opt/local/lib64/adolc/
"c:\\libs\\adolc\\lib64"
"c:\\libs\\adolc\\lib64"
${PROJECT_SOURCE_DIR}/MacOS/Libs/adolc/lib64
DOC "Path to the ADOL-C library"
)
${PROJECT_SOURCE_DIR}/MacOS/Libs/adolc/lib64
DOC "ADOL-C library"
)
set(ADOLC_INCLUDE_DIRS "${ADOLC_INCLUDE_DIR}" )
set(ADOLC_LIBRARIES "${ADOLC_LIBRARY}" )
get_filename_component(ADOLC_LIBRARY_DIR ${ADOLC_LIBRARIES} PATH CACHE)
include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set LIBCPLEX_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(ADOLC DEFAULT_MSG
ADOLC_LIBRARY ADOLC_INCLUDE_DIR)
# Report the results.
IF(NOT ADOLC_FOUND)
SET(ADOLC_DIR_MESSAGE
"ADOLC was not found. Make sure ADOLC_INCLUDE_DIR is set to the directories containing the include and lib files for ADOLC.")
ELSE (NOT ADOLC_FOUND)
ADD_DEFINITIONS(-DADOLC_AVAILABLE)
IF(NOT ADOLC_FIND_QUIETLY)
MESSAGE(STATUS "Looking for ADOLC - found")
ENDIF(NOT ADOLC_FIND_QUIETLY)
ENDIF(NOT ADOLC_FOUND)
mark_as_advanced(ADOLC_INCLUDE_DIR ADOLC_LIBRARY)
endif(ADOLC_INCLUDE_DIR)
......@@ -193,17 +193,17 @@ if ( COMISO_INCLUDE_DIR )
endif()
STRING(REGEX MATCH "\#define COMISO_Eigen3_AVAILABLE 1" COMISO_Eigen3_BUILD_TIME_AVAILABLE ${CURRENT_COMISO_CONFIG} )
STRING(REGEX MATCH "\#define COMISO_EIGEN3_AVAILABLE 1" COMISO_EIGEN3_BUILD_TIME_AVAILABLE ${CURRENT_COMISO_CONFIG} )
if ( COMISO_Eigen3_BUILD_TIME_AVAILABLE )
if ( COMISO_EIGEN3_BUILD_TIME_AVAILABLE )
find_package(Eigen3)
find_package(EIGEN3)
if ( NOT Eigen3_FOUND )
message(ERROR "COMISO configured with Eigen3 but Eigen3 not available")
if ( NOT EIGEN3_FOUND )
message(ERROR "COMISO configured with EIGEN3 but EIGEN3 not available")
endif()
list (APPEND COMISO_OPT_DEPS "Eigen3")
list (APPEND COMISO_OPT_DEPS "EIGEN3")
endif()
......
# - Try to find EIGEN3
# Once done this will define
# EIGEN3_FOUND - System has EIGEN3
# EIGEN3_INCLUDE_DIRS - The EIGEN3 include directories
if (EIGEN3_INCLUDE_DIR)
# in cache already
set(EIGEN3_FOUND TRUE)
set(EIGEN3_INCLUDE_DIRS "${EIGEN3_INCLUDE_DIR}" )
else (EIGEN3_INCLUDE_DIR)
find_path( EIGEN3_INCLUDE_DIR
NAMES Eigen/Dense
PATHS $ENV{EIGEN_DIR}
/usr/include/eigen3
/usr/local/include
/usr/local/include/eigen3/
/opt/local/include/eigen3/
"c:\\libs\\eigen3\\include"
"c:\\libs\\eigen\\include"
${PROJECT_SOURCE_DIR}/MacOS/Libs/eigen3/include
../../External/include
${module_file_path}/../../../External/include
)
set(EIGEN3_INCLUDE_DIRS "${EIGEN3_INCLUDE_DIR}" )
include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set LIBCPLEX_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(EIGEN3 DEFAULT_MSG
EIGEN3_INCLUDE_DIR)
mark_as_advanced(EIGEN3_INCLUDE_DIR)
endif(EIGEN3_INCLUDE_DIR)
# - Find GMM
# Find the native GMM headers and libraries.
#
# GMM_INCLUDE_DIR - where to find GMM.h, etc.
# GMM_LIBRARIES - List of libraries when using GMM.
# GMM_FOUND - True if GMM found.
IF (GMM_INCLUDE_DIR)
# Already in cache, be silent
SET(GMM_FIND_QUIETLY TRUE)
ENDIF (GMM_INCLUDE_DIR)
GET_FILENAME_COMPONENT(module_file_path ${CMAKE_CURRENT_LIST_FILE} PATH )
# Look for the header file.
FIND_PATH(GMM_INCLUDE_DIR NAMES gmm/gmm.h
PATHS /usr/include
/usr/include
/usr/local/include
~/sw/gmm-4.1/include
~/sw/gmm-4.2/include
"c:\\libs\\gmm-4.1\\include"
"c:\\libs\\gmm-3.0\\include"
${PROJECT_SOURCE_DIR}/MacOS/Libs/gmm-3.1/include
../../External/include
/ACG/acgdev/gcc-4.3-i686/gmm-4.1/include/
/ACG/acgdev/gcc-4.3-i686/gmm-3/include/
${module_file_path}/../../../External/include
$ENV{HOME}/opt/gmm/gmm-4.2/include)
# Copy the results to the output variables.
IF(GMM_INCLUDE_DIR )
SET(GMM_FOUND 1)
SET(GMM_INCLUDE_DIR ${GMM_INCLUDE_DIR})
IF (WIN32)
add_definitions(-D_SCL_SECURE_NO_DEPRECATE)
ENDIF(WIN32)
ELSE(GMM_INCLUDE_DIR )
SET(GMM_FOUND 0)
SET(GMM_INCLUDE_DIR)
ENDIF(GMM_INCLUDE_DIR )
# Report the results.
IF(NOT GMM_FOUND)
SET(GMM_DIR_MESSAGE
"GMM was not found. Make sure GMM_INCLUDE_DIR is set to the directories containing the include and lib files for GMM. .")
IF(GMM_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "${GMM_DIR_MESSAGE}")
ELSEIF(NOT GMM_FIND_QUIETLY)
MESSAGE(STATUS "${GMM_DIR_MESSAGE}")
ELSE(NOT GMM_FIND_QUIETLY)
ENDIF(GMM_FIND_REQUIRED)
ELSE (NOT GMM_FOUND)
IF(NOT GMM_FIND_QUIETLY)
MESSAGE(STATUS "Looking for GMM - found")
ENDIF(NOT GMM_FIND_QUIETLY)
ENDIF(NOT GMM_FOUND)
# - Try to find GMM
# Once done this will define
# GMM_FOUND - System has GMM
# GMM_INCLUDE_DIRS - The GMM include directories
# GMM_COMPILER_FLAGS - Compiler flags that are necessary for GMM
if (GMM_INCLUDE_DIR)
# in cache already
set(GMM_FOUND TRUE)
set(GMM_INCLUDE_DIRS "${GMM_INCLUDE_DIR}" )
else (GMM_INCLUDE_DIR)
find_path( GMM_INCLUDE_DIR
NAMES gmm/gmm.h
PATHS $ENV{GMM_DIR}
/usr/include
/usr/include
/usr/local/include
~/sw/gmm-4.1/include
"c:\\libs\\gmm-4.1\\include"
"c:\\libs\\gmm-3.0\\include"
${PROJECT_SOURCE_DIR}/MacOS/Libs/gmm-3.1/include
../../External/include
/ACG/acgdev/gcc-4.3-i686/gmm-4.1/include/
/ACG/acgdev/gcc-4.3-i686/gmm-3/include/
${module_file_path}/../../../External/include
$ENV{HOME}/opt/gmm/gmm-4.2/include
)
set(GMM_INCLUDE_DIRS "${GMM_INCLUDE_DIR}" )
# use c++ headers as default
IF (WIN32)
set(GMM_COMPILER_FLAGS "-D_SCL_SECURE_NO_DEPRECATE" CACHE STRING "GMM Compiler Flags")
# add_definitions(-D_SCL_SECURE_NO_DEPRECATE)
ELSE(WIN32)
set(GMM_COMPILER_FLAGS "" CACHE STRING "GMM Compiler Flags")
ENDIF(WIN32)
include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set LIBCPLEX_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(GMM DEFAULT_MSG
GMM_INCLUDE_DIR)
mark_as_advanced(GMM_INCLUDE_DIR GMM_COMPILER_FLAGS)
endif(GMM_INCLUDE_DIR)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment