-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathCMakeLists.txt
30 lines (25 loc) · 982 Bytes
/
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
cmake_minimum_required(VERSION 3.1)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
project(ballistics C CXX)
include_directories(include)
add_subdirectory(test)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -finline-functions -O3")
add_executable(example example.c)
target_link_libraries(example PRIVATE m ballistics)
#install(TARGETS example DESTINATION bin)
add_library(ballistics STATIC
angle.c
atmosphere.c
ballistics.c
pbr.c
)
target_link_libraries(ballistics PRIVATE m)
set_target_properties(ballistics PROPERTIES LINK_FLAGS "-Wl,--whole-archive")
install(TARGETS ballistics DESTINATION lib)
install(DIRECTORY include/ballistics DESTINATION include)
# To workaround the fact CLion doesn't have a way to do `make install`:
add_custom_target(install_${PROJECT_NAME}
${CMAKE_MAKE_PROGRAM} install
DEPENDS ${PROJECT_NAME}
COMMENT "Installing ${PROJECT_NAME}")