Something went wrong. Try again.
This repository has no description
Something went wrong. Try again.
4.2 kB · 119 lines
at develop
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120cmake_minimum_required(VERSION 3.4.0)
# -------------------------------------------------------------------------------------------------------------------# -- Project information and versioning.
project(libminizinc VERSION 2.3.2 LANGUAGES CXX C)
if(NOT BUILD_REF) set(BUILD_REF "")endif()
# -------------------------------------------------------------------------------------------------------------------# -- Project build options
# Driver compilation selectionoption(USE_CPLEX "Enable the CPLEX solving target" FALSE)option(USE_GEAS "Enable the Geas solving target" TRUE)option(USE_GECODE "Enable the Gecode solving target" TRUE)option(USE_GUROBI "Enable the Gurobi solving target" FALSE)option(USE_OSICBC "Enable the Osi CBC solving target" FALSE)option(USE_SCIP "Enable the SCIP solving target" FALSE)option(USE_XPRESS "Enable the Xpress solving target" FALSE)
# Static vs. Dynamic linkingoption(CPLEX_PLUGIN "Build CPLEX binding as a plugin" ON)option(GUROBI_PLUGIN "Build Gurobi binding as a plugin" ON)
# Enforce non proprietary buildoption(USE_PROPRIETARY "Enable static linking of proprietary solvers" OFF)if(NOT USE_PROPRIETARY) set(CPLEX_PLUGIN ON) set(GUROBI_PLUGIN ON) set(USE_SCIP OFF)endif()
# Export compile commands (useful when working with visual studio code)set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# -------------------------------------------------------------------------------------------------------------------# -- CMake initialisation
# Fix library suffixes for Web Assembly platforminclude(cmake/support/emscripten_setup.cmake)
# Try to find possible dependencieslist(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules)if(POLICY CMP0074) cmake_policy(SET CMP0074 NEW)endif(POLICY CMP0074)find_package(CPlex)# TODO: Resolve issues with the Gecode / Geas solver interface# find_package(Geas)find_package(Gecode 6.0 COMPONENTS Driver Float Int Kernel Minimodel Search Set Support)find_package(Gurobi)find_package(OsiCBC)find_package(SCIP CONFIG)find_package(Xpress)
# Set build type when none is selectedset(DEFAULT_BUILD_TYPE "Release")if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) message(STATUS "Setting build type to '${DEFAULT_BUILD_TYPE}' as none was specified.") set(CMAKE_BUILD_TYPE "${DEFAULT_BUILD_TYPE}" CACHE STRING "Choose the type of build." FORCE) # Set the possible values of build type for cmake-gui set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")endif()
# -------------------------------------------------------------------------------------------------------------------# -- Compiler configuration
include(cmake/support/ccache_setup.cmake)include(cmake/support/compiler_setup.cmake)
configure_file( ${PROJECT_SOURCE_DIR}/include/minizinc/config.hh.in ${PROJECT_BINARY_DIR}/include/minizinc/config.hh)
install( FILES ${PROJECT_BINARY_DIR}/include/minizinc/config.hh DESTINATION include/minizinc)
# -------------------------------------------------------------------------------------------------------------------# -- MiniZinc compilation targets.
find_package(Threads REQUIRED)include_directories(${PROJECT_SOURCE_DIR}/include)include_directories(${PROJECT_BINARY_DIR}/include)
# Librariesinclude(cmake/targets/libmzn.cmake)include(cmake/targets/libmza.cmake)
# Executables#include(cmake/targets/minizinc.cmake)#include(cmake/targets/mzn2doc.cmake)include(cmake/targets/mznasm.cmake)include(cmake/targets/mzncc.cmake)
# -------------------------------------------------------------------------------------------------------------------# -- Platform Specific configurationinclude(cmake/support/config_emscripten.cmake)
# -------------------------------------------------------------------------------------------------------------------# -- CMake configuration generation
include(cmake/support/config_export.cmake)include(cmake/support/config_output.cmake)
# -------------------------------------------------------------------------------------------------------------------# -- Support Actionsinclude(cmake/support/format.cmake)