-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
45 lines (31 loc) · 1.12 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
cmake_minimum_required(VERSION 3.19...3.29)
project(RPNcalc
LANGUAGES Fortran
VERSION 1.4.1
)
enable_testing()
option(${PROJECT_NAME}_BUILD_TESTING "build tests" on)
include(cmake/compilers.cmake)
file(GENERATE OUTPUT .gitignore CONTENT "*")
set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include)
add_executable(rpncalc app/main.f90 src/help.f90 src/eval.f90 src/ui.f90)
target_include_directories(rpncalc PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
target_link_libraries(rpncalc PRIVATE assert hyper reg funcs)
#--- functions (usable in other programs too)
add_library(assert OBJECT src/assert.F90)
target_include_directories(assert PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
target_compile_definitions(assert PRIVATE $<$<NOT:$<BOOL:${f03ieee}>>:NO_IEEE>)
add_subdirectory(src)
if(${PROJECT_NAME}_BUILD_TESTING)
add_subdirectory(test)
endif()
#--- install
install(TARGETS rpncalc)
install(FILES ${PROJECT_SOURCE_DIR}/README.md
DESTINATION share/docs/${PROJECT_NAME})