Files
ortools-clone/cmake/samples/cpp/CMakeLists.txt
Mizux Seiha f992206a9a Force use of C++17
Routing use c++17 features (e.g. structured binding)
ref: https://en.cppreference.com/w/cpp/language/structured_binding
2020-08-14 14:07:58 +02:00

20 lines
520 B
CMake

cmake_minimum_required(VERSION 3.14)
project(Sample VERSION 1.0.0 LANGUAGES CXX)
include(CTest)
find_package(ortools CONFIG REQUIRED)
add_executable(sample main.cpp)
target_compile_features(sample PUBLIC cxx_std_17)
set_target_properties(sample PROPERTIES VERSION ${PROJECT_VERSION})
target_link_libraries(sample PRIVATE ortools::ortools)
if(BUILD_TESTING)
add_test(NAME sample_UT COMMAND sample)
endif()
include(GNUInstallDirs)
install(TARGETS sample
EXPORT SampleTargets
DESTINATION ${CMAKE_INSTALL_BINDIR})