-
Notifications
You must be signed in to change notification settings - Fork 121
/
CMakeLists.txt
44 lines (35 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
cmake_minimum_required(VERSION 3.8)
project(ephem)
set(ASTRO_VERSION 4.0.0)
set(ASTRO_VERSION_MAJOR 4)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
set(BUILD_SHARED_LIBS TRUE)
if (UNIX)
set(CMAKE_C_FLAGS_RELEASE "-Wall -O3")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden")
elseif(WIN32)
set (CMAKE_C_FLAGS_RELEASE "/O2 /D NDEBUG")
endif()
file(GLOB SOURCE_FILES
libastro/*.c
extensions/dtoa.c extensions/data/*.c)
add_library(astro SHARED ${SOURCE_FILES})
set_target_properties(astro PROPERTIES
VERSION ${ASTRO_VERSION}
SOVERSION ${ASTRO_VERSION_MAJOR})
target_include_directories(astro PRIVATE
${CMAKE_SOURCE_DIR}/libastro
${CMAKE_BINARY_DIR})
if (UNIX)
target_link_libraries(astro PRIVATE m)
endif()
include(GenerateExportHeader)
generate_export_header(astro)
install(TARGETS astro
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/astro_export.h
${CMAKE_SOURCE_DIR}/libastro/astro.h
DESTINATION include)