-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
86 lines (68 loc) · 2.58 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0)
CMAKE_POLICY(SET CMP0048 NEW)
PROJECT(qrupdate-ng VERSION 1.1.5 LANGUAGES Fortran)
ENABLE_TESTING()
# Options
OPTION(BUILD_SHARED_LIBS "Build shared libraries" ON)
OPTION(DEBUG "Enable Debug Symbol generation" OFF)
SET(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
IF ( DEBUG STREQUAL ON )
SET (CMAKE_BUILD_TYPE "Debug")
ADD_DEFINITIONS(-DDEBUG)
ENDIF()
IF(NOT CMAKE_BUILD_TYPE)
SET (CMAKE_BUILD_TYPE "Release")
ENDIF()
# Required to work with Intel MKL
IF (CMAKE_Fortran_COMPILER_ID STREQUAL "Intel" OR BLA_VENDOR MATCHES "Intel.*")
ENABLE_LANGUAGE(C)
ENDIF()
# Add addtional CMAKE Paths.
LIST(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
INCLUDE(FortranCompilerSettings)
INCLUDE(GNUInstallDirs)
# IBM XLF Compilation
IF( CMAKE_Fortran_COMPILER_ID STREQUAL "XL")
SET(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -qfixed -qnosave")
ENDIF()
FIND_PACKAGE(BLAS REQUIRED)
MESSAGE(STATUS "BLAS Vendor: ${BLA_VENDOR}")
IF(NOT BLA_VENDOR STREQUAL "IBMESSL")
FIND_PACKAGE(LAPACK REQUIRED)
ELSE()
SET(LAPACK_MISSING_TARGET_NAME lapack_missing)
INCLUDE(${CMAKE_SOURCE_DIR}/lapack-missing/LapackMissing.cmake)
SET(LAPACK_FOUND TRUE)
SET(LAPACK_LIBRARIES ${BLAS_LIBRARIES})
ENDIF()
ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(test)
INCLUDE(CMakePackageConfigHelpers)
WRITE_BASIC_PACKAGE_VERSION_FILE(
qrupdateConfigVersion.cmake
VERSION ${PROJECT_VERSION}
COMPATIBILITY AnyNewerVersion
)
INSTALL(EXPORT qrupdatetargets
FILE qrupdateTargets.cmake
NAMESPACE qrupdate::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/qrupdate
)
CONFIGURE_FILE(qrupdate-config.cmake.in qrupdate-config.cmake @ONLY)
INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/qrupdate-config.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/qrupdateConfigVersion.cmake"
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/qrupdate
)
CONFIGURE_FILE(qrupdate.pc.in qrupdate.pc @ONLY)
INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/qrupdate.pc"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
MESSAGE(STATUS "------------ Build Information --------------")
MESSAGE(STATUS "CMAKE_Fortran_FLAGS: ${CMAKE_Fortran_FLAGS}")
MESSAGE(STATUS "CMAKE_Fortran_FLAGS_DEBUG: ${CMAKE_Fortran_FLAGS_DEBUG}")
MESSAGE(STATUS "CMAKE_Fortran_FLAGS_RELEASE: ${CMAKE_Fortran_FLAGS_RELEASE}")
MESSAGE(STATUS "BLAS Libraries: ${BLAS_LIBRARIES}")
MESSAGE(STATUS "LAPACK Libraries: ${LAPACK_LIBRARIES}")
MESSAGE(STATUS "Build Type: ${CMAKE_BUILD_TYPE}")
MESSAGE(STATUS "Debug: ${DEBUG}")
MESSAGE(STATUS "Shared Libs: ${BUILD_SHARED_LIBS}")
MESSAGE(STATUS "---------------------------------------------")