From 8d153c338e4a26d801f5c91a9a7853cba993c5ae Mon Sep 17 00:00:00 2001 From: Florian Fontan Date: Tue, 16 Apr 2024 19:44:43 +0200 Subject: [PATCH] Fix build files --- python/BUILD | 13 ------------- src/knapsack/CMakeLists.txt | 4 ++-- src/multiple_choice_subset_sum/CMakeLists.txt | 6 +++--- .../algorithms/CMakeLists.txt | 2 +- src/subset_sum/CMakeLists.txt | 6 +++--- src/subset_sum/algorithms/CMakeLists.txt | 6 +++--- 6 files changed, 12 insertions(+), 25 deletions(-) delete mode 100644 python/BUILD diff --git a/python/BUILD b/python/BUILD deleted file mode 100644 index 3e7970d..0000000 --- a/python/BUILD +++ /dev/null @@ -1,13 +0,0 @@ -load("//knapsacksolver:variables.bzl", "STDCPP") -load("@pybind11_bazel//:build_defs.bzl", "pybind_extension") - -pybind_extension( - name = "knapsacksolver", - srcs = ["knapsacksolver.cpp"], - deps = [ - "//knapsacksolver/knapsack/algorithms:dynamic_programming_bellman", - "//knapsacksolver/knapsack/algorithms:dynamic_programming_primal_dual", - ], - copts = STDCPP, -) - diff --git a/src/knapsack/CMakeLists.txt b/src/knapsack/CMakeLists.txt index 44e71a4..b69b7ca 100644 --- a/src/knapsack/CMakeLists.txt +++ b/src/knapsack/CMakeLists.txt @@ -23,8 +23,8 @@ target_link_libraries(KnapsackSolver_knapsack_main PUBLIC KnapsackSolver_knapsack_dynamic_programming_bellman KnapsackSolver_knapsack_dynamic_programming_primal_dual Boost::program_options) -set_target_properties(KnapsackSolver_knapsack_main PROPERTIES OUTPUT_NAME "knapsacksolver_knapsack" ) -install(TARGETS KnapsackSolver_knapsack_main DESTINATION bin) +set_target_properties(KnapsackSolver_knapsack_main PROPERTIES OUTPUT_NAME "knapsacksolver_knapsack") +install(TARGETS KnapsackSolver_knapsack_main) add_library(KnapsackSolver_knapsack_generator) target_sources(KnapsackSolver_knapsack_generator PRIVATE diff --git a/src/multiple_choice_subset_sum/CMakeLists.txt b/src/multiple_choice_subset_sum/CMakeLists.txt index 7cd454a..f2b1695 100644 --- a/src/multiple_choice_subset_sum/CMakeLists.txt +++ b/src/multiple_choice_subset_sum/CMakeLists.txt @@ -8,7 +8,7 @@ target_include_directories(KnapsackSolver_multiple_choice_subset_sum PUBLIC ${PROJECT_SOURCE_DIR}/include) target_link_libraries(KnapsackSolver_multiple_choice_subset_sum PUBLIC OptimizationTools::utils) -add_library(KnapsackSolver::knapsack ALIAS KnapsackSolver_multiple_choice_subset_sum) +add_library(KnapsackSolver::multiple_choice_subset_sum ALIAS KnapsackSolver_multiple_choice_subset_sum) add_subdirectory(algorithms) @@ -18,5 +18,5 @@ target_sources(KnapsackSolver_multiple_choice_subset_sum_main PRIVATE target_link_libraries(KnapsackSolver_multiple_choice_subset_sum_main PUBLIC KnapsackSolver_multiple_choice_subset_sum_dynamic_programming_bellman Boost::program_options) -set_target_properties(KnapsackSolver_multiple_choice_subset_sum_main PROPERTIES OUTPUT_NAME "knapsacksolver_multiple_choice_subset_sum" ) -install(TARGETS KnapsackSolver_multiple_choice_subset_sum_main DESTINATION bin) +set_target_properties(KnapsackSolver_multiple_choice_subset_sum_main PROPERTIES OUTPUT_NAME "knapsacksolver_multiple_choice_subset_sum") +install(TARGETS KnapsackSolver_multiple_choice_subset_sum_main) diff --git a/src/multiple_choice_subset_sum/algorithms/CMakeLists.txt b/src/multiple_choice_subset_sum/algorithms/CMakeLists.txt index ed0fe2e..2de8745 100644 --- a/src/multiple_choice_subset_sum/algorithms/CMakeLists.txt +++ b/src/multiple_choice_subset_sum/algorithms/CMakeLists.txt @@ -5,4 +5,4 @@ target_include_directories(KnapsackSolver_multiple_choice_subset_sum_dynamic_pro ${PROJECT_SOURCE_DIR}/include) target_link_libraries(KnapsackSolver_multiple_choice_subset_sum_dynamic_programming_bellman PUBLIC KnapsackSolver_multiple_choice_subset_sum) -add_library(KnapsackSolver::knapsack::dynamic_programming_bellman ALIAS KnapsackSolver_multiple_choice_subset_sum_dynamic_programming_bellman) +add_library(KnapsackSolver::multiple_choice_subset_sum::dynamic_programming_bellman ALIAS KnapsackSolver_multiple_choice_subset_sum_dynamic_programming_bellman) diff --git a/src/subset_sum/CMakeLists.txt b/src/subset_sum/CMakeLists.txt index f083e6f..88e02bd 100644 --- a/src/subset_sum/CMakeLists.txt +++ b/src/subset_sum/CMakeLists.txt @@ -20,12 +20,12 @@ target_link_libraries(KnapsackSolver_subset_sum_main PUBLIC KnapsackSolver_subset_sum_dynamic_programming_balancing KnapsackSolver_subset_sum_dynamic_programming_primal_dual Boost::program_options) -set_target_properties(KnapsackSolver_subset_sum_main PROPERTIES OUTPUT_NAME "knapsacksolver_subset_sum" ) -install(TARGETS KnapsackSolver_subset_sum_main DESTINATION bin) +set_target_properties(KnapsackSolver_subset_sum_main PROPERTIES OUTPUT_NAME "knapsacksolver_subset_sum") +install(TARGETS KnapsackSolver_subset_sum_main) add_library(KnapsackSolver_subset_sum_generator) target_sources(KnapsackSolver_subset_sum_generator PRIVATE generator.cpp) target_link_libraries(KnapsackSolver_subset_sum_generator PUBLIC KnapsackSolver_subset_sum) -add_library(KnapsackSolver::knapsack::generator ALIAS KnapsackSolver_subset_sum_generator) +add_library(KnapsackSolver::subset_sum::generator ALIAS KnapsackSolver_subset_sum_generator) diff --git a/src/subset_sum/algorithms/CMakeLists.txt b/src/subset_sum/algorithms/CMakeLists.txt index c49a7ac..1d3cf4f 100644 --- a/src/subset_sum/algorithms/CMakeLists.txt +++ b/src/subset_sum/algorithms/CMakeLists.txt @@ -5,7 +5,7 @@ target_include_directories(KnapsackSolver_subset_sum_dynamic_programming_bellman ${PROJECT_SOURCE_DIR}/include) target_link_libraries(KnapsackSolver_subset_sum_dynamic_programming_bellman PUBLIC KnapsackSolver_subset_sum) -add_library(KnapsackSolver::knapsack::dynamic_programming_bellman ALIAS KnapsackSolver_subset_sum_dynamic_programming_bellman) +add_library(KnapsackSolver::subset_sum::dynamic_programming_bellman ALIAS KnapsackSolver_subset_sum_dynamic_programming_bellman) add_library(KnapsackSolver_subset_sum_dynamic_programming_balancing) target_sources(KnapsackSolver_subset_sum_dynamic_programming_balancing PRIVATE @@ -14,7 +14,7 @@ target_include_directories(KnapsackSolver_subset_sum_dynamic_programming_balanci ${PROJECT_SOURCE_DIR}/include) target_link_libraries(KnapsackSolver_subset_sum_dynamic_programming_balancing PUBLIC KnapsackSolver_subset_sum) -add_library(KnapsackSolver::knapsack::dynamic_programming_balancing ALIAS KnapsackSolver_subset_sum_dynamic_programming_balancing) +add_library(KnapsackSolver::subset_sum::dynamic_programming_balancing ALIAS KnapsackSolver_subset_sum_dynamic_programming_balancing) add_library(KnapsackSolver_subset_sum_dynamic_programming_primal_dual) target_sources(KnapsackSolver_subset_sum_dynamic_programming_primal_dual PRIVATE @@ -23,4 +23,4 @@ target_include_directories(KnapsackSolver_subset_sum_dynamic_programming_primal_ ${PROJECT_SOURCE_DIR}/include) target_link_libraries(KnapsackSolver_subset_sum_dynamic_programming_primal_dual PUBLIC KnapsackSolver_subset_sum) -add_library(KnapsackSolver::knapsack::dynamic_programming_primal_dual ALIAS KnapsackSolver_subset_sum_dynamic_programming_primal_dual) +add_library(KnapsackSolver::subset_sum::dynamic_programming_primal_dual ALIAS KnapsackSolver_subset_sum_dynamic_programming_primal_dual)