Skip to content

Commit dbc0fbb

Browse files
committed
Improve clapack-config.cmake to be more standard
It defines CLAPACK_INCLUDE_DIRS and CLAPACK_LIBRARIES
1 parent b12609e commit dbc0fbb

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ include_directories(${CLAPACK_SOURCE_DIR}/INCLUDE)
1919
add_subdirectory(F2CLIBS)
2020
add_subdirectory(BLAS)
2121
add_subdirectory(SRC)
22+
# There is no install tree, copy the INCLUDE folder into the build tree.
23+
file(COPY ${CLAPACK_SOURCE_DIR}/INCLUDE DESTINATION ${CLAPACK_BINARY_DIR})
24+
# Used in clapack-config.cmake.in
25+
set(CONF_INCLUDE_DIRS ${CLAPACK_BINARY_DIR}/INCLUDE)
26+
2227
if( BUILD_TESTING )
2328
enable_testing()
2429
include(CTest)

clapack-config.cmake.in

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,16 @@
1-
include("@CLAPACK_BINARY_DIR@/clapack-targets.cmake")
1+
# - Config file for CLAPACK
2+
# It defines the following variables
3+
# CLAPACK_INCLUDE_DIRS - include directories for FooBar
4+
# CLAPACK_LIBRARIES - libraries to link against
5+
6+
# Compute paths
7+
get_filename_component(CLAPACK_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
8+
set(CLAPACK_INCLUDE_DIRS "@CONF_INCLUDE_DIRS@")
9+
10+
# Our library dependencies (contains definitions for IMPORTED targets)
11+
if(NOT TARGET CLAPACK AND NOT CLAPACK_BINARY_DIR)
12+
include("@CLAPACK_BINARY_DIR@/clapack-targets.cmake")
13+
endif()
14+
15+
# These are IMPORTED targets created by clapack-targets.cmake
16+
set(CLAPACK_LIBRARIES "f2c blas lapack")

0 commit comments

Comments
 (0)