CMakeLists.txt 16.5 KB
Newer Older
1 2 3 4 5 6 7 8 9
cmake_minimum_required (VERSION 2.6)

project(CoMISo)

# add our macro directory to cmake search path
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)

include (ACGCommon)

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34

# Flag to enable or disable QT widgets in CoMISo
set( WANT_COMISO_QT ON CACHE BOOL "Enable Qt support in CoMISo" )


if( WANT_COMISO_QT )

  # try to use QT5 if possible otherwise stick to QT4
  set (FORCE_QT4 ON CACHE BOOL "Use Qt4 even if Qt5 was found")

  # Qt5 or Qt4?
  if (NOT FORCE_QT4)
    acg_qt5 ()
  else()
    set (QT5_FOUND false)
  endif()

  # Fallback to qt4 if not found or forced
  if (NOT QT5_FOUND)
    message(STATUS "Using QT4 for CoMISo")
    acg_qt4 (4.7.0)
  else ()
    message(STATUS "Using QT5 for CoMISo")
  endif ()

35
  # QT settings in CoMISo
36
  if( QT4_FOUND)
37
    add_definitions (-DQT4_FOUND)
38 39
    set (COMISO_QT_CONFIG_FILE_SETTINGS "#define COMISO_QT_AVAILABLE 1" )
  elseif( QT5_FOUND)
40
    add_definitions (-DQT5_FOUND)
41
    set (COMISO_QT_CONFIG_FILE_SETTINGS "#define COMISO_QT_AVAILABLE 1" )
42
  else()
43 44
    set (COMISO_QT_CONFIG_FILE_SETTINGS "#define COMISO_QT_AVAILABLE 0" )
  endif()
45 46
  
endif( WANT_COMISO_QT )
47 48 49 50 51

acg_get_version ()

include (ACGOutput)

52
set(COMISO_INCLUDE_DIRECTORIES "")
53 54
set(COMISO_LINK_DIRECTORIES "")
set(COMISO_LINK_LIBRARIES "")
55

Jan Möbius's avatar
Jan Möbius committed
56
FIND_PACKAGE( Boost 1.42.0 COMPONENTS system filesystem regex QUIET)
David Bommes's avatar
David Bommes committed
57 58 59
if(Boost_FOUND)
  set (COMISO_BOOST_CONFIG_FILE_SETTINGS "#define COMISO_BOOST_AVAILABLE 1" )
  list( APPEND COMISO_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIRS} )
Jan Möbius's avatar
Jan Möbius committed
60
  list( APPEND COMISO_LINK_DIRECTORIES    ${Boost_LIBRARY_DIR} )
David Bommes's avatar
David Bommes committed
61 62 63 64 65 66 67
  list( APPEND COMISO_LINK_LIBRARIES  ${Boost_LIBRARIES} )
else()
  set (COMISO_BOOST_CONFIG_FILE_SETTINGS "#define COMISO_BOOST_AVAILABLE 0" )
  message (STATUS "Boost not found!")
endif ()


68
find_package (GMM)
69 70
if (GMM_FOUND)
  set (COMISO_GMM_CONFIG_FILE_SETTINGS "#define COMISO_GMM_AVAILABLE 1" )
71
  list( APPEND COMISO_INCLUDE_DIRECTORIES ${GMM_INCLUDE_DIR} )
72 73
else()
  set (COMISO_GMM_CONFIG_FILE_SETTINGS "#define COMISO_GMM_AVAILABLE 0" )
74 75 76
  message (FATAL_ERROR "GMM not found!")
endif ()

77 78
# We require cgal with its blas on windows
  find_package(CGAL)
David Bommes's avatar
David Bommes committed
79 80 81 82 83 84 85 86
if (CGAL_FOUND)
  set (COMISO_CGAL_CONFIG_FILE_SETTINGS "#define COMISO_CGAL_AVAILABLE 1" )
  list( APPEND COMISO_INCLUDE_DIRECTORIES ${CGAL_INCLUDE_DIR} )
  list( APPEND COMISO_LINK_DIRECTORIES   ${CGAL_LIBRARY_DIR} )
  list( APPEND COMISO_LINK_LIBRARIES  ${CGAL_LIBRARIES} )
