Skip to content

Commit

Permalink
Feature/update cmake files (#2)
Browse files Browse the repository at this point in the history
* Clean build files

* Remove .bazelrc

* Update CMake files
  • Loading branch information
fontanf authored Jul 13, 2024
1 parent 8bb0aed commit 50e7043
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 106 deletions.
2 changes: 0 additions & 2 deletions .bazelrc

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
os: [ubuntu-latest, windows-latest, macos-13, macos-latest]
python-version: ["3.8"]

env:
Expand Down
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ cmake_minimum_required(VERSION 3.15.0)

project(TravellingThiefSolver LANGUAGES CXX)

# Avoid FetchContent warning.
cmake_policy(SET CMP0135 NEW)

# Require C++14.
set(CMAKE_CXX_STANDARD 14)

Expand Down
88 changes: 0 additions & 88 deletions WORKSPACE

This file was deleted.

15 changes: 9 additions & 6 deletions extern/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,25 @@ include(FetchContent)
FetchContent_Declare(
knapsacksolver
GIT_REPOSITORY https://github.com/fontanf/knapsacksolver.git
GIT_TAG abbe052b56c6e985112cda23abda26f1eb0e43ce)
#SOURCE_DIR "${PROJECT_SOURCE_DIR}/../knapsacksolver/")
GIT_TAG 5115e4db582c97e2e1ade8ea3ab5e678a921b223
#SOURCE_DIR "${PROJECT_SOURCE_DIR}/../knapsacksolver/"
EXCLUDE_FROM_ALL)
FetchContent_MakeAvailable(knapsacksolver)

# Fetch fontanf/treesearchsolver.
FetchContent_Declare(
treesearchsolver
GIT_REPOSITORY https://github.com/fontanf/treesearchsolver.git
GIT_TAG dca5b35d5cb6de3443b9ab08175f931b2df29b6b)
#SOURCE_DIR "${PROJECT_SOURCE_DIR}/../treesearchsolver/")
GIT_TAG 980bdd0d04f1a8a233a3af310d3152d812d614ce
#SOURCE_DIR "${PROJECT_SOURCE_DIR}/../treesearchsolver/"
EXCLUDE_FROM_ALL)
FetchContent_MakeAvailable(treesearchsolver)

