2020-08-28 13:13:05 +08:00
|
|
|
#.rst:
|
|
|
|
# clapack config for vcpkg
|
|
|
|
# ------------
|
|
|
|
#
|
2024-04-09 02:15:54 +08:00
|
|
|
# Find clapack as a valid LAPACK implementation.
|
2020-08-28 13:13:05 +08:00
|
|
|
#
|
2024-04-09 02:15:54 +08:00
|
|
|
# The module defines the same outputs as FindLAPACK by cmake
|
2020-08-28 13:13:05 +08:00
|
|
|
|
|
|
|
include(${CMAKE_ROOT}/Modules/SelectLibraryConfigurations.cmake)
|
|
|
|
include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
|
|
|
|
|
|
|
|
set(CLAPACK_VERSION "3.2.1")
|
2024-04-09 02:15:54 +08:00
|
|
|
set(LAPACK_VERSION "${CLAPACK_VERSION}")
|
|
|
|
#set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
|
|
|
|
find_package(Threads)
|
2020-08-28 13:13:05 +08:00
|
|
|
|
2024-04-09 02:15:54 +08:00
|
|
|
find_package(clapack CONFIG REQUIRED) # This will be found !
|
2020-08-28 13:13:05 +08:00
|
|
|
|
2024-04-09 02:15:54 +08:00
|
|
|
if(NOT TARGET lapack)
|
|
|
|
message(FATAL_ERROR "Target lapack was not created by find_package(clapack)!")
|
2020-08-28 13:13:05 +08:00
|
|
|
endif()
|
|
|
|
|
2024-04-09 02:15:54 +08:00
|
|
|
if(NOT TARGET LAPACK::LAPACK)
|
|
|
|
add_library(LAPACK::LAPACK INTERFACE IMPORTED)
|
|
|
|
target_link_libraries(LAPACK::LAPACK INTERFACE lapack)
|
2020-08-28 13:13:05 +08:00
|
|
|
|
2024-04-09 02:15:54 +08:00
|
|
|
set(lib_prop IMPORTED_LOCATION)
|
|
|
|
#if(@VCPKG_LIBRARY_LINKAGE@ STREQUAL "dynamic" AND WIN32)
|
|
|
|
# set(lib_prop IMPORTED_IMPLIB)
|
|
|
|
#endif()
|
2020-08-28 13:13:05 +08:00
|
|
|
|
2024-04-09 02:15:54 +08:00
|
|
|
get_property(LAPACK_LIBRARY_RELEASE TARGET lapack PROPERTY ${lib_prop}_RELEASE)
|
|
|
|
get_property(LAPACK_LIBRARY_DEBUG TARGET lapack PROPERTY ${lib_prop}_DEBUG)
|
2020-08-28 13:13:05 +08:00
|
|
|
|
2024-04-09 02:15:54 +08:00
|
|
|
get_property(LAPACK_INCLUDE_DIR TARGET lapack PROPERTY INTERFACE_INCLUDE_DIRECTORIES) # Doesn't make much sense but ok.
|
|
|
|
select_library_configurations(LAPACK)
|
2020-08-28 13:13:05 +08:00
|
|
|
|
2024-04-09 02:15:54 +08:00
|
|
|
get_property(LAPACK_LINKER_FLAGS_RELEASE TARGET lapack PROPERTY IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE)
|
|
|
|
get_property(LAPACK_LINKER_FLAGS_DEBUG TARGET lapack PROPERTY IMPORTED_LINK_INTERFACE_LIBRARIES_DEBUG)
|
|
|
|
list(TRANSFORM LAPACK_LINKER_FLAGS_DEBUG PREPEND "$<$<CONFIG:DEBUG>:")
|
|
|
|
list(TRANSFORM LAPACK_LINKER_FLAGS_DEBUG APPEND ">")
|
|
|
|
list(TRANSFORM LAPACK_LINKER_FLAGS_RELEASE PREPEND "$<$<NOT:$<CONFIG:DEBUG>>:")
|
|
|
|
list(TRANSFORM LAPACK_LINKER_FLAGS_RELEASE APPEND ">")
|
2021-07-17 03:03:54 +08:00
|
|
|
|
2024-04-09 02:15:54 +08:00
|
|
|
set(LAPACK_LIBRARIES "${LAPACK_LIBRARIES};${LAPACK_LINKER_FLAGS_DEBUG};${LAPACK_LINKER_FLAGS_RELEASE}")
|
|
|
|
set(LAPACK95_LIBRARIES "${LAPACK_LIBRARIES}")
|
|
|
|
set(LAPACK95_FOUND "TRUE")
|
|
|
|
set(LAPACK_LINKER_FLAGS "${LAPACK_LIBRARIES}")
|
2021-07-17 03:03:54 +08:00
|
|
|
endif()
|
2024-04-09 02:15:54 +08:00
|
|
|
find_package_handle_standard_args(LAPACK DEFAULT_MSG LAPACK_LIBRARY LAPACK_INCLUDE_DIR )
|
|
|
|
mark_as_advanced(LAPACK_INCLUDE_DIR LAPACK_LIBRARY)
|