forked from jbaayen/fitpackpp
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
53 lines (38 loc) · 1.16 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
cmake_minimum_required(VERSION 3.0.0)
# FITPACK FORTRAN code
enable_language(Fortran)
if(${CMAKE_Fortran_COMPILER} MATCHES "ifort.*")
set(CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS} -fltconsistency")
set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS} -fltconsistency")
endif()
if (CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
endif()
file(GLOB fitpack_SRC fitpack/*.f)
add_library(fitpack
STATIC ${fitpack_SRC}
)
enable_language(CXX)
# C++ interface
include(FortranCInterface)
FortranCInterface_HEADER(FCMangle.h
MACRO_NAMESPACE "FC_"
SYMBOL_NAMESPACE ""
SYMBOLS curfit splev splder surfit bispev parder regrid)
FortranCInterface_VERIFY(CXX)
# For FCMangle.h
include_directories(${CMAKE_CURRENT_BINARY_DIR})
include_directories(${CMAKE_SOURCE_DIR}/include)
file(GLOB fitpackpp_SRC src/*.cpp)
add_library(fitpackpp
STATIC ${fitpackpp_SRC}
)
target_link_libraries(fitpackpp fitpack)
install(TARGETS fitpack fitpackpp
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)
file(GLOB fitpackpp_INC ${CMAKE_SOURCE_DIR}/include/fitpackpp/*.h)
install(FILES ${fitpackpp_INC}
DESTINATION include/fitpackpp
)