Skip to content

Commit fd98e58

Browse files
committed
Update CMake files
1 parent 32de042 commit fd98e58

File tree

2 files changed

+23
-8
lines changed

2 files changed

+23
-8
lines changed

CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ cmake_minimum_required(VERSION 3.15.0)
22

33
project(LocalSearchSolver LANGUAGES CXX)
44

5-
# Options.
5+
# Build options.
6+
option(LOCALSEARCHSOLVER_BUILD_TEST "Build unit tests" ON)
67
option(LOCALSEARCHSOLVER_BUILD_EXAMPLES "Build examples" ON)
78

89
# Avoid FetchContent warning.
@@ -17,7 +18,9 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
1718
# Add sub-directories.
1819
add_subdirectory(extern)
1920
add_subdirectory(src)
20-
add_subdirectory(test)
21+
if(LOCALSEARCHSOLVER_BUILD_TEST)
22+
add_subdirectory(test)
23+
endif()
2124
if(LOCALSEARCHSOLVER_BUILD_EXAMPLES)
2225
add_subdirectory(examples)
2326
endif()

extern/CMakeLists.txt

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,22 @@
11
# Enable FetchContent.
22
include(FetchContent)
33

4-
# Fetch fontanf/orproblems.
4+
# Fetch fontanf/optimizationtools.
5+
set(OPTIMIZATIONTOOLS_BUILD_TEST OFF)
56
FetchContent_Declare(
6-
orproblems
7-
GIT_REPOSITORY https://github.com/fontanf/orproblems.git
8-
GIT_TAG ba099d6bd0ac186e4113fe340789a1800fa72852)
9-
#SOURCE_DIR "${PROJECT_SOURCE_DIR}/../orproblems/")
10-
FetchContent_MakeAvailable(orproblems)
7+
optimizationtools
8+
GIT_REPOSITORY https://github.com/fontanf/optimizationtools.git
9+
GIT_TAG e8c379203792fcad764cce239986b325619475fd
10+
#SOURCE_DIR "${PROJECT_SOURCE_DIR}/../optimizationtools/"
11+
EXCLUDE_FROM_ALL)
12+
FetchContent_MakeAvailable(optimizationtools)
13+
14+
# Fetch fontanf/orproblems.
15+
if(LOCALSEARCHSOLVER_BUILD_EXAMPLES)
16+
FetchContent_Declare(
17+
orproblems
18+
#GIT_REPOSITORY https://github.com/fontanf/orproblems.git
19+
#GIT_TAG ba099d6bd0ac186e4113fe340789a1800fa72852)
20+
SOURCE_DIR "${PROJECT_SOURCE_DIR}/../orproblems/")
21+
FetchContent_MakeAvailable(orproblems)
22+
endif()

0 commit comments

Comments
 (0)