else()
  set (COMISO_CGAL_CONFIG_FILE_SETTINGS "#define COMISO_CGAL_AVAILABLE 0" )
  message (STATUS "CGAL not found!")
87 88
endif()

David Bommes's avatar
David Bommes committed
89

90
find_package (BLAS)
91 92
if (BLAS_FOUND )
  set (COMISO_BLAS_CONFIG_FILE_SETTINGS "#define COMISO_BLAS_AVAILABLE 1" )
93 94
  
  list( APPEND COMISO_INCLUDE_DIRECTORIES ${BLAS_INCLUDE_DIRS} )
Jan Möbius's avatar
Jan Möbius committed
95
  list( APPEND COMISO_LINK_DIRECTORIES   ${BLAS_LIBRARY_DIRS} ${BLAS_LIBRARY_DIR} )
96
  list( APPEND COMISO_LINK_LIBRARIES  ${BLAS_LIBRARIES} )
97 98
else()
  set (COMISO_BLAS_CONFIG_FILE_SETTINGS "#define COMISO_BLAS_AVAILABLE 0" )
David Bommes's avatar
David Bommes committed
99
  message (STATUS "BLAS not found!")
100 101
endif ()

Mike Kremer's avatar
Mike Kremer committed
102 103 104
find_package (ADOLC)
if (ADOLC_FOUND)
  set (COMISO_ADOLC_CONFIG_FILE_SETTINGS "#define COMISO_ADOLC_AVAILABLE 1" )
105 106
  list( APPEND COMISO_INCLUDE_DIRECTORIES ${ADOLC_INCLUDE_DIR} )
  list( APPEND COMISO_LINK_DIRECTORIES   ${ADOLC_LIBRARY_DIR} )
Mike Kremer's avatar
Mike Kremer committed
107 108 109 110 111 112
  list( APPEND COMISO_LINK_LIBRARIES  ${ADOLC_LIBRARIES} )
else ()
  set (COMISO_ADOLC_CONFIG_FILE_SETTINGS "#define COMISO_ADOLC_AVAILABLE 0" )
  message (STATUS "ADOLC not found!")
endif ()

113
find_package (SUITESPARSE)
114
if (SUITESPARSE_FOUND )
115 116
  FIND_PACKAGE(LAPACK)
  
117
  set (COMISO_SUITESPARSE_CONFIG_FILE_SETTINGS "#define COMISO_SUITESPARSE_AVAILABLE 1" )
118
  
David Bommes's avatar
David Bommes committed
119
  list( APPEND COMISO_INCLUDE_DIRECTORIES ${SUITESPARSE_INCLUDE_DIRS} )
120 121
  list( APPEND COMISO_LINK_DIRECTORIES   ${SUITESPARSE_LIBRARY_DIRS} )
  list( APPEND COMISO_LINK_LIBRARIES  ${SUITESPARSE_LIBRARIES} )
122 123 124 125
else ()
  message (STATUS "SUITESPARSE not found!")
  set (COMISO_SUITESPARSE_CONFIG_FILE_SETTINGS "#define COMISO_SUITESPARSE_AVAILABLE 0" )
endif ()
David Bommes's avatar
David Bommes committed
126 127 128 129 130 131 132
# special handling, since spqr is incorrect in several distributions
if(SUITESPARSE_SPQR_VALID)
  set (COMISO_SUITESPARSE_SPQR_CONFIG_FILE_SETTINGS "#define COMISO_SUITESPARSE_SPQR_AVAILABLE 1" )
else()
  message (STATUS "SUITESPARSE SPQR seems to be invalid!")
  set (COMISO_SUITESPARSE_SPQR_CONFIG_FILE_SETTINGS "#define COMISO_SUITESPARSE_SPQR_AVAILABLE 0" )
endif()
133 134 135 136

find_package (MPI)
if (MPI_FOUND )
  set (COMISO_MPI_CONFIG_FILE_SETTINGS "#define COMISO_MPI_AVAILABLE 1" )
David Bommes's avatar
David Bommes committed
137
  list( APPEND COMISO_INCLUDE_DIRECTORIES ${MPI_INCLUDE_PATH} )
