|
| 1 | +set(NAME "CGL") |
| 2 | + |
| 3 | +# PTHREAD |
| 4 | +if(PTHREADS_FOUND) |
| 5 | + set(${NAME}_PTHREADS "1" CACHE INTERNAL "Use pthread") |
| 6 | +endif() |
| 7 | + |
| 8 | +set(COIN_${NAME}_CHECKLEVEL "0" CACHE INTERNAL |
| 9 | + "${NAME} check level") |
| 10 | +set(COIN_${NAME}_VERBOSITY "0" CACHE INTERNAL |
| 11 | + "${NAME} verbosity level") |
| 12 | +configure_file(config.h.cmake.in config.h) |
| 13 | +configure_file(config_cgl.h.cmake.in config_cgl.h) |
| 14 | + |
| 15 | +set(_SRCS |
| 16 | + src/CglMixedIntegerRounding/CglMixedIntegerRoundingTest.cpp |
| 17 | + src/CglMixedIntegerRounding/CglMixedIntegerRounding.cpp |
| 18 | + src/CglDuplicateRow/CglDuplicateRow.cpp |
| 19 | + src/CglCutGenerator.cpp |
| 20 | + src/CglPreProcess/CglPreProcess.cpp |
| 21 | + src/CglProbing/CglProbing.cpp |
| 22 | + src/CglProbing/CglProbingTest.cpp |
| 23 | + src/CglMixedIntegerRounding2/CglMixedIntegerRounding2.cpp |
| 24 | + src/CglMixedIntegerRounding2/CglMixedIntegerRounding2Test.cpp |
| 25 | + src/CglLandP/CglLandPUtils.cpp |
| 26 | + src/CglLandP/CglLandPTest.cpp |
| 27 | + src/CglLandP/CglLandPTabRow.cpp |
| 28 | + src/CglLandP/CglLandPSimplex.cpp |
| 29 | + src/CglLandP/CglLandPValidator.cpp |
| 30 | + src/CglLandP/CglLandPMessages.cpp |
| 31 | + src/CglLandP/CglLandP.cpp |
| 32 | + src/CglOddHole/CglOddHoleTest.cpp |
| 33 | + src/CglOddHole/CglOddHole.cpp |
| 34 | + src/CglRedSplit/CglRedSplitParam.cpp |
| 35 | + src/CglRedSplit/CglRedSplit.cpp |
| 36 | + src/CglRedSplit/CglRedSplitTest.cpp |
| 37 | + src/CglAllDifferent/CglAllDifferent.cpp |
| 38 | + src/CglKnapsackCover/CglKnapsackCoverTest.cpp |
| 39 | + src/CglKnapsackCover/CglKnapsackCover.cpp |
| 40 | + src/CglSimpleRounding/CglSimpleRoundingTest.cpp |
| 41 | + src/CglSimpleRounding/CglSimpleRounding.cpp |
| 42 | + src/CglZeroHalf/CglZeroHalfTest.cpp |
| 43 | + src/CglZeroHalf/Cgl012cut.cpp |
| 44 | + src/CglZeroHalf/CglZeroHalf.cpp |
| 45 | + src/CglRedSplit2/CglRedSplit2Test.cpp |
| 46 | + src/CglRedSplit2/CglRedSplit2Param.cpp |
| 47 | + src/CglRedSplit2/CglRedSplit2.cpp |
| 48 | + src/CglMessage.cpp |
| 49 | + src/CglStored.cpp |
| 50 | + src/CglParam.cpp |
| 51 | + src/CglResidualCapacity/CglResidualCapacity.cpp |
| 52 | + src/CglResidualCapacity/CglResidualCapacityTest.cpp |
| 53 | + src/CglTwomir/CglTwomirTest.cpp |
| 54 | + src/CglTwomir/CglTwomir.cpp |
| 55 | + src/CglFlowCover/CglFlowCoverTest.cpp |
| 56 | + src/CglFlowCover/CglFlowCover.cpp |
| 57 | + src/CglClique/CglCliqueHelper.cpp |
| 58 | + src/CglClique/CglCliqueTest.cpp |
| 59 | + src/CglClique/CglClique.cpp |
| 60 | + src/CglTreeInfo.cpp |
| 61 | + src/CglLiftAndProject/CglLiftAndProject.cpp |
| 62 | + src/CglGomory/CglGomoryTest.cpp |
| 63 | + src/CglGomory/CglGomory.cpp |
| 64 | + src/CglGMI/CglGMI.cpp |
| 65 | + src/CglGMI/CglGMIParam.cpp) |
| 66 | + |
| 67 | +set(_HDRS |
| 68 | + src/CglConfig.h |
| 69 | + src/CglMixedIntegerRounding/CglMixedIntegerRounding.hpp |
| 70 | + src/CglDuplicateRow/CglDuplicateRow.hpp |
| 71 | + src/CglStored.hpp |
| 72 | + src/CglPreProcess/CglPreProcess.hpp |
| 73 | + src/CglProbing/CglProbing.hpp |
| 74 | + src/CglMixedIntegerRounding2/CglMixedIntegerRounding2.hpp |
| 75 | + src/CglLandP/CglLandP.hpp |
| 76 | + src/CglLandP/CglLandPUtils.hpp |
| 77 | + src/CglLandP/CglLandPValidator.hpp |
| 78 | + src/CglLandP/CglLandPTabRow.hpp |
| 79 | + src/CglLandP/CglLandPMessages.hpp |
| 80 | + src/CglLandP/CglLandPSimplex.hpp |
| 81 | + src/CglOddHole/CglOddHole.hpp |
| 82 | + src/CglRedSplit/CglRedSplitParam.hpp |
| 83 | + src/CglRedSplit/CglRedSplit.hpp |
| 84 | + src/CglAllDifferent/CglAllDifferent.hpp |
| 85 | + src/CglKnapsackCover/CglKnapsackCover.hpp |
| 86 | + src/CglSimpleRounding/CglSimpleRounding.hpp |
| 87 | + src/CglMessage.hpp |
| 88 | + src/CglZeroHalf/CglZeroHalf.hpp |
| 89 | + src/CglZeroHalf/Cgl012cut.hpp |
| 90 | + src/CglRedSplit2/CglRedSplit2Param.hpp |
| 91 | + src/CglRedSplit2/CglRedSplit2.hpp |
| 92 | + src/CglCutGenerator.hpp |
| 93 | + src/CglResidualCapacity/CglResidualCapacity.hpp |
| 94 | + src/CglTwomir/CglTwomir.hpp |
| 95 | + src/CglFlowCover/CglFlowCover.hpp |
| 96 | + src/CglClique/CglClique.hpp |
| 97 | + src/CglLiftAndProject/CglLiftAndProject.hpp |
| 98 | + src/CglGomory/CglGomory.hpp |
| 99 | + src/CglGMI/CglGMIParam.hpp |
| 100 | + src/CglGMI/CglGMI.hpp |
| 101 | + src/CglParam.hpp |
| 102 | + src/CglTreeInfo.hpp) |
| 103 | + |
| 104 | +include(GNUInstallDirs) |
| 105 | + |
| 106 | +add_library(Cgl ${_SRCS} ${_HDRS}) |
| 107 | +target_include_directories(Cgl PUBLIC |
| 108 | + $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src> |
| 109 | + $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/CglClique> |
| 110 | + $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/CglDuplicateRow> |
| 111 | + $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/CglFlowCover> |
| 112 | + $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/CglGMI> |
| 113 | + $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/CglGomory> |
| 114 | + $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/CglKnapsackCover> |
| 115 | + $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/CglLandP> |
| 116 | + $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/CglMixedIntegerRounding> |
| 117 | + $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/CglMixedIntegerRounding2> |
| 118 | + $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/CglPreProcess> |
| 119 | + $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/CglProbing> |
| 120 | + $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/CglOddHole> |
| 121 | + $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/CglRedSplit> |
| 122 | + $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/CglRedSplit2> |
| 123 | + $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/CglResidualCapacity> |
| 124 | + $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/CglSimpleRounding> |
| 125 | + $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/CglTwomir> |
| 126 | + $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/CglZeroHalf> |
| 127 | + $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}> |
| 128 | + $<INSTALL_INTERFACE:include/coin>) |
| 129 | +target_compile_definitions(Cgl |
| 130 | + PUBLIC HAVE_CONFIG_H |
| 131 | + PRIVATE CGL_BUILD) |
| 132 | +if(CMAKE_VERSION VERSION_LESS "3.8.2") |
| 133 | + set_property(TARGET Cgl PROPERTY CXX_STANDARD 11) |
| 134 | + set_property(TARGET Cgl PROPERTY CXX_STANDARD_REQUIRED ON) |
| 135 | +else() |
| 136 | + target_compile_features(Cgl PUBLIC cxx_std_11) |
| 137 | +endif() |
| 138 | +if(APPLE) |
| 139 | + set_target_properties(Cgl PROPERTIES INSTALL_RPATH "@loader_path") |
| 140 | +elseif(UNIX) |
| 141 | + set_target_properties(Cgl PROPERTIES INSTALL_RPATH "$ORIGIN") |
| 142 | +endif() |
| 143 | +target_link_libraries(Cgl PUBLIC |
| 144 | + Coin::CoinUtils |
| 145 | + Coin::Osi |
| 146 | + Coin::OsiClp) |
| 147 | +set_target_properties(Cgl PROPERTIES |
| 148 | + PUBLIC_HEADER "${_HDRS};${CMAKE_CURRENT_BINARY_DIR}/config_cgl.h" |
| 149 | + VERSION ${PROJECT_VERSION} |
| 150 | + SOVERSION ${PROJECT_VERSION_MAJOR}) |
| 151 | +add_library(Coin::Cgl ALIAS Cgl) |
| 152 | + |
| 153 | +# Install |
| 154 | +install(TARGETS Cgl |
| 155 | + EXPORT ${PROJECT_NAME}Targets |
| 156 | + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/coin |
| 157 | + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} |
| 158 | + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} |
| 159 | + ) |
0 commit comments