diff --git a/CMakeLists.txt b/CMakeLists.txt index 794d45c..2ff8274 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,8 @@ cmake_minimum_required(VERSION 3.15.0) project(LocalSearchSolver LANGUAGES CXX) -# Options. +# Build options. +option(LOCALSEARCHSOLVER_BUILD_TEST "Build unit tests" ON) option(LOCALSEARCHSOLVER_BUILD_EXAMPLES "Build examples" ON) # Avoid FetchContent warning. @@ -17,7 +18,9 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # Add sub-directories. add_subdirectory(extern) add_subdirectory(src) -add_subdirectory(test) +if(LOCALSEARCHSOLVER_BUILD_TEST) + add_subdirectory(test) +endif() if(LOCALSEARCHSOLVER_BUILD_EXAMPLES) add_subdirectory(examples) endif() diff --git a/extern/CMakeLists.txt b/extern/CMakeLists.txt index 30010b4..808129f 100644 --- a/extern/CMakeLists.txt +++ b/extern/CMakeLists.txt @@ -1,10 +1,22 @@ # Enable FetchContent. include(FetchContent) -# Fetch fontanf/orproblems. +# Fetch fontanf/optimizationtools. +set(OPTIMIZATIONTOOLS_BUILD_TEST OFF) FetchContent_Declare( - orproblems - GIT_REPOSITORY https://github.com/fontanf/orproblems.git - GIT_TAG ba099d6bd0ac186e4113fe340789a1800fa72852) - #SOURCE_DIR "${PROJECT_SOURCE_DIR}/../orproblems/") -FetchContent_MakeAvailable(orproblems) + optimizationtools + GIT_REPOSITORY https://github.com/fontanf/optimizationtools.git + GIT_TAG e8c379203792fcad764cce239986b325619475fd + #SOURCE_DIR "${PROJECT_SOURCE_DIR}/../optimizationtools/" + EXCLUDE_FROM_ALL) +FetchContent_MakeAvailable(optimizationtools) + +# Fetch fontanf/orproblems. +if(LOCALSEARCHSOLVER_BUILD_EXAMPLES) + FetchContent_Declare( + orproblems + GIT_REPOSITORY https://github.com/fontanf/orproblems.git + GIT_TAG ba099d6bd0ac186e4113fe340789a1800fa72852) + #SOURCE_DIR "${PROJECT_SOURCE_DIR}/../orproblems/") + FetchContent_MakeAvailable(orproblems) +endif()