138
  list( APPEND COMISO_LINK_LIBRARIES  ${MPI_CXX_LIBRARIES} )
139 140 141 142
else ()
  message (STATUS "MPI not found!")
  set (COMISO_MPI_CONFIG_FILE_SETTINGS "#define COMISO_MPI_AVAILABLE 0" )
endif ()
143 144

find_package (PETSC)
145 146
if (PETSC_FOUND AND MPI_FOUND)
  set (COMISO_PETSC_CONFIG_FILE_SETTINGS "#define COMISO_PETSC_AVAILABLE 1" )
David Bommes's avatar
David Bommes committed
147
  list( APPEND COMISO_INCLUDE_DIRECTORIES ${PETSC_INCLUDE_DIRS} )
148
  list( APPEND COMISO_LINK_LIBRARIES  ${PETSC_LIBRARY} )
149
else ()
150
  message (STATUS "PETSC or MPI not found!")
151 152
  set (COMISO_PETSC_CONFIG_FILE_SETTINGS "#define COMISO_PETSC_AVAILABLE 0" )
endif ()
153

154

155 156 157
find_package (TAO)
if (TAO_FOUND AND PETSC_FOUND AND MPI_FOUND)
  set (COMISO_TAO_CONFIG_FILE_SETTINGS "#define COMISO_TAO_AVAILABLE 1" )
David Bommes's avatar
David Bommes committed
158
  list( APPEND COMISO_INCLUDE_DIRECTORIES ${TAO_INCLUDE_DIRS} )
159 160
  list( APPEND COMISO_LINK_DIRECTORIES ${TAO_LIBRARY_DIR} )
  list( APPEND COMISO_LINK_LIBRARIES  ${TAO_LIBRARY} )
161
else ()
162
  message (STATUS "TAO or PETSC or MPI not found!")
163
  set (COMISO_TAO_CONFIG_FILE_SETTINGS "#define COMISO_TAO_AVAILABLE 0" )
164 165
endif ()

David Bommes's avatar
David Bommes committed
166 167 168 169 170 171 172 173 174 175 176 177
find_package (METIS)
if (METIS_FOUND )
  set (COMISO_METIS_CONFIG_FILE_SETTINGS "#define COMISO_METIS_AVAILABLE 1" )
  
  list( APPEND COMISO_INCLUDE_DIRECTORIES ${METIS_INCLUDE_DIRS} )
  list( APPEND COMISO_LINK_DIRECTORIES   ${METIS_LIBRARY_DIRS} )
  list( APPEND COMISO_LINK_LIBRARIES  ${METIS_LIBRARIES} )
else()
  set (COMISO_METIS_CONFIG_FILE_SETTINGS "#define COMISO_METIS_AVAILABLE 0" )
  message (STATUS "METIS not found!")
endif ()

David Bommes's avatar
David Bommes committed
178 179 180 181
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} )
182
  list( APPEND COMISO_LINK_LIBRARIES ${MUMPS_LIBRARY} )
David Bommes's avatar
David Bommes committed
183 184 185 186 187
else ()
  message (STATUS "MUMPS not found!")
  set (COMISO_MUMPS_CONFIG_FILE_SETTINGS "#define COMISO_MUMPS_AVAILABLE 0" )
endif ()

188
find_package (IPOPT)
189
if (IPOPT_FOUND)
190
  set (COMISO_IPOPT_CONFIG_FILE_SETTINGS "#define COMISO_IPOPT_AVAILABLE 1" )
191
  list( APPEND COMISO_INCLUDE_DIRECTORIES ${IPOPT_INCLUDE_DIR} )
192 193
  list( APPEND COMISO_LINK_DIRECTORIES ${IPOPT_LIBRARY_DIR} )
  list( APPEND COMISO_LINK_LIBRARIES ${IPOPT_LIBRARY} )
David Bommes's avatar
David Bommes committed
194
  if ( IPOPT_HSL_LIBRARY_DIR )
