diff --git a/cmake/tpl/FindKLU.cmake b/cmake/tpl/FindKLU.cmake index 96b9d7343b..a3d817d037 100644 --- a/cmake/tpl/FindKLU.cmake +++ b/cmake/tpl/FindKLU.cmake @@ -46,7 +46,7 @@ if (NOT (KLU_INCLUDE_DIR OR KLU_LIBRARY_DIR OR KLU_LIBRARY)) endif() # Set library prefixes for Windows -if(WIN32) +if(MSVC OR ("${CMAKE_C_SIMULATE_ID}" STREQUAL "MSVC")) set(CMAKE_FIND_LIBRARY_PREFIXES lib ${CMAKE_FIND_LIBRARY_PREFIXES}) set(CMAKE_FIND_LIBRARY_SUFFIXES d.lib ${CMAKE_FIND_LIBRARY_SUFFIXES}) elseif(APPLE) @@ -95,7 +95,7 @@ endif () if (NOT SUITESPARSECONFIG_LIBRARY) set(SUITESPARSECONFIG_LIBRARY_NAME suitesparseconfig) # NOTE: no prefix for this library on windows - if(WIN32 AND NOT MSYS) + if(MSVC OR ("${CMAKE_C_SIMULATE_ID}" STREQUAL "MSVC")) set(CMAKE_FIND_LIBRARY_PREFIXES "") endif() find_library( SUITESPARSECONFIG_LIBRARY ${SUITESPARSECONFIG_LIBRARY_NAME} ${KLU_LIBRARY_DIR} NO_DEFAULT_PATH)