Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue1122 #194

Merged
merged 1 commit into from
Oct 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions src/search/cmake/FindCplex.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
set(IMPORTED_CONFIGURATIONS "Debug" "Release")
set(HINT_PATHS ${cplex_DIR} $ENV{cplex_DIR})

add_library(cplex::cplex IMPORTED SHARED)
add_library(cplex::cplex IMPORTED UNKNOWN)
set_target_properties(cplex::cplex PROPERTIES
IMPORTED_CONFIGURATIONS "${IMPORTED_CONFIGURATIONS}"
)
Expand Down Expand Up @@ -157,18 +157,20 @@ foreach(CONFIG_ORIG ${IMPORTED_CONFIGURATIONS})
list(APPEND REQUIRED_LIBRARIES CPLEX_SHARED_LIBRARY_${CONFIG} CPLEX_IMPLIB_${CONFIG})
else()
# CPLEX stores .so files in /bin
find_library(CPLEX_SHARED_LIBRARY_${CONFIG}
find_library(CPLEX_LIBRARY_${CONFIG}
NAMES
cplex${CPLEX_VERSION_NO_DOTS}
cplex
HINTS
${HINT_PATHS}/bin
${HINT_PATHS}/lib
PATH_SUFFIXES
${SUFFIXES_${CONFIG}}
)
set_target_properties(cplex::cplex PROPERTIES
IMPORTED_LOCATION_${CONFIG} ${CPLEX_SHARED_LIBRARY_${CONFIG}}
IMPORTED_LOCATION_${CONFIG} ${CPLEX_LIBRARY_${CONFIG}}
)
list(APPEND REQUIRED_LIBRARIES CPLEX_SHARED_LIBRARY_${CONFIG})
list(APPEND REQUIRED_LIBRARIES CPLEX_LIBRARY_${CONFIG})
endif()
endforeach()

Expand All @@ -186,5 +188,5 @@ mark_as_advanced(
CPLEX_VERSION_SUBMINOR CPLEX_VERSION_NO_DOTS BITWIDTH_HINTS PLATFORM_HINTS
LIBRARY_TYPE_HINTS_RELEASE LIBRARY_TYPE_HINTS_DEBUG SUFFIXES_RELEASE
SUFFIXES_DEBUG FIND_OPTIONS COMPILER_HINTS COMPILER_HINT CPLEX_IMPLIB_DEBUG
CPLEX_IMPLIB_RELEASE CPLEX_SHARED_LIBRARY_DEBUG CPLEX_SHARED_LIBRARY_RELEASE
CPLEX_IMPLIB_RELEASE CPLEX_LIBRARY_DEBUG CPLEX_LIBRARY_RELEASE
)