Jan Möbius's avatar
Jan Möbius committed
195 196 197 198
	set (COMISO_HSL_CONFIG_FILE_SETTINGS "#define COMISO_HSL_AVAILABLE 1" )
  else ()
	set (COMISO_HSL_CONFIG_FILE_SETTINGS "#define COMISO_HSL_AVAILABLE 0" )
  endif()
199
else ()
David Bommes's avatar
David Bommes committed
200
  message (STATUS "IPOPT or dependency not found!")
201
  set (COMISO_IPOPT_CONFIG_FILE_SETTINGS "#define COMISO_IPOPT_AVAILABLE 0" )
Jan Möbius's avatar
Jan Möbius committed
202
  set (COMISO_HSL_CONFIG_FILE_SETTINGS "#define COMISO_HSL_AVAILABLE 0" )
203 204
endif ()

David Bommes's avatar
David Bommes committed
205 206 207 208
find_package (EIGEN3)
if (EIGEN3_FOUND )
  set (COMISO_EIGEN3_CONFIG_FILE_SETTINGS "#define COMISO_EIGEN3_AVAILABLE 1" )
  list( APPEND COMISO_INCLUDE_DIRECTORIES ${EIGEN3_INCLUDE_DIR} )
David Bommes's avatar
David Bommes committed
209
else ()
David Bommes's avatar
David Bommes committed
210 211
  message (STATUS "EIGEN3 not found!")
  set (COMISO_EIGEN3_CONFIG_FILE_SETTINGS "#define COMISO_EIGEN3_AVAILABLE 0" )
David Bommes's avatar
David Bommes committed
212 213
endif ()

David Bommes's avatar
David Bommes committed
214 215 216 217 218 219 220 221 222
find_package (DCO)
if (DCO_FOUND )
  set (COMISO_DCO_CONFIG_FILE_SETTINGS "#define COMISO_DCO_AVAILABLE 1" )
  list( APPEND COMISO_INCLUDE_DIRECTORIES ${DCO_INCLUDE_DIR} )
else ()
  message (STATUS "DCO not found!")
  set (COMISO_DCO_CONFIG_FILE_SETTINGS "#define COMISO_DCO_AVAILABLE 0" )
endif ()

David Bommes's avatar
David Bommes committed
223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272
find_package (CBC)
if (CBC_FOUND )
  set (COMISO_CBC_CONFIG_FILE_SETTINGS "#define COMISO_CBC_AVAILABLE 1" )
  list( APPEND COMISO_INCLUDE_DIRECTORIES ${CBC_INCLUDE_DIRS} )
  list( APPEND COMISO_LINK_LIBRARIES  ${CBC_LIBRARIES} )
else ()
  message (STATUS "CBC not found!")
  set (COMISO_CBC_CONFIG_FILE_SETTINGS "#define COMISO_CBC_AVAILABLE 0" )
endif ()

find_package (CLP)
if (CLP_FOUND )
  set (COMISO_CLP_CONFIG_FILE_SETTINGS "#define COMISO_CLP_AVAILABLE 1" )
  list( APPEND COMISO_INCLUDE_DIRECTORIES ${CLP_INCLUDE_DIRS} )
  list( APPEND COMISO_LINK_LIBRARIES  ${CLP_LIBRARIES} )
else ()
  message (STATUS "CLP not found!")
  set (COMISO_CLP_CONFIG_FILE_SETTINGS "#define COMISO_CLP_AVAILABLE 0" )
endif ()

find_package (CGL)
if (CGL_FOUND )
  set (COMISO_CGL_CONFIG_FILE_SETTINGS "#define COMISO_CGL_AVAILABLE 1" )
  list( APPEND COMISO_INCLUDE_DIRECTORIES ${CGL_INCLUDE_DIRS} )
  list( APPEND COMISO_LINK_LIBRARIES  ${CGL_LIBRARIES} )
else ()
  message (STATUS "CGL not found!")
  set (COMISO_CGL_CONFIG_FILE_SETTINGS "#define COMISO_CGL_AVAILABLE 0" )
endif ()

