A set of benchmarks to compare a new prototype MiniZinc implementation
1cmake_minimum_required(VERSION 3.4.0)
2
3# -------------------------------------------------------------------------------------------------------------------
4# -- Project information and versioning.
5
6project(libminizinc
7 VERSION 2.3.2
8 LANGUAGES CXX C)
9
10if(NOT BUILD_REF)
11 set(BUILD_REF "")
12endif()
13
14# -------------------------------------------------------------------------------------------------------------------
15# -- Project build options
16
17# Driver compilation selection
18option(USE_CPLEX "Enable the CPLEX solving target" FALSE)
19option(USE_GEAS "Enable the Geas solving target" TRUE)
20option(USE_GECODE "Enable the Gecode solving target" TRUE)
21option(USE_GUROBI "Enable the Gurobi solving target" FALSE)
22option(USE_OSICBC "Enable the Osi CBC solving target" FALSE)
23option(USE_SCIP "Enable the SCIP solving target" FALSE)
24option(USE_XPRESS "Enable the Xpress solving target" FALSE)
25
26# Static vs. Dynamic linking
27option(CPLEX_PLUGIN "Build CPLEX binding as a plugin" ON)
28option(GUROBI_PLUGIN "Build Gurobi binding as a plugin" ON)
29
30# Enforce non proprietary build
31option(USE_PROPRIETARY "Enable static linking of proprietary solvers" OFF)
32if(NOT USE_PROPRIETARY)
33 set(CPLEX_PLUGIN ON)
34 set(GUROBI_PLUGIN ON)
35 set(USE_SCIP OFF)
36endif()
37
38# Export compile commands (useful when working with visual studio code)
39set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
40
41# -------------------------------------------------------------------------------------------------------------------
42# -- CMake initialisation
43
44# Fix library suffixes for Web Assembly platform
45include(cmake/support/emscripten_setup.cmake)
46
47# Try to find possible dependencies
48list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules)
49if(POLICY CMP0074)
50 cmake_policy(SET CMP0074 NEW)
51endif(POLICY CMP0074)
52find_package(CPlex)
53# TODO: Resolve issues with the Gecode / Geas solver interface
54# find_package(Geas)
55find_package(Gecode 6.0 COMPONENTS Driver Float Int Kernel Minimodel Search Set Support)
56find_package(Gurobi)
57find_package(OsiCBC)
58find_package(SCIP CONFIG)
59find_package(Xpress)
60
61# Set build type when none is selected
62set(DEFAULT_BUILD_TYPE "Release")
63if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
64 message(STATUS "Setting build type to '${DEFAULT_BUILD_TYPE}' as none was specified.")
65 set(CMAKE_BUILD_TYPE "${DEFAULT_BUILD_TYPE}" CACHE STRING "Choose the type of build." FORCE)
66 # Set the possible values of build type for cmake-gui
67 set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
68 "Debug"
69 "Release"
70 "MinSizeRel"
71 "RelWithDebInfo")
72endif()
73
74# -------------------------------------------------------------------------------------------------------------------
75# -- Compiler configuration
76
77include(cmake/support/ccache_setup.cmake)
78include(cmake/support/compiler_setup.cmake)
79
80configure_file(
81 ${PROJECT_SOURCE_DIR}/include/minizinc/config.hh.in
82 ${PROJECT_BINARY_DIR}/include/minizinc/config.hh
83)
84
85install(
86 FILES ${PROJECT_BINARY_DIR}/include/minizinc/config.hh
87 DESTINATION include/minizinc
88)
89
90# -------------------------------------------------------------------------------------------------------------------
91# -- MiniZinc compilation targets.
92
93find_package(Threads REQUIRED)
94include_directories(${PROJECT_SOURCE_DIR}/include)
95include_directories(${PROJECT_BINARY_DIR}/include)
96
97# Libraries
98include(cmake/targets/libmzn.cmake)
99include(cmake/targets/libmza.cmake)
100
101# Executables
102#include(cmake/targets/minizinc.cmake)
103#include(cmake/targets/mzn2doc.cmake)
104include(cmake/targets/mznasm.cmake)
105include(cmake/targets/mzncc.cmake)
106
107# -------------------------------------------------------------------------------------------------------------------
108# -- Platform Specific configuration
109include(cmake/support/config_emscripten.cmake)
110
111# -------------------------------------------------------------------------------------------------------------------
112# -- CMake configuration generation
113
114include(cmake/support/config_export.cmake)
115include(cmake/support/config_output.cmake)
116
117# -------------------------------------------------------------------------------------------------------------------
118# -- Support Actions
119include(cmake/support/format.cmake)