This repository was archived by the owner on Nov 20, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 88
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
47 lines (42 loc) · 1.34 KB
/
CMakeLists.txt
File metadata and controls
47 lines (42 loc) · 1.34 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
# Copyright (C) 2007-2012 LuaDist.
# Created by Peter Kapec
# Redistribution and use of this file is allowed according to the terms of the MIT license.
# For details see the COPYRIGHT file distributed with LuaDist.
# Please note that the package source code is licensed under its own license.
# Project
project ( sqlite3 C )
cmake_minimum_required ( VERSION 2.8 )
include ( cmake/dist.cmake )
# SQLite configuration
find_package ( Threads )
if ( Threads_FOUND )
if ( CMAKE_USE_PTHREADS_INIT )
add_definitions ( -D_REENTRANT=1 -DTHREADSAFE=1 )
set ( EXTRA_LIBS ${CMAKE_THREAD_LIBS_INIT} )
endif ( )
endif ( )
find_package ( Readline )
if ( READLINE_FOUND )
include_directories ( ${READLINE_INCLUDE_DIRS} )
endif ( )
# Add dl on unix systems
if ( UNIX )
set ( EXTRA_LIBS ${EXTRA_LIBS} dl )
endif ( )
# SQLite Library
add_library ( sqlite3 sqlite3.c )
if ( CMAKE_USE_PTHREADS_INIT )
target_link_libraries ( sqlite3 ${EXTRA_LIBS} )
endif ( )
install_library ( sqlite3 )
# Install Headers
install_header ( sqlite3.h sqlite3ext.h )
# SQLite client
add_executable ( sqlite-app shell.c )
set_target_properties ( sqlite-app PROPERTIES OUTPUT_NAME sqlite CLEAN_DIRECT_OUTPUT
1 )
target_link_libraries ( sqlite-app sqlite3 )
if ( READLINE_LIBRARIES )
target_link_libraries ( sqlite-app ${READLINE_LIBRARIES} )
endif ( )
install_executable ( sqlite-app )