# Fetch fontanf/localsearchsolver.
FetchContent_Declare(
localsearchsolver
GIT_REPOSITORY https://github.com/fontanf/localsearchsolver.git
GIT_TAG ecb15ef667d107f25ea51d056368f9c4e15545e2)
#SOURCE_DIR "${PROJECT_SOURCE_DIR}/../localsearchsolver/")
GIT_TAG f7110fdd15fa1b9001006bfbf7a8ab53f925016d
#SOURCE_DIR "${PROJECT_SOURCE_DIR}/../localsearchsolver/"
EXCLUDE_FROM_ALL)
FetchContent_MakeAvailable(localsearchsolver)
2 changes: 1 addition & 1 deletion src/packing_while_travelling/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ target_include_directories(TravellingThiefSolver_packing_while_travelling PUBLIC
target_link_libraries(TravellingThiefSolver_packing_while_travelling PUBLIC
OptimizationTools::containers
OptimizationTools::utils)
add_library(TravellingThiefSolver::knapsack ALIAS TravellingThiefSolver_packing_while_travelling)
add_library(TravellingThiefSolver::packing_while_travelling ALIAS TravellingThiefSolver_packing_while_travelling)

add_subdirectory(algorithms)

Expand Down
10 changes: 5 additions & 5 deletions src/packing_while_travelling/algorithms/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ target_include_directories(TravellingThiefSolver_packing_while_travelling_greedy
${PROJECT_SOURCE_DIR}/include)
target_link_libraries(TravellingThiefSolver_packing_while_travelling_greedy PUBLIC
TravellingThiefSolver_packing_while_travelling)
add_library(TravellingThiefSolver::knapsack::greedy ALIAS TravellingThiefSolver_packing_while_travelling_greedy)
add_library(TravellingThiefSolver::packing_while_travelling::greedy ALIAS TravellingThiefSolver_packing_while_travelling_greedy)

add_library(TravellingThiefSolver_packing_while_travelling_sequential_value_correction)
target_sources(TravellingThiefSolver_packing_while_travelling_sequential_value_correction PRIVATE
Expand All @@ -15,7 +15,7 @@ target_include_directories(TravellingThiefSolver_packing_while_travelling_sequen
target_link_libraries(TravellingThiefSolver_packing_while_travelling_sequential_value_correction PUBLIC
TravellingThiefSolver_packing_while_travelling
KnapsackSolver::knapsack::dynamic_programming_primal_dual)
add_library(TravellingThiefSolver::knapsack::sequential_value_correction ALIAS TravellingThiefSolver_packing_while_travelling_sequential_value_correction)
add_library(TravellingThiefSolver::packing_while_travelling::sequential_value_correction ALIAS TravellingThiefSolver_packing_while_travelling_sequential_value_correction)

add_library(TravellingThiefSolver_packing_while_travelling_dynamic_programming)
target_sources(TravellingThiefSolver_packing_while_travelling_dynamic_programming PRIVATE
Expand All @@ -24,7 +24,7 @@ target_include_directories(TravellingThiefSolver_packing_while_travelling_dynami
${PROJECT_SOURCE_DIR}/include)
target_link_libraries(TravellingThiefSolver_packing_while_travelling_dynamic_programming PUBLIC
TravellingThiefSolver_packing_while_travelling)
add_library(TravellingThiefSolver::knapsack::dynamic_programming ALIAS TravellingThiefSolver_packing_while_travelling_dynamic_programming)
add_library(TravellingThiefSolver::packing_while_travelling::dynamic_programming ALIAS TravellingThiefSolver_packing_while_travelling_dynamic_programming)

add_library(TravellingThiefSolver_packing_while_travelling_efficient_local_search)
target_sources(TravellingThiefSolver_packing_while_travelling_efficient_local_search PRIVATE
Expand All @@ -34,7 +34,7 @@ target_include_directories(TravellingThiefSolver_packing_while_travelling_effici
target_link_libraries(TravellingThiefSolver_packing_while_travelling_efficient_local_search PUBLIC
TravellingThiefSolver_packing_while_travelling
TravellingThiefSolver_packing_while_travelling_sequential_value_correction)
add_library(TravellingThiefSolver::knapsack::efficient_local_search ALIAS TravellingThiefSolver_packing_while_travelling_efficient_local_search)
add_library(TravellingThiefSolver::packing_while_travelling::efficient_local_search ALIAS TravellingThiefSolver_packing_while_travelling_efficient_local_search)

add_library(TravellingThiefSolver_packing_while_travelling_large_neighborhood_search)
target_sources(TravellingThiefSolver_packing_while_travelling_large_neighborhood_search PRIVATE
Expand All @@ -45,4 +45,4 @@ target_link_libraries(TravellingThiefSolver_packing_while_travelling_large_neigh
TravellingThiefSolver_packing_while_travelling
TravellingThiefSolver_packing_while_travelling_greedy
TravellingThiefSolver_packing_while_travelling_sequential_value_correction)
add_library(TravellingThiefSolver::knapsack::large_neighborhood_search ALIAS TravellingThiefSolver_packing_while_travelling_large_neighborhood_search)
add_library(TravellingThiefSolver::packing_while_travelling::large_neighborhood_search ALIAS TravellingThiefSolver_packing_while_travelling_large_neighborhood_search)
2 changes: 1 addition & 1 deletion src/thief_orienteering/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ target_include_directories(TravellingThiefSolver_thief_orienteering PUBLIC
target_link_libraries(TravellingThiefSolver_thief_orienteering PUBLIC
OptimizationTools::utils
TravelingSalesmanSolver::distances)
add_library(TravellingThiefSolver::knapsack ALIAS TravellingThiefSolver_thief_orienteering)
add_library(TravellingThiefSolver::thief_orienteering ALIAS TravellingThiefSolver_thief_orienteering)

add_subdirectory(algorithms)

Expand Down
2 changes: 1 addition & 1 deletion src/travelling_thief/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ target_link_libraries(TravellingThiefSolver_travelling_thief PUBLIC
TravelingSalesmanSolver::distances
TravelingSalesmanSolver::lkh
OptimizationTools::utils)
add_library(TravellingThiefSolver::knapsack ALIAS TravellingThiefSolver_travelling_thief)
add_library(TravellingThiefSolver::travelling_thief ALIAS TravellingThiefSolver_travelling_thief)

add_subdirectory(algorithms)

Expand Down
2 changes: 1 addition & 1 deletion src/travelling_while_packing/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ target_include_directories(TravellingThiefSolver_travelling_while_packing PUBLIC
target_link_libraries(TravellingThiefSolver_travelling_while_packing PUBLIC
OptimizationTools::containers
TravelingSalesmanSolver::distances)
add_library(TravellingThiefSolver::knapsack ALIAS TravellingThiefSolver_travelling_while_packing)
add_library(TravellingThiefSolver::travelling_while_packing ALIAS TravellingThiefSolver_travelling_while_packing)

add_subdirectory(algorithms)

Expand Down

0 comments on commit 50e7043

Please sign in to comment.