forked from python-control/Slycot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
50 lines (39 loc) · 1.31 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
# CMake file for use in conjunction with scikit-build
cmake_minimum_required(VERSION 3.4.0)
if (CMAKE_VERSION VERSION_GREATER "3.11.99")
cmake_policy(SET CMP0074 NEW)
endif()
project(slycot VERSION ${SLYCOT_VERSION} LANGUAGES NONE)
# Fortran detection fails on windows, use the CMAKE_C_SIMULATE flag to
# force success
if(WIN32)
set(CMAKE_Fortran_SIMULATE_VERSION 19.0)
endif()
# this does not seem to work, maybe scikit-build's doing? the cxx compiler is
# still tested
enable_language(C)
enable_language(Fortran)
find_package(PythonLibs REQUIRED)
find_package(NumPy REQUIRED)
#set(BLA_VENDOR "OpenBLAS")
find_package(LAPACK REQUIRED)
message(STATUS "LAPACK: ${LAPACK_LIBRARIES}")
message(STATUS "Slycot version: ${SLYCOT_VERSION}")
# find python, standard packages, F2PY find flaky on Windows
if (NOT WIN32)
find_package(F2PY REQUIRED)
endif()
# pic option for flang not correct, remove for Windows
if (WIN32)
set(CMAKE_Fortran_COMPILE_OPTIONS_PIC "")
endif()
# base site dir, use python installation for location specific includes
execute_process(
COMMAND "${PYTHON_EXECUTABLE}" -c
"from distutils.sysconfig import get_python_lib as pl; print(pl())"
OUTPUT_VARIABLE PYTHON_SITE
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(WIN32)
string(REPLACE "\\" "/" PYTHON_SITE ${PYTHON_SITE})
endif()
add_subdirectory(slycot)