diff --git a/CMakeLists.txt b/CMakeLists.txt index b4b89c5e0e7bcbb06b2b7349b557373f60c9f650..89f8512c41b8572bf6caed7e2a21249aecf989a6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,7 +24,7 @@ if( WANT_COMISO_QT ) else() set (COMISO_QT_CONFIG_FILE_SETTINGS "#define COMISO_QT_AVAILABLE 0" ) endif() - + endif( WANT_COMISO_QT ) acg_get_version () @@ -79,7 +79,7 @@ set(CMAKE_FIND_LIBRARY_PREFIXES lib "") #Our blas librariy is called libblas.lib 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} ${BLAS_LIBRARY_DIR} ) list( APPEND COMISO_LINK_LIBRARIES ${BLAS_LIBRARIES} ) @@ -103,9 +103,9 @@ endif () find_package (SUITESPARSE) if (SUITESPARSE_FOUND ) list (APPEND NEED_LAPACK "SUITESPARSE") - + 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} ) @@ -174,7 +174,7 @@ endif () 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} ) @@ -200,9 +200,9 @@ if (IPOPT_FOUND) list( APPEND COMISO_LINK_DIRECTORIES ${IPOPT_LIBRARY_DIRS} ) list( APPEND COMISO_LINK_LIBRARIES ${IPOPT_LIBRARIES} ) if ( IPOPT_HSL_LIBRARY_DIR ) - set (COMISO_HSL_CONFIG_FILE_SETTINGS "#define COMISO_HSL_AVAILABLE 1" ) + set (COMISO_HSL_CONFIG_FILE_SETTINGS "#define COMISO_HSL_AVAILABLE 1" ) else () - set (COMISO_HSL_CONFIG_FILE_SETTINGS "#define COMISO_HSL_AVAILABLE 0" ) + set (COMISO_HSL_CONFIG_FILE_SETTINGS "#define COMISO_HSL_AVAILABLE 0" ) endif() else () message (STATUS "IPOPT or dependency not found!") @@ -285,7 +285,7 @@ if (TAUCS_FOUND AND NOT SUPRESS_TAUCS) set (COMISO_TAUCS_CONFIG_FILE_SETTINGS "#define COMISO_TAUCS_AVAILABLE 1" ) list( APPEND COMISO_INCLUDE_DIRECTORIES ${TAUCS_INCLUDE_DIR} ) list( APPEND COMISO_LINK_LIBRARIES ${TAUCS_LIBRARY} ) - + else () message (STATUS "TAUCS not found!") set (COMISO_TAUCS_CONFIG_FILE_SETTINGS "#define COMISO_TAUCS_AVAILABLE 0" ) @@ -330,7 +330,7 @@ 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} ) - + #enable c++ support add_definitions(-DIL_STD) else () @@ -353,7 +353,7 @@ endif(NEED_LAPACK AND NOT SUITESPARSE_FOUND) set(CMAKE_FIND_LIBRARY_PREFIXES "${TMP_CMAKE_FIND_LIBRARY_PREFIXES}") # source code directories -set (directories +set (directories . Base/Code Base/Debug @@ -395,7 +395,7 @@ if ( QT5_FOUND ) # Enable automoc set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOUIC ON) - + list (APPEND COMISO_LINK_LIBRARIES ${QT_LIBRARIES}) endif() @@ -403,7 +403,7 @@ endif() # Then link directories is set as target property below. link_directories(${COMISO_LINK_DIRECTORIES}) -acg_add_library (CoMISo SHARED ${ui} ${sources} ${headers} ) +acg_add_library (CoMISo SHARED ${ui} ${sources} ${headers} ) add_library(CoMISo::CoMISo ALIAS CoMISo) target_include_directories(CoMISo @@ -486,9 +486,9 @@ acg_print_configure_header (COMISO "CoMISo") # write config file configure_file ("${CMAKE_CURRENT_SOURCE_DIR}/Config/config.hh.in" "CoMISo/Config/config.hh" @ONLY IMMEDIATE) - - - + + + ####################################################################### # Configure the examples last to be sure, that all configure files # of the library are already there @@ -498,102 +498,101 @@ set (COMISO_BUILD_EXAMPLES TRUE CACHE BOOL "Build CoMISo Examples") if (COMISO_BUILD_EXAMPLES ) if( EXISTS "${CMAKE_SOURCE_DIR}/Examples/factored_solver/CMakeLists.txt" ) - add_subdirectory (Examples/factored_solver) + add_subdirectory (Examples/factored_solver) endif() if( EXISTS "${CMAKE_SOURCE_DIR}/Examples/quadratic_solver/CMakeLists.txt" ) - add_subdirectory (Examples/quadratic_solver) + add_subdirectory (Examples/quadratic_solver) endif() if( EXISTS "${CMAKE_SOURCE_DIR}/Examples/test2/CMakeLists.txt" ) - add_subdirectory (Examples/test2) + add_subdirectory (Examples/test2) endif() if( EXISTS "${CMAKE_SOURCE_DIR}/Examples/small_quadratic_example/CMakeLists.txt" ) - add_subdirectory (Examples/small_quadratic_example) + add_subdirectory (Examples/small_quadratic_example) endif() if( EXISTS "${CMAKE_SOURCE_DIR}/Examples/small_factored_example/CMakeLists.txt" ) - add_subdirectory (Examples/small_factored_example) + add_subdirectory (Examples/small_factored_example) endif() if( EXISTS "${CMAKE_SOURCE_DIR}/Examples/super_sparse_matrix/CMakeLists.txt" ) - add_subdirectory (Examples/super_sparse_matrix) + add_subdirectory (Examples/super_sparse_matrix) endif() if( EXISTS "${CMAKE_SOURCE_DIR}/Examples/eigen_solver/CMakeLists.txt" ) - add_subdirectory (Examples/eigen_solver) + add_subdirectory (Examples/eigen_solver) endif() if( EXISTS "${CMAKE_SOURCE_DIR}/Examples/small_nsolver/CMakeLists.txt" ) - add_subdirectory (Examples/small_nsolver) + add_subdirectory (Examples/small_nsolver) endif() if( EXISTS "${CMAKE_SOURCE_DIR}/Examples/small_eigenproblem/CMakeLists.txt" ) - add_subdirectory (Examples/small_eigenproblem) + add_subdirectory (Examples/small_eigenproblem) endif() if( EXISTS "${CMAKE_SOURCE_DIR}/Examples/small_miqp/CMakeLists.txt" ) - add_subdirectory (Examples/small_miqp) + add_subdirectory (Examples/small_miqp) endif() if( EXISTS "${CMAKE_SOURCE_DIR}/Examples/small_nleast_squares/CMakeLists.txt" ) - add_subdirectory (Examples/small_nleast_squares) + add_subdirectory (Examples/small_nleast_squares) endif() if( EXISTS "${CMAKE_SOURCE_DIR}/Examples/small_sparseqr/CMakeLists.txt" ) - add_subdirectory (Examples/small_sparseqr) + add_subdirectory (Examples/small_sparseqr) endif() if( EXISTS "${CMAKE_SOURCE_DIR}/Examples/small_quadratic_resolve_example/CMakeLists.txt" ) - add_subdirectory (Examples/small_quadratic_resolve_example) + add_subdirectory (Examples/small_quadratic_resolve_example) endif() if( EXISTS "${CMAKE_SOURCE_DIR}/Examples/small_cplex_soc/CMakeLists.txt" ) - add_subdirectory (Examples/small_cplex_soc) + add_subdirectory (Examples/small_cplex_soc) endif() if( EXISTS "${CMAKE_SOURCE_DIR}/Examples/small_adolc/CMakeLists.txt" ) - add_subdirectory (Examples/small_adolc) + add_subdirectory (Examples/small_adolc) endif() if( EXISTS "${CMAKE_SOURCE_DIR}/Examples/small_dco/CMakeLists.txt" ) - add_subdirectory (Examples/small_dco) + add_subdirectory (Examples/small_dco) endif() if( EXISTS "${CMAKE_SOURCE_DIR}/Examples/vector1_adolc/CMakeLists.txt" ) - add_subdirectory (Examples/vector1_adolc) + add_subdirectory (Examples/vector1_adolc) endif() if( EXISTS "${CMAKE_SOURCE_DIR}/Examples/small_linear_problem/CMakeLists.txt" ) - add_subdirectory (Examples/small_linear_problem) + add_subdirectory (Examples/small_linear_problem) endif() if( EXISTS "${CMAKE_SOURCE_DIR}/Examples/crossfield3d/CMakeLists.txt" ) - add_subdirectory (Examples/crossfield3d) + add_subdirectory (Examples/crossfield3d) endif() if( EXISTS "${CMAKE_SOURCE_DIR}/Examples/crossfield3d/CMakeLists.txt" ) - add_subdirectory (Examples/crossfield3d_dco) + add_subdirectory (Examples/crossfield3d_dco) endif() if( EXISTS "${CMAKE_SOURCE_DIR}/Examples/small_finite_element/CMakeLists.txt" ) - add_subdirectory (Examples/small_finite_element) + add_subdirectory (Examples/small_finite_element) endif() if( EXISTS "${CMAKE_SOURCE_DIR}/Examples/small_AQP/CMakeLists.txt" ) - add_subdirectory (Examples/small_AQP) + add_subdirectory (Examples/small_AQP) endif() if( EXISTS "${CMAKE_SOURCE_DIR}/Examples/finite_element_integrability_problem/CMakeLists.txt" ) - add_subdirectory (Examples/finite_element_integrability_problem) + add_subdirectory (Examples/finite_element_integrability_problem) endif() if( EXISTS "${CMAKE_SOURCE_DIR}/Examples/small_mosek_native/CMakeLists.txt" ) - add_subdirectory (Examples/small_mosek_native) + add_subdirectory (Examples/small_mosek_native) endif() if( EXISTS "${CMAKE_SOURCE_DIR}/Examples/small_mosek_fusion_sdp/CMakeLists.txt" ) - add_subdirectory (Examples/small_mosek_fusion_sdp) + add_subdirectory (Examples/small_mosek_fusion_sdp) endif() - + endif (COMISO_BUILD_EXAMPLES ) # Only create install target, when we are building CoMISo standalone if(NOT COMISO_NO_INSTALL) + include(CMakePackageConfigHelpers) + include(GNUInstallDirs) - include(CMakePackageConfigHelpers) - include(GNUInstallDirs) - - set(INSTALL_CONFIGDIR ${CMAKE_INSTALL_LIBDIR}/cmake/CoMISo) + set(INSTALL_CONFIGDIR ${CMAKE_INSTALL_LIBDIR}/cmake/CoMISo) - write_basic_package_version_file( - CoMISoConfigVersion.cmake - VERSION ${PROJECT_VERSION} - COMPATIBILITY SameMajorVersion - ) + write_basic_package_version_file( + CoMISoConfigVersion.cmake + VERSION ${PROJECT_VERSION} + COMPATIBILITY SameMajorVersion + ) - install(FILES - "${CMAKE_CURRENT_BINARY_DIR}/CoMISoConfigVersion.cmake" - "${CMAKE_CURRENT_LIST_DIR}/cmake/CoMISoConfig.cmake" - DESTINATION ${INSTALL_CONFIGDIR}) + install(FILES + "${CMAKE_CURRENT_BINARY_DIR}/CoMISoConfigVersion.cmake" + "${CMAKE_CURRENT_LIST_DIR}/cmake/CoMISoConfig.cmake" + DESTINATION ${INSTALL_CONFIGDIR}) install(EXPORT CoMISoTargets FILE CoMISoTargets.cmake @@ -603,14 +602,14 @@ if(NOT COMISO_NO_INSTALL) # Install library install (TARGETS CoMISo EXPORT CoMISoTargets - RUNTIME DESTINATION lib + RUNTIME DESTINATION lib LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) # Install Header Files - install(DIRECTORY . + install(DIRECTORY . DESTINATION include/CoMISo - FILES_MATCHING + FILES_MATCHING PATTERN "*.hh" PATTERN "*T.cc" PATTERN "CVS" EXCLUDE @@ -625,12 +624,9 @@ if(NOT COMISO_NO_INSTALL) # Install Config File install( FILES ${CMAKE_BINARY_DIR}/CoMISo/Config/config.hh DESTINATION include/CoMISo/Config ) - - - export(EXPORT CoMISoTargets - NAMESPACE CoMISo::) - export(PACKAGE CoMISo) + export(EXPORT CoMISoTargets NAMESPACE CoMISo::) + export(PACKAGE CoMISo) endif()