find_package (COINUTILS)
if (COINUTILS_FOUND )
  set (COMISO_COINUTILS_CONFIG_FILE_SETTINGS "#define COMISO_COINUTILS_AVAILABLE 1" )
  list( APPEND COMISO_INCLUDE_DIRECTORIES ${COINUTILS_INCLUDE_DIRS} )
  list( APPEND COMISO_LINK_LIBRARIES  ${COINUTILS_LIBRARIES} )
else ()
  message (STATUS "COINUTILS not found!")
  set (COMISO_COINUTILS_CONFIG_FILE_SETTINGS "#define COMISO_COINUTILS_AVAILABLE 0" )
endif ()

find_package (OSI)
if (OSI_FOUND )
  set (COMISO_OSI_CONFIG_FILE_SETTINGS "#define COMISO_OSI_AVAILABLE 1" )
  list( APPEND COMISO_INCLUDE_DIRECTORIES ${OSI_INCLUDE_DIRS} )
  list( APPEND COMISO_LINK_LIBRARIES  ${OSI_LIBRARIES} )
else ()
  message (STATUS "OSI not found!")
  set (COMISO_OSI_CONFIG_FILE_SETTINGS "#define COMISO_OSI_AVAILABLE 0" )
endif ()

David Bommes's avatar
David Bommes committed
273 274 275 276
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} )
277 278 279 280
  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} )
David Bommes's avatar
David Bommes committed
281 282 283 284 285
else ()
  message (STATUS "TAUCS not found!")
  set (COMISO_TAUCS_CONFIG_FILE_SETTINGS "#define COMISO_TAUCS_AVAILABLE 0" )
endif ()

David Bommes's avatar
David Bommes committed
286 287 288
find_package (GUROBI)
if (GUROBI_FOUND )
  set (COMISO_GUROBI_CONFIG_FILE_SETTINGS "#define COMISO_GUROBI_AVAILABLE 1" )
David Bommes's avatar
David Bommes committed
289 290 291
  list( APPEND COMISO_INCLUDE_DIRECTORIES ${GUROBI_INCLUDE_DIRS} )
#  list( APPEND COMISO_LINK_DIRECTORIES    ${GUROBI_LIBRARY_DIR} )
  list( APPEND COMISO_LINK_LIBRARIES  ${GUROBI_LIBRARIES} )
David Bommes's avatar
David Bommes committed
292 293 294 295 296
else ()
  message (STATUS "GUROBI not found!")
  set (COMISO_GUROBI_CONFIG_FILE_SETTINGS "#define COMISO_GUROBI_AVAILABLE 0" )
endif ()

David Bommes's avatar
David Bommes committed
297 298 299 300 301 302 303 304 305 306 307
find_package (ARPACK)
if (ARPACK_FOUND )
  set (COMISO_ARPACK_CONFIG_FILE_SETTINGS "#define COMISO_ARPACK_AVAILABLE 1" )
  list( APPEND COMISO_INCLUDE_DIRECTORIES ${ARPACK_INCLUDE_DIR} )
#  list( APPEND COMISO_LINK_DIRECTORIES    ${ARPACK_LIBRARY_DIR} )
  list( APPEND COMISO_LINK_LIBRARIES  ${ARPACK_LIBRARY} )
else ()
  message (STATUS "ARPACK not found!")
  set (COMISO_ARPACK_CONFIG_FILE_SETTINGS "#define COMISO_ARPACK_AVAILABLE 0" )
endif ()

David Bommes's avatar
David Bommes committed
308 309 310 311 312
find_package (CPLEX)
if (CPLEX_FOUND )
  set (COMISO_CPLEX_CONFIG_FILE_SETTINGS "#define COMISO_CPLEX_AVAILABLE 1" )
  list( APPEND COMISO_INCLUDE_DIRECTORIES ${CPLEX_INCLUDE_DIRS} )
  list( APPEND COMISO_LINK_LIBRARIES  ${CPLEX_LIBRARIES} )
313 314 315
  
  #enable c++ support
   add_definitions(-DIL_STD)
David Bommes's avatar
David Bommes committed
316 317
else ()
  message (STATUS "CPLEX not found!")
318
  set (COMISO_CPLEX_CONFIG_FILE_SETTINGS "#define COMISO_CPLEX_AVAILABLE 0" )
