Revision 17193af3d657126f5c300216137fefe4ec9e1f78 authored by Max Göttlicher on 16 August 2022, 13:10:20 UTC, committed by Max Göttlicher on 16 August 2022, 13:10:20 UTC
1 parent 3c6f7c5
CMakeLists.txt
cmake_minimum_required(VERSION 3.22)
project(pds)
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
set(CMAKE_CXX_STANDARD 20)
find_package(Boost 1.70 REQUIRED COMPONENTS graph program_options)
include(FetchContent)
set(FETCHCONTENT_TRY_FIND_PACKAGE_MODE OPT_IN)
FetchContent_Declare(
unordered_dense
GIT_REPOSITORY https://github.com/martinus/unordered_dense.git
GIT_TAG 94156450d991515faa07ccd3823a2592c000e49f
)
FetchContent_Declare(
OGDF
URL https://ogdf.uos.de/wp-content/uploads/2022/02/ogdf.v2022.02.zip
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
)
FetchContent_Declare(
fmt
GIT_REPOSITORY https://github.com/fmtlib/fmt.git
GIT_TAG c4ee726 # 9.0.0
)
FetchContent_MakeAvailable(unordered_dense OGDF fmt)
# No warnings from OGDF headers
get_target_property(TMP_OGDF_INCLUDE_DIRS OGDF INTERFACE_INCLUDE_DIRECTORIES)
target_include_directories(OGDF SYSTEM INTERFACE ${TMP_OGDF_INCLUDE_DIRS})
add_subdirectory(contrib/setgraph)
find_package(Gurobi REQUIRED)
find_package(range-v3 REQUIRED)
add_library(pdslib STATIC src/pds.cpp src/graphml.cpp src/draw_grid.cpp)
target_include_directories(pdslib PUBLIC include PRIVATE Boost::graph)
target_link_libraries(pdslib PUBLIC range-v3 fmt::fmt)
target_link_libraries(pdslib PUBLIC setgraph unordered_dense::unordered_dense PRIVATE OGDF)
target_compile_options(pdslib PRIVATE
$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>,$<CXX_COMPILER_ID:GNU>>:
-Wall -Wextra -Werror>
$<$<CXX_COMPILER_ID:MSVC>:
/W4>)
add_library(pdslib-gurobi src/gurobi_solve.cpp)
target_link_libraries(pdslib-gurobi PUBLIC pdslib PRIVATE gurobi::gurobi_cxx)
add_executable(pds main.cpp)
target_link_libraries(pds PUBLIC pdslib pdslib-gurobi fmt::fmt)
add_executable(random_tree random_trees.cpp)
target_link_libraries(random_tree PUBLIC pdslib Boost::program_options)

Computing file changes ...