-
Notifications
You must be signed in to change notification settings - Fork 166
/
Copy pathCMakeLists.txt
38 lines (29 loc) · 1.14 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
CMAKE_MINIMUM_REQUIRED(VERSION 3.0.0)
PROJECT(unqlite)
INCLUDE(GNUInstallDirs)
# If the user did not customize the install prefix,
# set it to live under build so we don't inadvertently pollute /usr/local
IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
SET(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE PATH "default install path" FORCE)
ENDIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
OPTION(ENABLE_THREADS "Enable threads" OFF)
IF(${ENABLE_THREADS})
ADD_DEFINITIONS("-DUNQLITE_ENABLE_THREADS")
ENDIF(${ENABLE_THREADS})
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_LIST_DIR}/src)
SET(HEADERS_UNQLITE
unqlite.h
)
source_group("Header Files" FILES "${HEADERS_UNQLITE}")
SET(SOURCES_UNQLITE
unqlite.c
)
source_group("Source Files" FILES "${SOURCES_UNQLITE}")
SET(UNQLITE_STATIC_LIB unqlite)
ADD_LIBRARY(${UNQLITE_STATIC_LIB} ${HEADERS_UNQLITE} ${SOURCES_UNQLITE})
INSTALL(TARGETS ${UNQLITE_STATIC_LIB} COMPONENT devel ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}")
INSTALL(FILES ${HEADERS_UNQLITE} COMPONENT devel DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
include(CTest)
if (BUILD_TESTING)
add_subdirectory("example")
endif (BUILD_TESTING)