-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathCMakeLists.txt
96 lines (82 loc) · 1.9 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
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
88
89
90
91
92
93
94
95
96
# swephelp CMakeLists.txt
cmake_minimum_required( VERSION 3.10 )
project( swephelp )
message( STATUS "-- Configuring swephelp..." )
# Configure swisseph
if ( NOT LIBSWE_INCLUDE_PATH )
if ( WIN32 )
set( LIBSWE_INCLUDE_PATH
"C:\\swisseph"
CACHE STRING "Path to swisseph header files" )
else()
set( LIBSWE_INCLUDE_PATH
"/usr/local/include/swisseph"
CACHE STRING "Path to swisseph header files" )
endif()
endif()
# Find sqlite3
if ( NOT MSVC )
find_package( PkgConfig )
pkg_check_modules( SQLITE3 sqlite3 )
if ( NOT SQLITE3_FOUND )
message( STATUS "... Using internal sqlite3" )
add_subdirectory( sqlite3 )
include_directories( BEFORE sqlite3 )
else()
include_directories( BEFORE ${SQLITE3_INCLUDE_DIRS} )
endif()
else()
add_subdirectory( sqlite3 )
include_directories( BEFORE sqlite3 )
endif()
# Options
option( SWH_DB_TRACE
"Print debug info (db)"
OFF )
if ( SWH_DB_TRACE )
add_definitions( -DSWH_DB_TRACE )
endif()
set( SOURCES
swhaspect.c
swhatlas.c
swhdatetime.c
swhdb.c
swhdbxx.cpp
swhformat.c
swhgeo.c
swhmisc.c
swhraman.c
swhsearch.c
swhtimezone.c
swhxx.cpp )
set( HEADERS
swephelp.h
swhaspect.h
swhatlas.h
swhdatetime.h
swhdb.h
swhdbxx.h
swhdbxx.hpp
swhdef.h
swhformat.h
swhgeo.h
swhmisc.h
swhraman.h
swhsearch.h
swhtimezone.h
swhwin.h
swhxx.h
swhxx.hpp )
include_directories( BEFORE . ${LIBSWE_INCLUDE_PATH} )
if ( MSVC )
add_definitions( -D_CRT_SECURE_NO_WARNINGS )
else()
add_definitions( -g -O3 -Wall )
if ( NOT MINGW )
add_definitions( -fPIC )
endif()
endif()
add_library( swephelp STATIC ${SOURCES} )
install( TARGETS swephelp ARCHIVE DESTINATION lib )
install( FILES ${HEADERS} DESTINATION include/swephelp )
# vi: sw=4 ts=4 et