David Bommes's avatar
David Bommes committed
319 320
endif ()

321 322 323
include_directories (
  ..
  ${CMAKE_CURRENT_SOURCE_DIR}
324
  ${CMAKE_CURRENT_SOURCE_DIR}/../
325
  ${CMAKE_CURRENT_BINARY_DIR}
326
  ${COMISO_INCLUDE_DIRECTORIES}
327 328 329 330 331
)

# generate dllexport macros on windows
if (WIN32)
  add_definitions(-DCOMISODLL)
Jan Möbius's avatar
Jan Möbius committed
332
  add_definitions(-D_SCL_SECURE_NO_DEPRECATE)
333 334 335 336
endif ()


link_directories (
337
  ${COMISO_LINK_DIRECTORIES}
338 339 340 341 342
)

# source code directories
set (directories 
  .
343 344
  Solver
  NSolver
David Bommes's avatar
David Bommes committed
345
  EigenSolver
346 347 348 349 350 351 352 353 354 355 356 357 358 359
  Config
  Utils
  QtWidgets
)

if (WIN32)
  add_definitions(
      -D_USE_MATH_DEFINES -DNOMINMAX
  )
endif ()

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

Hans-Christian Ebke's avatar
Hans-Christian Ebke committed
361
if( QT4_FOUND OR QT5_FOUND )
362
acg_append_files (ui "*.ui" ${directories})
363
endif()
364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382


macro (of_list_filter _list)
  if (WIN32)
   foreach (_element ${${_list}})
     if (_element MATCHES "gnuplot_i\\.(cc|hh)$")
       list (REMOVE_ITEM ${_list} ${_element})
     endif ()
   endforeach ()
  endif ()
endmacro ()

of_list_filter  ( headers )
of_list_filter  ( sources )


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

Hans-Christian Ebke's avatar
Hans-Christian Ebke committed
383
if( QT4_FOUND )
384 385 386
# genereate uic and moc targets
acg_qt4_autouic (uic_targets ${ui})
acg_qt4_automoc (moc_targets ${headers})
387
list (APPEND COMISO_LINK_LIBRARIES ${QT_LIBRARIES})
388
elseif ( QT5_FOUND )
Hans-Christian Ebke's avatar
Hans-Christian Ebke committed
389 390 391 392
# genereate uic and moc targets
acg_qt5_autouic (uic_targets ${ui})
acg_qt5_automoc (moc_targets ${headers})
list (APPEND COMISO_LINK_LIBRARIES ${QT_LIBRARIES})
Henrik Zimmer's avatar
Henrik Zimmer committed
393
endif()
394

395 396 397 398
acg_add_library (CoMISo SHARED ${uic_targets} ${sources} ${headers} ${moc_targets})

if (NOT APPLE)
	target_link_libraries (CoMISo 
399
	  ${COMISO_LINK_LIBRARIES}
400 401 402
	)
else(NOT APPLE)
	target_link_libraries (CoMISo
403
	  ${COMISO_LINK_LIBRARIES}
404 405 406 407 408 409
	)
endif(NOT APPLE)

# display results
acg_print_configure_header (COMISO "CoMISo")

410
# write config file
Jan Möbius's avatar
Jan Möbius committed
411 412
configure_file ("${CMAKE_CURRENT_SOURCE_DIR}/Config/config.hh.in"
     "${CMAKE_CURRENT_SOURCE_DIR}/Config/config.hh" @ONLY IMMEDIATE)
413 414 415 416 417 418 419
     
     
     
#######################################################################
# Configure the examples last to be sure, that all configure files
# of the library are already there
#######################################################################
David Bommes's avatar
David Bommes committed
420

421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439
if( EXISTS "${CMAKE_SOURCE_DIR}/Examples/factored_solver/CMakeLists.txt" )
	add_subdirectory (Examples/factored_solver)
endif()

if( EXISTS "${CMAKE_SOURCE_DIR}/Examples/quadratic_solver/CMakeLists.txt" )
	add_subdirectory (Examples/quadratic_solver)
endif()
if( EXISTS "${CMAKE_SOURCE_DIR}/Examples/test2/CMakeLists.txt" )
	add_subdirectory (Examples/test2)
