From a5f34150cadd9792ec75562a2c3c90dee6e8dc4d Mon Sep 17 00:00:00 2001 From: ClemensBuechner Date: Tue, 17 Oct 2023 16:55:08 +0200 Subject: [PATCH 1/2] Fix Windows CPLEX import. --- src/search/cmake/FindCplex.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/search/cmake/FindCplex.cmake b/src/search/cmake/FindCplex.cmake index 27827664da..bed0856117 100644 --- a/src/search/cmake/FindCplex.cmake +++ b/src/search/cmake/FindCplex.cmake @@ -12,7 +12,11 @@ set(IMPORTED_CONFIGURATIONS "Debug" "Release") set(HINT_PATHS ${cplex_DIR} $ENV{cplex_DIR}) -add_library(cplex::cplex IMPORTED UNKNOWN) +if(WIN32) + add_library(cplex::cplex IMPORTED SHARED) +else() + add_library(cplex::cplex IMPORTED UNKNOWN) +endif() set_target_properties(cplex::cplex PROPERTIES IMPORTED_CONFIGURATIONS "${IMPORTED_CONFIGURATIONS}" ) From 281a15625100b1e1353c48e69bbc4fdbe17a0e88 Mon Sep 17 00:00:00 2001 From: ClemensBuechner Date: Thu, 19 Oct 2023 09:55:20 +0200 Subject: [PATCH 2/2] Add comments. --- src/search/cmake/FindCplex.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/search/cmake/FindCplex.cmake b/src/search/cmake/FindCplex.cmake index bed0856117..606bba2a46 100644 --- a/src/search/cmake/FindCplex.cmake +++ b/src/search/cmake/FindCplex.cmake @@ -13,8 +13,13 @@ set(IMPORTED_CONFIGURATIONS "Debug" "Release") set(HINT_PATHS ${cplex_DIR} $ENV{cplex_DIR}) if(WIN32) + # On Windows we have to declare the library as SHARED to correctly + # communicate the location of the dll and impllib files. add_library(cplex::cplex IMPORTED SHARED) else() + # On Linux, the CPLEX installer sometimes does not provide dynamic + # libraries. If they are absent, we fall back to static ones further down, + # hence we mark the type unknown here. add_library(cplex::cplex IMPORTED UNKNOWN) endif() set_target_properties(cplex::cplex PROPERTIES