|
| 1 | +cmake_minimum_required(VERSION 3.9) |
| 2 | + |
| 3 | +# version number is taken from SCIP |
| 4 | +project(SCIPBaseSuite) |
| 5 | + |
| 6 | +if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") |
| 7 | + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-psabi") |
| 8 | + # require at least gcc 5 |
| 9 | + if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5) |
| 10 | + message(WARNING "GCC version not supported, should be at least 5!") |
| 11 | + endif() |
| 12 | +endif() |
| 13 | + |
| 14 | +option(AUTOBUILD "find and use dependencies on availability (ignores IPOPT, ZLIB, GMP, READLINE, flags)" OFF) |
| 15 | +set(AUTOBUILD_MSG "\nIf you have troubles configuring, you can consider setting AUTOBUILD=ON to try and find optional packages on availability.") |
| 16 | +option(NO_EXTERNAL_CODE "should everything be disabled except the bare minimum necessary for SCIP and SoPLEX" OFF) |
| 17 | +option(SOPLEX "should SOPLEX be included" ON) |
| 18 | +option(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS "Export all symbols into the DLL" OFF) |
| 19 | +set(ZIMPL OFF) |
| 20 | + |
| 21 | +if(NOT NO_EXTERNAL_CODE) |
| 22 | + option(AUTOBUILD "find and use dependencies on availability (ignores IPOPT, ZLIB, GMP, READLINE, flags)" OFF) |
| 23 | + option(GMP "should GMP be linked" ON) |
| 24 | + option(BOOST "Use Boost (required to build the binary). Disable if you only want to build libsoplex." ON) |
| 25 | +else() |
| 26 | + option(GMP "should GMP be linked" OFF) |
| 27 | + option(ZLIB "should zlib be linked" OFF) |
| 28 | + option(READLINE "should readline be linked" OFF) |
| 29 | + option(IPOPT "should ipopt be linked" OFF) |
| 30 | + option(BOOST "Use Boost (required to build the binary). Disable if you only want to build libsoplex." OFF) |
| 31 | + option(QUADMATH "should quadmath library be used" OFF) |
| 32 | + option(MPFR "Use MPFR" OFF) |
| 33 | + set(SYM none CACHE STRING "options for symmetry computation") |
| 34 | +endif() |
| 35 | + |
| 36 | +if(AUTOBUILD) |
| 37 | + message(WARNING "You are using the automatic build option to find and use dependencies automatically. The following flags are ignored: ZLIB, GMP, READLINE.") |
| 38 | +endif() # AUTOBUILD |
| 39 | + |
| 40 | +include_directories( |
| 41 | + soplex/src |
| 42 | + scip/src |
| 43 | + ) |
| 44 | + |
| 45 | +# make 'Release' the default build type |
| 46 | +if(NOT CMAKE_BUILD_TYPE) |
| 47 | + set(CMAKE_BUILD_TYPE Release) |
| 48 | +endif() |
| 49 | + |
| 50 | +# path to e.g. findGMP module |
| 51 | +list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/Modules) |
| 52 | +list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/scip/cmake/Modules) |
| 53 | +list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/soplex/cmake/Modules) |
| 54 | + |
| 55 | +add_subdirectory(soplex) |
| 56 | +set(SOPLEX_DIR ${CMAKE_BINARY_DIR}) |
| 57 | + |
| 58 | +add_subdirectory(scip) |
| 59 | + |
| 60 | +set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/scip/LICENSE") |
| 61 | +set(CPACK_PACKAGE_VERSION_MAJOR "${SCIPBaseSuite_VERSION_MAJOR}") |
| 62 | +set(CPACK_PACKAGE_VERSION_MINOR "${SCIPBaseSuite_VERSION_MINOR}") |
| 63 | +set(CPACK_PACKAGE_VERSION_PATCH "${SCIPBaseSuite_VERSION_PATCH}") |
| 64 | +set(CPACK_PACKAGE_VENDOR "Zuse Institute Berlin") |
| 65 | +set(CPACK_NSIS_MODIFY_PATH ON) |
| 66 | +set(CPACK_PACKAGE_EXECUTABLES scip;SCIP soplex;SoPlex) |
| 67 | +set(CPACK_PACKAGE_CONTACT "SCIP <scip@zib.de>") |
| 68 | +set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Toolbox for generating and solving mixed integer linear (MIP) and nonlinear programs (MINLP) and constraint integer programs (CIP)") |
| 69 | +set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://scipopt.org") |
| 70 | +# autogenerate dependency information |
| 71 | +set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) |
| 72 | +set(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS ON) |
| 73 | +set(CPACK_DEBIAN_ENABLE_COMPONENT_DEPENDS ON) |
| 74 | +include(CPack) |
| 75 | +enable_testing() |
| 76 | + |
| 77 | +if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}) |
| 78 | + include(FeatureSummary) |
| 79 | + feature_summary(WHAT ALL) |
| 80 | +endif() |
| 81 | + |
0 commit comments