endif()
if( EXISTS "${CMAKE_SOURCE_DIR}/Examples/small_quadratic_example/CMakeLists.txt" )
	add_subdirectory (Examples/small_quadratic_example)
endif()
if( EXISTS "${CMAKE_SOURCE_DIR}/Examples/small_factored_example/CMakeLists.txt" )
	add_subdirectory (Examples/small_factored_example)
endif()
if( EXISTS "${CMAKE_SOURCE_DIR}/Examples/super_sparse_matrix/CMakeLists.txt" )
	add_subdirectory (Examples/super_sparse_matrix)
endif()
David Bommes's avatar
David Bommes committed
440 441 442
if( EXISTS "${CMAKE_SOURCE_DIR}/Examples/eigen_solver/CMakeLists.txt" )
	add_subdirectory (Examples/eigen_solver)
endif()
David Bommes's avatar
David Bommes committed
443 444 445
if( EXISTS "${CMAKE_SOURCE_DIR}/Examples/small_nsolver/CMakeLists.txt" )
	add_subdirectory (Examples/small_nsolver)
endif()
446 447 448
if( EXISTS "${CMAKE_SOURCE_DIR}/Examples/small_eigenproblem/CMakeLists.txt" )
	add_subdirectory (Examples/small_eigenproblem)
endif()
449 450 451
if( EXISTS "${CMAKE_SOURCE_DIR}/Examples/small_miqp/CMakeLists.txt" )
	add_subdirectory (Examples/small_miqp)
endif()
David Bommes's avatar
David Bommes committed
452 453 454
if( EXISTS "${CMAKE_SOURCE_DIR}/Examples/small_nleast_squares/CMakeLists.txt" )
	add_subdirectory (Examples/small_nleast_squares)
endif()
455 456 457
if( EXISTS "${CMAKE_SOURCE_DIR}/Examples/small_sparseqr/CMakeLists.txt" )
	add_subdirectory (Examples/small_sparseqr)
endif()
458 459 460
if( EXISTS "${CMAKE_SOURCE_DIR}/Examples/small_quadratic_resolve_example/CMakeLists.txt" )
	add_subdirectory (Examples/small_quadratic_resolve_example)
endif()
461 462 463
if( EXISTS "${CMAKE_SOURCE_DIR}/Examples/small_cplex_soc/CMakeLists.txt" )
	add_subdirectory (Examples/small_cplex_soc)
endif()
David Bommes's avatar
David Bommes committed
464 465 466
if( EXISTS "${CMAKE_SOURCE_DIR}/Examples/small_adolc/CMakeLists.txt" )
	add_subdirectory (Examples/small_adolc)
endif()
David Bommes's avatar
David Bommes committed
467 468 469
if( EXISTS "${CMAKE_SOURCE_DIR}/Examples/small_dco/CMakeLists.txt" )
	add_subdirectory (Examples/small_dco)
endif()
David Bommes's avatar
David Bommes committed
470 471 472
if( EXISTS "${CMAKE_SOURCE_DIR}/Examples/vector1_adolc/CMakeLists.txt" )
	add_subdirectory (Examples/vector1_adolc)
endif()
473
if( EXISTS "${CMAKE_SOURCE_DIR}/Examples/small_linear_problem/CMakeLists.txt" )
David Bommes's avatar
David Bommes committed
474 475
	add_subdirectory (Examples/small_linear_problem)
endif()
476 477
if( EXISTS "${CMAKE_SOURCE_DIR}/Examples/crossfield3d/CMakeLists.txt" )
	add_subdirectory (Examples/crossfield3d)
478
endif()
David Bommes's avatar
David Bommes committed
479 480 481 482 483 484 485
if( EXISTS "${CMAKE_SOURCE_DIR}/Examples/crossfield3d/CMakeLists.txt" )
	add_subdirectory (Examples/crossfield3d_dco)
endif()
if( EXISTS "${CMAKE_SOURCE_DIR}/Examples/small_finite_element/CMakeLists.txt" )
	add_subdirectory (Examples/small_finite_element)
endif()

David Bommes's avatar
David Bommes committed
486