CoMISoExample.cmake 4.37 KB
Newer Older
David Bommes's avatar
David Bommes committed
1 2 3
# add our macro directory to cmake search path
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)

David Bommes's avatar
David Bommes committed
4
include (ACGCommon)
David Bommes's avatar
David Bommes committed
5
find_package(CoMISo)
David Bommes's avatar
David Bommes committed
6 7

#find_package(MUMPS)
David Bommes's avatar
David Bommes committed
8 9 10 11 12
if (MUMPS_FOUND )
  list( APPEND COMISO_INCLUDE_DIRECTORIES ${MUMPS_INCLUDE_DIR} )
  list( APPEND COMISO_LINK_LIBRARIES ${MUMPS_LIBRARY} )
endif ()

David Bommes's avatar
David Bommes committed
13
#find_package (IPOPT)
David Bommes's avatar
David Bommes committed
14 15 16
if (IPOPT_FOUND AND MUMPS_FOUND)
  list( APPEND COMISO_INCLUDE_DIRECTORIES ${IPOPT_INCLUDE_DIR} )
  list( APPEND COMISO_LINK_DIRECTORIES ${IPOPT_LIBRARY_DIR} )
17
  list( APPEND COMISO_LINK_LIBRARIES ${IPOPT_LIBRARIES} )
David Bommes's avatar
David Bommes committed
18 19
endif ()

David Bommes's avatar
David Bommes committed
20 21
#find_package(LAPACK)
#find_package(Taucs)
David Bommes's avatar
David Bommes committed
22 23 24 25 26 27 28 29
if(LAPACK_FOUND AND TAUCS_FOUND)
  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} )
endif()

David Bommes's avatar
David Bommes committed
30
#find_package(GUROBI)
David Bommes's avatar
David Bommes committed
31 32 33 34 35
if( GUROBI_FOUND)
  list( APPEND COMISO_INCLUDE_DIRECTORIES ${GUROBI_INCLUDE_DIR} )
  list( APPEND COMISO_LINK_DIRECTORIES    ${GUROBI_LIBRARY_DIR} )
  list( APPEND COMISO_LINK_LIBRARIES  ${GUROBI_LIBRARY} )
endif()
David Bommes's avatar
David Bommes committed
36

David Bommes's avatar
David Bommes committed
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
#find_package(CBC)
if( CBC_FOUND)
  list( APPEND COMISO_INCLUDE_DIRECTORIES ${CBC_INCLUDE_DIRS} )
  list( APPEND COMISO_LINK_LIBRARIES  ${CBC_LIBRARIES} )
endif()

#find_package(CLP)
if( CLP_FOUND)
  list( APPEND COMISO_INCLUDE_DIRECTORIES ${CLP_INCLUDE_DIRS} )
  list( APPEND COMISO_LINK_LIBRARIES  ${CLP_LIBRARIES} )
endif()

#find_package(CGL)
if( CGL_FOUND)
  list( APPEND COMISO_INCLUDE_DIRECTORIES ${CGL_INCLUDE_DIRS} )
  list( APPEND COMISO_LINK_LIBRARIES  ${CGL_LIBRARIES} )
endif()

#find_package(COINUTILS)
if( COINUTILS_FOUND)
  list( APPEND COMISO_INCLUDE_DIRECTORIES ${COINUTILS_INCLUDE_DIRS} )
  list( APPEND COMISO_LINK_LIBRARIES  ${COINUTILS_LIBRARIES} )
endif()

David Bommes's avatar
David Bommes committed
61
#find_package(ARPACK)
David Bommes's avatar
David Bommes committed
62 63 64 65 66
if( ARPACK_FOUND)
  list( APPEND COMISO_INCLUDE_DIRECTORIES ${ARPACK_INCLUDE_DIR} )
  list( APPEND COMISO_LINK_LIBRARIES  ${ARPACK_LIBRARIES} )
endif()

David Bommes's avatar
David Bommes committed
67
#FIND_PACKAGE( Boost 1.42.0 COMPONENTS system filesystem regex)
David Bommes's avatar
David Bommes committed
68 69 70 71 72 73
if( Boost_FOUND)
  list( APPEND COMISO_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIR} )
  list( APPEND COMISO_LINK_DIRECTORIES  ${Boost_LIBRARY_DIRS} )
  list( APPEND COMISO_LINK_LIBRARIES  ${Boost_LIBRARIES} )
