Commit b785815f authored by David Bommes's avatar David Bommes

fixed cmake stuff

git-svn-id: http://www.openflipper.org/svnrepo/CoMISo/trunk@60 1355f012-dd97-4b2f-ae87-10fa9f823a57
parent bf5b18c0
......@@ -45,7 +45,7 @@ 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} )
list( APPEND COMISO_INCLUDE_DIRECTORIES ${SUITESPARSE_INCLUDE_DIRS} )
else ()
message (STATUS "SUITESPARSE not found!")
set (COMISO_SUITESPARSE_CONFIG_FILE_SETTINGS "#define COMISO_SUITESPARSE_AVAILABLE 0" )
......@@ -54,7 +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} )
list( APPEND COMISO_INCLUDE_DIRECTORIES ${MPI_INCLUDE_PATH} )
else ()
message (STATUS "MPI not found!")
set (COMISO_MPI_CONFIG_FILE_SETTINGS "#define COMISO_MPI_AVAILABLE 0" )
......@@ -63,7 +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} )
list( APPEND COMISO_INCLUDE_DIRECTORIES ${PETSC_INCLUDE_DIRS} )
else ()
message (STATUS "PETSC not found!")
set (COMISO_PETSC_CONFIG_FILE_SETTINGS "#define COMISO_PETSC_AVAILABLE 0" )
......@@ -73,7 +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} )
list( APPEND COMISO_INCLUDE_DIRECTORIES ${TAO_INCLUDE_DIRS} )
else ()
message (STATUS "TAO not found!")
set (COMISO_TAO_CONFIG_FILE_SETTINGS "#define COMISO_TAO_AVAILABLE 0" )
......
......@@ -12,15 +12,77 @@ IF (COMISO_INCLUDE_DIR)
SET(COMISO_FIND_QUIETLY TRUE)
ENDIF (COMISO_INCLUDE_DIR)
FIND_PATH( COMISO_INCLUDE_DIR CoMISo/Config/CoMISoDefines.hh
PATHS "${CMAKE_SOURCE_DIR}/libs/" "${CMAKE_SOURCE_DIR}/.." )
# Find CoMISo config file
FIND_PATH( COMISO_INCLUDE_DIR CoMISo/Config/config.hh
PATHS "${CMAKE_SOURCE_DIR}/libs/" )
FILE(READ ${COMISO_INCLUDE_DIR}/CoMISo/Config/config.hh CURRENT_COMISO_CONFIG)
set(COMISO_OPT_DEPS "")
STRING(REGEX MATCH "\#define COMISO_MPI_AVAILABLE 1" COMISO_MPI_BUILD_TIME_AVAILABLE ${CURRENT_COMISO_CONFIG} )
if ( COMISO_MPI_BUILD_TIME_AVAILABLE )
find_package(MPI)
if ( NOT MPI_FOUND )
message(ERROR "COMISO configured with mpi but mpi not available")
endif()
list (APPEND COMISO_OPT_DEPS "MPI")
endif()
STRING(REGEX MATCH "\#define COMISO_PETSC_AVAILABLE 1" COMISO_PETSC_BUILD_TIME_AVAILABLE ${CURRENT_COMISO_CONFIG} )
if ( COMISO_PETSC_BUILD_TIME_AVAILABLE )
find_package(PETSC)
if ( NOT PETSC_FOUND )
message(ERROR "COMISO configured with petsc but petsc not available")
endif()
list (APPEND COMISO_OPT_DEPS "PETSC")
endif()
STRING(REGEX MATCH "\#define COMISO_IPOPT_AVAILABLE 1" COMISO_IPOPT_BUILD_TIME_AVAILABLE ${CURRENT_COMISO_CONFIG} )
if ( COMISO_IPOPT_BUILD_TIME_AVAILABLE )
find_package(IPOPT)
if ( NOT IPOPT_FOUND )
message(ERROR "COMISO configured with ipopt but ipopt not available")
endif()
list (APPEND COMISO_OPT_DEPS "IPOPT")
endif()
STRING(REGEX MATCH "\#define COMISO_TAO_AVAILABLE 1" COMISO_TAO_BUILD_TIME_AVAILABLE ${CURRENT_COMISO_CONFIG} )
if ( COMISO_TAO_BUILD_TIME_AVAILABLE )
find_package(TAO)
if ( NOT TAO_FOUND )
message(ERROR "COMISO configured with tao but tao not available")
endif()
list (APPEND COMISO_OPT_DEPS "TAO")
endif()
add_definitions (-DCOMISODLL -DUSECOMISO )
IF (COMISO_INCLUDE_DIR)
SET(COMISO_FOUND TRUE)
SET( COMISO_LIBRARY_DIR "${ACG_PROJECT_LIBDIR}" )
SET( COMISO_LIBRARY_DIR "${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_LIBDIR}" )
SET( COMISO_LIBRARY "CoMISo")
SET( COMISO_DEPS "GMM;BLAS;SUITESPARSE" )
ELSE (COMISO_INCLUDE_DIR)
SET( COMISO_FOUND FALSE )
SET( COMISO_LIBRARY_DIR )
......
......@@ -60,7 +60,7 @@ ELSE( WIN32 )
PATHS "$ENV{HOME}/opt/HSL/lib"
)
IF(IPOPT_HSL_LIBRARY_DIR)
IF( IPOPT_HSL_LIBRARY_DIR)
set(IPOPT_LIBRARY_DIR ${IPOPT_HSL_LIBRARY_DIR})
ENDIF(IPOPT_HSL_LIBRARY_DIR)
ENDIF()
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