Commit bf5b18c0 authored by Jan Möbius's avatar Jan Möbius

Only append include directories if the corresponding libraries were found

git-svn-id: http://www.openflipper.org/svnrepo/CoMISo/trunk@59 1355f012-dd97-4b2f-ae87-10fa9f823a57
parent 5705ebf0
......@@ -22,9 +22,12 @@ acg_get_version ()
include (ACGOutput)
set(COMISO_INCLUDE_DIRECTORIES "")
find_package (GMM)
if (GMM_FOUND)
set (COMISO_GMM_CONFIG_FILE_SETTINGS "#define COMISO_GMM_AVAILABLE 1" )
list( APPEND COMISO_INCLUDE_DIRECTORIES ${GMM_INCLUDE_DIR} )
else()
set (COMISO_GMM_CONFIG_FILE_SETTINGS "#define COMISO_GMM_AVAILABLE 0" )
message (FATAL_ERROR "GMM not found!")
......@@ -38,10 +41,11 @@ else()
message (FATAL_ERROR "BLAS not found!")
endif ()
#added by CAT
find_package (SUITESPARSE)
if (SUITESPARSE_FOUND )
set (COMISO_SUITESPARSE_CONFIG_FILE_SETTINGS "#define COMISO_SUITESPARSE_AVAILABLE 1" )
list( APPEND COMISO_INCLUDE_DIRECTORIES ${SUITESPARSE_INCLUDE_DIR} )
else ()
message (STATUS "SUITESPARSE not found!")
set (COMISO_SUITESPARSE_CONFIG_FILE_SETTINGS "#define COMISO_SUITESPARSE_AVAILABLE 0" )
......@@ -50,6 +54,7 @@ endif ()
find_package (MPI)
if (MPI_FOUND )
set (COMISO_MPI_CONFIG_FILE_SETTINGS "#define COMISO_MPI_AVAILABLE 1" )
list( APPEND COMISO_INCLUDE_DIRECTORIES ${MPI_INCLUDE_DIR} )
else ()
message (STATUS "MPI not found!")
set (COMISO_MPI_CONFIG_FILE_SETTINGS "#define COMISO_MPI_AVAILABLE 0" )
......@@ -58,6 +63,7 @@ endif ()
find_package (PETSC)
if (PETSC_FOUND AND MPI_FOUND)
set (COMISO_PETSC_CONFIG_FILE_SETTINGS "#define COMISO_PETSC_AVAILABLE 1" )
list( APPEND COMISO_INCLUDE_DIRECTORIES ${PETSC_INCLUDE_DIR} )
else ()
message (STATUS "PETSC not found!")
set (COMISO_PETSC_CONFIG_FILE_SETTINGS "#define COMISO_PETSC_AVAILABLE 0" )
......@@ -67,6 +73,7 @@ endif ()
find_package (TAO)
if (TAO_FOUND AND PETSC_FOUND AND MPI_FOUND)
set (COMISO_TAO_CONFIG_FILE_SETTINGS "#define COMISO_TAO_AVAILABLE 1" )
list( APPEND COMISO_INCLUDE_DIRECTORIES ${TAO_INCLUDE_DIR} )
else ()
message (STATUS "TAO not found!")
set (COMISO_TAO_CONFIG_FILE_SETTINGS "#define COMISO_TAO_AVAILABLE 0" )
......@@ -75,6 +82,7 @@ endif ()
find_package (IPOPT)
if (IPOPT_FOUND )
set (COMISO_IPOPT_CONFIG_FILE_SETTINGS "#define COMISO_IPOPT_AVAILABLE 1" )
list( APPEND COMISO_INCLUDE_DIRECTORIES ${IPOPT_INCLUDE_DIR} )
else ()
message (STATUS "IPOPT not found!")
set (COMISO_IPOPT_CONFIG_FILE_SETTINGS "#define COMISO_IPOPT_AVAILABLE 0" )
......@@ -101,12 +109,7 @@ include_directories (
..
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${GMM_INCLUDE_DIR}
${SUITESPARSE_INCLUDE_DIRS}
${MPI_INCLUDE_PATH}
${PETSC_INCLUDE_DIRS}
${TAO_INCLUDE_DIRS}
${IPOPT_INCLUDE_DIR}
${COMISO_INCLUDE_DIRECTORIES}
)
# generate dllexport macros on windows
......
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