endif()

David Bommes's avatar
David Bommes committed
74
#FIND_PACKAGE( MPI)
75 76 77 78
if( MPI_FOUND)
  list( APPEND COMISO_LINK_LIBRARIES  ${MPI_CXX_LIBRARIES} )
endif()

David Bommes's avatar
David Bommes committed
79
#FIND_PACKAGE( PETSC)
80 81 82 83 84 85
if( PETSC_FOUND)
  list( APPEND COMISO_LINK_LIBRARIES  ${PETSC_LIBRARY} )
  list( APPEND COMISO_LINK_LIBRARIES  ${TAO_LIBRARY} )
  list( APPEND COMISO_LINK_DIRECTORIES ${PETSC_LIBRARY_DIR} )
endif()

David Bommes's avatar
David Bommes committed
86
#FIND_PACKAGE( TAO)
87 88 89 90
if( TAO_FOUND)
  list( APPEND COMISO_LINK_DIRECTORIES ${TAO_LIBRARY_DIR})
endif()

David Bommes's avatar
David Bommes committed
91
#FIND_PACKAGE( SUITESPARSE)
92 93 94 95 96 97
if(SUITESPARSE_FOUND)
  list( APPEND COMISO_INCLUDE_DIRECTORIES ${SUITESPARSE_INCLUDE_DIRS})
  list( APPEND COMISO_LINK_LIBRARIES  ${SUITESPARSE_LIBRARIES} )
  list( APPEND COMISO_LINK_DIRECTORIES ${SUITESPARSE_LIBRARY_DIRS} )
endif()

98 99 100
#FIND_PACKAGE( EIGEN3)
if(EIGEN3_FOUND)
  list( APPEND COMISO_INCLUDE_DIRECTORIES ${EIGEN3_INCLUDE_DIR})
101
endif()
David Bommes's avatar
David Bommes committed
102

David Bommes's avatar
David Bommes committed
103 104 105 106 107
#FIND_PACKAGE( DCO)
if(DCO_FOUND)
  list( APPEND COMISO_INCLUDE_DIRECTORIES ${DCO_INCLUDE_DIR})
endif()

David Bommes's avatar
David Bommes committed
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125
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()

if (CPLEX_FOUND)
  list( APPEND COMISO_INCLUDE_DIRECTORIES ${CPLEX_INCLUDE_DIRS} )
  list( APPEND COMISO_LINK_LIBRARIES  ${CPLEX_LIBRARIES} )
  #enable c++ support
   add_definitions(-DIL_STD)
endif()

if (GUROBI_FOUND )
  list( APPEND COMISO_INCLUDE_DIRECTORIES ${GUROBI_INCLUDE_DIRS} )
  list( APPEND COMISO_LINK_LIBRARIES  ${GUROBI_LIBRARIES} )
endif ()

David Bommes's avatar
David Bommes committed
126 127
#MESSAGE( ${COMISO_LINK_LIBRARIES})

David Bommes's avatar
David Bommes committed
128 129 130
#ToDo:
#list( APPEND COMISO_LINK_LIBRARIES  "pthread" )

David Bommes's avatar
David Bommes committed
131 132 133 134 135 136 137 138 139 140 141
include_directories (
  ..
  ${CMAKE_SOURCE_DIR}
  ${CMAKE_CURRENT_SOURCE_DIR}
  ${CMAKE_CURRENT_BINARY_DIR}
  ${COMISO_INCLUDE_DIR}
  ${COMISO_INCLUDE_DIRECTORIES}
)

link_directories (
  ${COMISO_LINK_DIRECTORIES}
142
)
David Bommes's avatar
David Bommes committed
143 144 145 146 147 148 149 150 151 152 153 154 155 156

# source code directories
set (directories 
  ${CMAKE_CURRENT_SOURCE_DIR} 
)

# collect all header and source files
set(headers "")
set(sources "")
acg_append_files (headers "*.hh" ${directories})
acg_append_files (sources "*.cc" ${directories})

# remove template cc files from source file list
acg_drop_templates (sources)