|
| 1 | +diff --git CMakeLists.txt CMakeLists.txt |
| 2 | +index 3f7803ec..dd470d26 100644 |
| 3 | +--- CMakeLists.txt |
| 4 | ++++ CMakeLists.txt |
| 5 | +@@ -341,11 +341,24 @@ foreach (lib support kernel search int set float |
| 6 | + set(sources ${sources} ${src}) |
| 7 | + endif () |
| 8 | + endforeach () |
| 9 | +- add_library(gecode${lib} ${sources} ${${libupper}HDR}) |
| 10 | +- target_include_directories(gecode${lib} |
| 11 | +- PUBLIC ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ) |
| 12 | +- list(APPEND GECODE_INSTALL_TARGETS gecode${lib}) |
| 13 | ++ add_library(${lib} ${sources} ${${libupper}HDR}) |
| 14 | ++ # target_include_directories(${lib} |
| 15 | ++ # PUBLIC ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ) |
| 16 | ++ target_include_directories(${lib} |
| 17 | ++ PUBLIC |
| 18 | ++ $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}> |
| 19 | ++ $<BUILD_INTERFACE: ${CMAKE_CURRENT_SOURCE_DIR}> |
| 20 | ++ $<INSTALL_INTERFACE:include> |
| 21 | ++ ) |
| 22 | ++ list(APPEND GECODE_INSTALL_TARGETS ${lib}) |
| 23 | + endif () |
| 24 | ++ # Install the binaries |
| 25 | ++ install(TARGETS ${lib} EXPORT gecode-targets |
| 26 | ++ ARCHIVE DESTINATION lib |
| 27 | ++ LIBRARY DESTINATION lib |
| 28 | ++ RUNTIME DESTINATION bin |
| 29 | ++ ) |
| 30 | ++ target_compile_features(${lib} PUBLIC cxx_std_17) |
| 31 | + endforeach () |
| 32 | + |
| 33 | + option(ENABLE_CPPROFILER "Enable cpprofiler tracer mode" ON) |
| 34 | +@@ -354,45 +367,45 @@ if(ENABLE_CPPROFILER) |
| 35 | + endif() |
| 36 | + |
| 37 | + find_package(Threads) |
| 38 | +-target_link_libraries(gecodesupport ${CMAKE_THREAD_LIBS_INIT}) |
| 39 | +-target_link_libraries(gecodekernel gecodesupport) |
| 40 | +-target_link_libraries(gecodesearch gecodekernel) |
| 41 | +-target_link_libraries(gecodeint gecodekernel) |
| 42 | +-target_link_libraries(gecodeset gecodeint) |
| 43 | +-target_link_libraries(gecodefloat gecodeint) |
| 44 | +-target_link_libraries(gecodeminimodel gecodeint gecodeset gecodesearch) |
| 45 | +-target_link_libraries(gecodedriver gecodeint) |
| 46 | +-target_link_libraries(gecodeflatzinc gecodeminimodel gecodedriver) |
| 47 | ++target_link_libraries(support ${CMAKE_THREAD_LIBS_INIT}) |
| 48 | ++target_link_libraries(kernel support) |
| 49 | ++target_link_libraries(search kernel) |
| 50 | ++target_link_libraries(int kernel) |
| 51 | ++target_link_libraries(set int) |
| 52 | ++target_link_libraries(float int) |
| 53 | ++target_link_libraries(minimodel int set search) |
| 54 | ++target_link_libraries(driver int) |
| 55 | ++target_link_libraries(flatzinc minimodel driver) |
| 56 | + |
| 57 | + if (GECODE_HAS_QT) |
| 58 | + if (Qt6_FOUND) |
| 59 | +- target_link_libraries(gecodegist Qt6::Widgets Qt6::Gui Qt6::PrintSupport) |
| 60 | +- target_link_libraries(gecodeflatzinc Qt6::Core) |
| 61 | +- target_link_libraries(gecodeflatzinc gecodegist) |
| 62 | ++ target_link_libraries(gist Qt6::Widgets Qt6::Gui Qt6::PrintSupport) |
| 63 | ++ target_link_libraries(flatzinc Qt6::Core) |
| 64 | ++ target_link_libraries(flatzinc gist) |
| 65 | + elseif (Qt5_FOUND) |
| 66 | +- target_link_libraries(gecodegist Qt5::Widgets Qt5::Gui Qt5::PrintSupport) |
| 67 | +- target_link_libraries(gecodeflatzinc Qt5::Core) |
| 68 | +- target_link_libraries(gecodeflatzinc gecodegist) |
| 69 | ++ target_link_libraries(gist Qt5::Widgets Qt5::Gui Qt5::PrintSupport) |
| 70 | ++ target_link_libraries(flatzinc Qt5::Core) |
| 71 | ++ target_link_libraries(flatzinc gist) |
| 72 | + else() |
| 73 | +- target_link_libraries(gecodegist ${QT_LIBRARIES}) |
| 74 | +- target_link_libraries(gecodeflatzinc gecodegist ${QT_LIBRARIES}) |
| 75 | ++ target_link_libraries(gist ${QT_LIBRARIES}) |
| 76 | ++ target_link_libraries(flatzinc gist ${QT_LIBRARIES}) |
| 77 | + endif() |
| 78 | + endif () |
| 79 | + |
| 80 | + if (FLOATSRC) |
| 81 | +- target_link_libraries(gecodefloat gecodekernel) |
| 82 | +- target_link_libraries(gecodeminimodel gecodefloat) |
| 83 | ++ target_link_libraries(float kernel) |
| 84 | ++ target_link_libraries(minimodel float) |
| 85 | + if (MPFR_FOUND) |
| 86 | +- target_link_libraries(gecodefloat ${MPFR_LIBRARIES}) |
| 87 | +- target_include_directories(gecodefloat PRIVATE ${MPFR_INCLUDES}) |
| 88 | ++ target_link_libraries(float ${MPFR_LIBRARIES}) |
| 89 | ++ target_include_directories(float PRIVATE ${MPFR_INCLUDES}) |
| 90 | + endif () |
| 91 | + endif () |
| 92 | + |
| 93 | + add_executable(gecode-test EXCLUDE_FROM_ALL ${TESTSRC} ${TESTHDR}) |
| 94 | +-target_link_libraries(gecode-test gecodeflatzinc gecodeminimodel) |
| 95 | ++target_link_libraries(gecode-test flatzinc minimodel) |
| 96 | + |
| 97 | + add_executable(fzn-gecode ${FLATZINCEXESRC}) |
| 98 | +-target_link_libraries(fzn-gecode gecodeflatzinc gecodeminimodel gecodedriver) |
| 99 | ++target_link_libraries(fzn-gecode flatzinc minimodel driver) |
| 100 | + list(APPEND GECODE_INSTALL_TARGETS fzn-gecode) |
| 101 | + |
| 102 | + set(prefix ${CMAKE_INSTALL_PREFIX}) |
| 103 | +@@ -487,3 +500,18 @@ if (GECODE_HAS_GIST) |
| 104 | + DESTINATION share/minizinc/solvers |
| 105 | + ) |
| 106 | + endif() |
| 107 | ++ |
| 108 | ++ |
| 109 | ++ # Export the library interface |
| 110 | ++ install(EXPORT gecode-targets |
| 111 | ++ NAMESPACE gecode:: |
| 112 | ++ DESTINATION lib/cmake/gecode |
| 113 | ++ ) |
| 114 | ++ |
| 115 | ++ install( |
| 116 | ++ FILES |
| 117 | ++ ${CMAKE_SOURCE_DIR}/cmake/gecode-config.cmake |
| 118 | ++ |
| 119 | ++ DESTINATION |
| 120 | ++ lib/cmake/gecode |
| 121 | ++ ) |
| 122 | +\ No newline at end of file |
0 commit comments