diff --git a/src/search/cmake/FindCplex.cmake b/src/search/cmake/FindCplex.cmake index bed0856117..efa90e484c 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 does not provide dynamic libraries in all + # tested environments. 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