forked from trmrsh/cpp-binary
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
87 lines (71 loc) · 2.29 KB
/
CMakeLists.txt
File metadata and controls
87 lines (71 loc) · 2.29 KB
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
cmake_minimum_required(VERSION 3.23)
project(cpp-binary)
include(ExternalProject)
message("\nCMakeLists.txt for cpp-binary")
message("PROJECT_SOURCE_DIR: ${PROJECT_SOURCE_DIR}")
message("CMAKE_BINARY_DIR: ${CMAKE_BINARY_DIR}")
set(PACKAGE_NAME binary)
############################################################
# Define sources
############################################################
set(SOURCES
src/eclipses.cc
src/orbital_ang_mom.cc
src/rcirc.cc
src/jdotgr.cc
src/mr_main_sequence.cc
src/orbital_omega.cc
src/rmin.cc
src/kepler_omega.cc
src/mr_wd_eggleton.cc
src/orbital_period.cc
src/zeta_wd_eggleton.cc
src/mr_wd_nauenberg.cc
src/orbital_separation.cc
src/zeta_main_sequence.cc
src/zeta_wd_nauenberg.cc
src/gyrate.cc
src/vellipse.cc
)
############################################################
# Check for and install dependencies
############################################################
# Configure the PLPLOT library
if(NOT DEFINED CMAKE_COMMON)
set(CMAKE_COMMON ${PROJECT_SOURCE_DIR}/../../cmake_common)
endif()
if(NOT DEFINED PLPLOT_FOUND)
include("${CMAKE_COMMON}/plplot_install.cmake")
endif()
############################################################
# Define the library
############################################################
add_library(${PACKAGE_NAME} SHARED
${SOURCES}
)
target_include_directories(${PACKAGE_NAME}
PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
${PLPLOT_INCLUDE_DIR}
)
target_link_libraries(${PACKAGE_NAME}
PUBLIC
subs
# potentially link plplot here too
)
# Set RPATH properties
# set_target_properties(${PACKAGE_NAME} PROPERTIES
# INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib"
# INSTALL_RPATH_USE_LINK_PATH TRUE
# )
############################################################
# Create an executable
############################################################
# No executable in this code, this is a library
############################################################
# Install
############################################################
include("${CMAKE_COMMON}/install_lib.cmake") # Get the generic install function
install_lib(${PACKAGE_NAME})
message("cpp-binary CMakeLists.txt complete\n")