Skip to content

Commit ca0b206

Browse files
CMake: always install lapack.h header
fixes #632
1 parent 09af64a commit ca0b206

File tree

3 files changed

+20
-10
lines changed

3 files changed

+20
-10
lines changed

CMakeLists.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -392,9 +392,8 @@ endif()
392392
set(LAPACK_INSTALL_EXPORT_NAME ${LAPACK_INSTALL_EXPORT_NAME_CACHE})
393393
unset(LAPACK_INSTALL_EXPORT_NAME_CACHE)
394394

395-
if(LAPACKE)
396-
add_subdirectory(LAPACKE)
397-
endif()
395+
add_subdirectory(LAPACKE)
396+
398397

399398
#-------------------------------------
400399
# BLAS++ / LAPACK++

LAPACKE/CMakeLists.txt

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
message(STATUS "LAPACKE enable")
2-
enable_language(C)
3-
4-
set(LAPACK_INSTALL_EXPORT_NAME ${LAPACKELIB}-targets)
5-
61
# Create a header file lapacke_mangling.h for the routines called in my C programs
72
include(FortranCInterface)
83
## Ensure that the fortran compiler and c compiler specified are compatible
@@ -16,8 +11,20 @@ if(NOT FortranCInterface_GLOBAL_FOUND OR NOT FortranCInterface_MODULE_FOUND)
1611
${LAPACK_BINARY_DIR}/include/lapacke_mangling.h)
1712
endif()
1813

19-
include_directories(include ${LAPACK_BINARY_DIR}/include)
2014
add_subdirectory(include)
15+
16+
17+
if(NOT LAPACKE)
18+
return()
19+
endif()
20+
21+
22+
message(STATUS "LAPACKE enabled")
23+
enable_language(C)
24+
25+
set(LAPACK_INSTALL_EXPORT_NAME ${LAPACKELIB}-targets)
26+
27+
include_directories(include ${LAPACK_BINARY_DIR}/include)
2128
add_subdirectory(src)
2229
add_subdirectory(utils)
2330

LAPACKE/include/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
set(LAPACKE_INCLUDE lapacke.h lapack.h lapacke_config.h lapacke_utils.h)
1+
set(LAPACKE_INCLUDE lapack.h)
2+
3+
IF(LAPACKE)
4+
list(APPEND LAPACKE_INCLUDE lapacke.h lapacke_config.h lapacke_utils.h)
5+
endif()
26

37
file(COPY ${LAPACKE_INCLUDE} DESTINATION ${LAPACK_BINARY_DIR}/include)

0 commit comments

Comments
 (0)