-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathCMakeLists.txt
97 lines (86 loc) · 1.89 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
86
87
88
89
90
91
92
93
94
95
96
97
cmake_minimum_required(VERSION 3.0)
project(cquadpack)
include_directories(include)
set(source_files
src/dqag.c
src/dqage.c
src/dqagi.c
src/dqagp.c
src/dqags.c
src/dqawc.c
src/dqawce.c
src/dqawf.c
src/dqawfe.c
src/dqawo.c
src/dqaws.c
src/dqawse.c
src/dqc25c.c
src/dqc25o.c
src/dqc25s.c
src/dqcheb.c
src/dqext.c
src/dqfour.c
src/dqk15.c
src/dqk15i.c
src/dqk15w.c
src/dqk21.c
src/dqk31.c
src/dqk41.c
src/dqk51.c
src/dqk61.c
src/dqmomo.c
src/dqng.c
src/dqsort.c
src/dqwgt.c
)
set(header_files
include/cquadpack.h
)
add_library(cquadpack ${source_files} ${header_files})
if (${BUILD_SHARED_LIBS})
# Shared library
message(STATUS "Will compile the library in shared mode")
set_property(TARGET cquadpack PROPERTY POSITION_INDEPENDENT_CODE 1)
else()
# Static library
message(STATUS "Will compile the library in static mode")
add_definitions(-DCQUADPACK_STATIC_DEFINE)
endif()
# Add export header
include(GenerateExportHeader)
generate_export_header(cquadpack)
include_directories(${PROJECT_BINARY_DIR})
set(tests
dq4tst
dqaget
dqagit
# dqagpt
dqagst
dqagtst
dqawct
dqawft
dqawot
dqawst
dqct
dqngt
)
enable_testing()
foreach(test_target ${tests})
add_executable(${test_target} test/${test_target}.c ${header_files})
add_test(NAME ${test_target} COMMAND $<TARGET_FILE:${test_target}> --exe)
target_link_libraries(${test_target} cquadpack)
endforeach(test_target)
# Add the math libraries (gcc requires this)
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Windows")
target_link_libraries(cquadpack m)
endif()
install(TARGETS cquadpack
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)
install(FILES
include/cquadpack.h
${PROJECT_BINARY_DIR}/cquadpack_export.h
DESTINATION include
)