-
Notifications
You must be signed in to change notification settings - Fork 15
/
CMakeLists.txt
59 lines (49 loc) · 1.62 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
# Name of project
project(wignerSymbols)
enable_testing()
set (wignerSymbols_VERSION_MAJOR 0)
set (wignerSymbols_VERSION_MINOR 2)
set (wignerSymbols_VERSION_RELEASE 0)
# CMake config
cmake_minimum_required(VERSION 2.8)
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set (CMAKE_INSTALL_PREFIX /usr)
endif()
# Compiler config
enable_language (Fortran)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -Wall -Wextra -Wpedantic -Werror -march=native")
# Coverage report
option(WITH_COVERAGE "Generate code coverage report" OFF)
if(WITH_COVERAGE)
set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Choose the build type" FORCE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")
link_libraries(gcov)
endif()
# Included files
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
# Source files
aux_source_directory(./src SRC_LIST)
# Build a shared library
add_library(${PROJECT_NAME} SHARED
${SRC_LIST}
"./src/wignerSymbols-fortran.f"
"./src/machine.for"
"./src/fdump.f"
"./src/j4save.f"
"./src/xercnt.f"
"./src/xerhlt.f"
"./src/xermsg.f"
"./src/xerprn.f"
"./src/xersve.f"
"./src/xgetua.f"
"./src/wignerSymbols-fortran-c-binding.f90" )
SET_TARGET_PROPERTIES(${PROJECT_NAME}
PROPERTIES
VERSION ${wignerSymbols_VERSION_MAJOR}.${wignerSymbols_VERSION_MINOR}.${wignerSymbols_VERSION_RELEASE}
SOVERSION ${wignerSymbols_VERSION_MAJOR}.${wignerSymbols_VERSION_MINOR}.${wignerSymbols_VERSION_RELEASE})
if(BUILD_TESTING)
add_subdirectory(tests)
endif()
# Install directories
install(TARGETS ${PROJECT_NAME} DESTINATION lib)
install(DIRECTORY include/ DESTINATION include)