Commit df3a606f authored by Martin Heistermann's avatar Martin Heistermann
Browse files

CMake: Improve FindMOSEK.

parent 2c7fde01
Pipeline #15749 failed with stages
in 6 minutes and 52 seconds
......@@ -8,7 +8,10 @@
# MOSEK_LIBRARIES - The libraries needed to use Mosek
# MOSEK_LIBRARY_DIR - The Mosek library dicrectory
set (MOSEK_BASE "c:" CACHE PATH "Base path of your gurobi installation")
# TODO: add fusion_cxx target to compile with the current compiler(!), safer than a globally built fusion_cxx
set (MOSEK_BASE "c:" CACHE PATH "Base path of your MOSEK installation")
if (MOSEK_INCLUDE_DIR)
# in cache already
......@@ -17,39 +20,54 @@ if (MOSEK_INCLUDE_DIR)
set(MOSEK_LIBRARIES "${MOSEK_LIBRARY};${MOSEK_CXX_LIBRARY}" )
else (MOSEK_INCLUDE_DIR)
if (${CMAKE_HOST_SYSTEM_NAME} MATCHES "Windows")
set(DEFAULT_MOSEK_PLATFORM "win64x86")
elseif (${CMAKE_HOST_SYSTEM_NAME} MATCHES "Darwin")
set(DEFAULT_MOSEK_PLATFORM "osx64x86")
elseif (${CMAKE_HOST_SYSTEM_NAME} MATCHES "Linux")
set(DEFAULT_MOSEK_PLATFORM "linux64x86")
else()
set(DEFAULT_MOSEK_PLATFORM "unknown")
endif()
set (MOSEK_PLATFORM "${DEFAULT_MOSEK_PLATFORM}" CACHE STRING "mosek platform, e.g. linux64x86 or osx64x86")
mark_as_advanced(MOSEK_PLATFORM)
find_path(MOSEK_INCLUDE_DIR
NAMES mosek.h
PATHS "$ENV{MOSEK_DIR}/tools/platform/osx64x86/h"
"${MOSEK_BASE}/tools/platform/osx64x86/h"
PATHS "$ENV{MOSEK_DIR}/tools/platform/${MOSEK_PLATFORM}/h"
"${MOSEK_BASE}/tools/platform/${MOSEK_PLATFORM}/h"
)
find_path(MOSEK_LIBRARY_DIR
NAMES libmosek64.dylib
PATHS "$ENV{MOSEK_DIR}/tools/platform/osx64x86/bin"
"${MOSEK_BASE}/tools/platform/osx64x86/bin"
libmosek64.so
mosek64_9_2.dll
PATHS "$ENV{MOSEK_DIR}/tools/platform/${MOSEK_PLATFORM}/bin"
"${MOSEK_BASE}/tools/platform/${MOSEK_PLATFORM}/bin"
)
find_library( MOSEK_LIBRARY
NAMES mosek64
PATHS "$ENV{MOSEK_DIR}/tools/platform/osx64x86/bin"
"${MOSEK_BASE}/tools/platform/osx64x86/bin"
PATHS "$ENV{MOSEK_DIR}/tools/platform/${MOSEK_PLATFORM}/bin"
"${MOSEK_BASE}/tools/platform/${MOSEK_PLATFORM}/bin"
)
find_library( MOSEK_CXX_LIBRARY
NAMES fusion64
PATHS "$ENV{MOSEK_DIR}/tools/platform/osx64x86/bin"
"${MOSEK_BASE}/tools/platform/osx64x86/bin"
PATHS "$ENV{MOSEK_DIR}/tools/platform/${MOSEK_PLATFORM}/bin"
"${MOSEK_BASE}/tools/platform/${MOSEK_PLATFORM}/bin"
)
# Binary dir for DLLs
find_path(MOSEK_BIN_DIR
NAMES "mosek.dll"
PATHS "$ENV{MOSEK_DIR}/tools/platform/osx64x86/bin"
"${MOSEK_BASE}/tools/platform/osx64x86/bin"
"mosekcli"
PATHS "$ENV{MOSEK_DIR}/tools/platform/${MOSEK_PLATFORM}/bin"
"${MOSEK_BASE}/tools/platform/${MOSEK_PLATFORM}/bin"
DOC "Directory containing the MOSEK DLLs"
)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment