Commit 49281e64 authored by David Bommes's avatar David Bommes

changed CMakeLists to capture dependency includes/library-dirs/libraries

git-svn-id: http://www.openflipper.org/svnrepo/CoMISo/trunk@89 1355f012-dd97-4b2f-ae87-10fa9f823a57
parent 8f249858
......@@ -23,6 +23,8 @@ acg_get_version ()
include (ACGOutput)
set(COMISO_INCLUDE_DIRECTORIES "")
set(COMISO_LINK_DIRECTORIES "")
set(COMISO_LINK_LIBRARIES "")
find_package (GMM)
if (GMM_FOUND)
......@@ -36,11 +38,20 @@ endif ()
# We require cgal with its blas on windows
if (WIN32)
find_package(CGAL)
if (CGAL_FOUND)
list( APPEND COMISO_INCLUDE_DIRECTORIES ${CGAL_INCLUDE_DIR} )
list( APPEND COMISO_LINK_DIRECTORIES ${CGAL_LIBRARY_DIR} )
list( APPEND COMISO_LINK_LIBRARIES ${CGAL_LIBRARIES} )
endif()
endif()
find_package (BLAS)
if (BLAS_FOUND )
set (COMISO_BLAS_CONFIG_FILE_SETTINGS "#define COMISO_BLAS_AVAILABLE 1" )
list( APPEND COMISO_INCLUDE_DIRECTORIES ${BLAS_INCLUDE_DIRS} )
list( APPEND COMISO_LINK_DIRECTORIES ${BLAS_LIBRARY_DIRS} )
list( APPEND COMISO_LINK_LIBRARIES ${BLAS_LIBRARIES} )
else()
set (COMISO_BLAS_CONFIG_FILE_SETTINGS "#define COMISO_BLAS_AVAILABLE 0" )
message (FATAL_ERROR "BLAS not found!")
......@@ -51,6 +62,8 @@ if (SUITESPARSE_FOUND )
set (COMISO_SUITESPARSE_CONFIG_FILE_SETTINGS "#define COMISO_SUITESPARSE_AVAILABLE 1" )
list( APPEND COMISO_INCLUDE_DIRECTORIES ${SUITESPARSE_INCLUDE_DIRS} )
list( APPEND COMISO_LINK_DIRECTORIES ${SUITESPARSE_LIBRARY_DIRS} )
list( APPEND COMISO_LINK_LIBRARIES ${SUITESPARSE_LIBRARIES} )
else ()
message (STATUS "SUITESPARSE not found!")
set (COMISO_SUITESPARSE_CONFIG_FILE_SETTINGS "#define COMISO_SUITESPARSE_AVAILABLE 0" )
......@@ -60,6 +73,7 @@ find_package (MPI)
if (MPI_FOUND )
set (COMISO_MPI_CONFIG_FILE_SETTINGS "#define COMISO_MPI_AVAILABLE 1" )
list( APPEND COMISO_INCLUDE_DIRECTORIES ${MPI_INCLUDE_PATH} )
list( APPEND COMISO_LINK_LIBRARIES ${MPI_CXX_LIBRARIES} )
else ()
message (STATUS "MPI not found!")
set (COMISO_MPI_CONFIG_FILE_SETTINGS "#define COMISO_MPI_AVAILABLE 0" )
......@@ -69,6 +83,8 @@ 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_DIRS} )
list( APPEND COMISO_LINK_DIRECTORIES ${PETSC_LIBRARY_DIR} )
list( APPEND COMISO_LINK_LIBRARIES ${PETSC_LIBRARY} )
else ()
message (STATUS "PETSC or dependency not found!")
set (COMISO_PETSC_CONFIG_FILE_SETTINGS "#define COMISO_PETSC_AVAILABLE 0" )
......@@ -79,6 +95,8 @@ 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_DIRS} )
list( APPEND COMISO_LINK_DIRECTORIES ${TAO_LIBRARY_DIR} )
list( APPEND COMISO_LINK_LIBRARIES ${TAO_LIBRARY} )
else ()
message (STATUS "TAO or dependency not found!")
set (COMISO_TAO_CONFIG_FILE_SETTINGS "#define COMISO_TAO_AVAILABLE 0" )
......@@ -88,6 +106,7 @@ find_package (MUMPS)
if (MUMPS_FOUND )
set (COMISO_MUMPS_CONFIG_FILE_SETTINGS "#define COMISO_MUMPS_AVAILABLE 1" )
list( APPEND COMISO_INCLUDE_DIRECTORIES ${MUMPS_INCLUDE_DIR} )
list( APPEND COMISO_LINK_LIBRARIES ${MUMPS_LIBRARY} )
else ()
message (STATUS "MUMPS not found!")
set (COMISO_MUMPS_CONFIG_FILE_SETTINGS "#define COMISO_MUMPS_AVAILABLE 0" )
......@@ -97,6 +116,8 @@ find_package (IPOPT)
if (IPOPT_FOUND AND MUMPS_FOUND)
set (COMISO_IPOPT_CONFIG_FILE_SETTINGS "#define COMISO_IPOPT_AVAILABLE 1" )
list( APPEND COMISO_INCLUDE_DIRECTORIES ${IPOPT_INCLUDE_DIR} )
list( APPEND COMISO_LINK_DIRECTORIES ${IPOPT_LIBRARY_DIR} )
list( APPEND COMISO_LINK_LIBRARIES ${IPOPT_LIBRARY} )
else ()
message (STATUS "IPOPT or dependency not found!")
set (COMISO_IPOPT_CONFIG_FILE_SETTINGS "#define COMISO_IPOPT_AVAILABLE 0" )
......@@ -115,6 +136,10 @@ find_package (Taucs)
if (TAUCS_FOUND )
set (COMISO_TAUCS_CONFIG_FILE_SETTINGS "#define COMISO_TAUCS_AVAILABLE 1" )
list( APPEND COMISO_INCLUDE_DIRECTORIES ${TAUCS_INCLUDE_DIR} )
list( APPEND COMISO_INCLUDE_DIRECTORIES ${LAPACK_INCLUDE_DIR} )
list( APPEND COMISO_LINK_DIRECTORIES ${LAPACK_LIBRARY_DIR} )
list( APPEND COMISO_LINK_LIBRARIES ${TAUCS_LIBRARY} )
list( APPEND COMISO_LINK_LIBRARIES ${LAPACK_LIBRARIES} )
else ()
message (STATUS "TAUCS not found!")
set (COMISO_TAUCS_CONFIG_FILE_SETTINGS "#define COMISO_TAUCS_AVAILABLE 0" )
......@@ -134,11 +159,7 @@ endif ()
link_directories (
${SUITESPARSE_LIBRARY_DIRS}
# ${MPI_LIBRARY_DIR}
${PETSC_LIBRARY_DIR}
${TAO_LIBRARY_DIR}
${IPOPT_LIBRARY_DIR}
${COMISO_LINK_DIRECTORIES}
)
# source code directories
......@@ -195,18 +216,12 @@ acg_add_library (CoMISo SHARED ${uic_targets} ${sources} ${headers} ${moc_target
if (NOT APPLE)
target_link_libraries (CoMISo
${QT_LIBRARIES}
${SUITESPARSE_LIBRARIES}
${BLAS_LIBRARIES}
${COMISO_LINK_LIBRARIES}
)
else(NOT APPLE)
target_link_libraries (CoMISo
${QT_LIBRARIES}
${SUITESPARSE_LIBRARIES}
${BLAS_LIBRARIES}
${PETSC_LIBRARIES}
${TAO_LIBRARIES}
${MPI_LIBRARIES}
${IPOPT_LIBRARIES}
${COMISO_LINK_LIBRARIES}
)
endif(NOT APPLE)
......
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