mirror of
https://github.com/pocoproject/poco.git
synced 2025-03-22 05:33:32 +01:00
cmake build: POCO_UNBUNDLED support for sqlite
This commit is contained in:
parent
31c7bb6c52
commit
1d8e75687e
@ -1,3 +1,8 @@
|
||||
# POCO_BUILD_TYPE
|
||||
# POCO_STATIC
|
||||
# POCO_UNBUNDLED
|
||||
# POCO_NO_LOCALE
|
||||
|
||||
PROJECT(Poco)
|
||||
|
||||
cmake_minimum_required(VERSION 2.8.0)
|
||||
@ -11,6 +16,13 @@ SET(COMPLETE_VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINO
|
||||
SET(RELEASE_NAME "Unstable-trunk")
|
||||
SET(PROJECT_VERSION ${COMPLETE_VERSION})
|
||||
|
||||
# Put the libaries and binaries that get built into directories at the
|
||||
# top of the build tree rather than in hard-to-find leaf
|
||||
# directories. This simplifies manual testing and the use of the build
|
||||
# tree rather than installed Boost libraries.
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
||||
|
||||
#################################################################################
|
||||
# Setup C/C++ compiler options
|
||||
#################################################################################
|
||||
@ -50,6 +62,9 @@ option(ENABLE_TESTS
|
||||
option(POCO_STATIC
|
||||
"Set to OFF|ON (default is OFF) to control build of POCO as STATIC library" OFF)
|
||||
|
||||
option(POCO_UNBUNDLED
|
||||
"Set to OFF|ON (default is OFF) to control linking dependencies as external" OFF)
|
||||
|
||||
# Uncomment from next two lines to force statitc or dynamic library, default is autodetection
|
||||
if(POCO_STATIC)
|
||||
set( LIB_MODE STATIC )
|
||||
@ -67,6 +82,13 @@ ELSE ()
|
||||
message(STATUS "Building without tests & samples")
|
||||
ENDIF ()
|
||||
|
||||
IF (!POCO_UNBUNDLED)
|
||||
message(STATUS "Build with using internal copy of sqlite, libz, pcre, expat, ...")
|
||||
ELSE ()
|
||||
add_definitions( -DPOCO_UNBUNDLED)
|
||||
message(STATUS "Build with using external sqlite, libz, pcre, expat ...")
|
||||
ENDIF ()
|
||||
|
||||
# Set local include path
|
||||
include_directories( CppUnit/include Foundation/include XML/include Net/include NetSSL_OpenSSL/include Util/include Data/include WebWidgets/include Zip/include Crypto/include Web/include)
|
||||
|
||||
|
@ -3,8 +3,23 @@ set(LIBNAME "${LIBNAME}${LIB_EXT}")
|
||||
|
||||
include_directories( include src )
|
||||
|
||||
set(SRCS "")
|
||||
aux_source_directory(src SRCS)
|
||||
set(SRCS
|
||||
src/Binder.cpp
|
||||
src/Connector.cpp
|
||||
src/Extractor.cpp
|
||||
src/SQLiteException.cpp
|
||||
src/SQLiteStatementImpl.cpp
|
||||
src/SessionImpl.cpp
|
||||
src/Utility.cpp
|
||||
)
|
||||
|
||||
|
||||
if (!POCO_UNBUNDLED)
|
||||
set(SRCS "${SRCS} src/sqlite3.c")
|
||||
set(DATASQLITELIBS PocoData${LIB_EXT} PocoFoundation${LIB_EXT} )
|
||||
else()
|
||||
set(DATASQLITELIBS PocoData${LIB_EXT} PocoFoundation${LIB_EXT} sqlite3)
|
||||
endif()
|
||||
|
||||
add_definitions(-DSQLITE_THREADSAFE=1 -DSQLITE_DISABLE_LFS -DSQLITE_OMIT_UTF16 -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_COMPLETE -DSQLITE_OMIT_TCL_VARIABLE -DSQLITE_OMIT_DEPRECATED)
|
||||
|
||||
@ -12,7 +27,7 @@ add_library( ${LIBNAME} ${LIB_MODE} ${SRCS} )
|
||||
set_target_properties( ${LIBNAME}
|
||||
PROPERTIES
|
||||
VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} )
|
||||
target_link_libraries( ${LIBNAME} PocoData${LIB_EXT} PocoFoundation${LIB_EXT})
|
||||
target_link_libraries( ${LIBNAME} ${DATASQLITELIBS} )
|
||||
|
||||
install(
|
||||
DIRECTORY include/Poco
|
||||
|
@ -1,24 +1,30 @@
|
||||
#
|
||||
# Makefile
|
||||
#
|
||||
# $Id: //poco/Main/Data/SQLite/Makefile#4 $
|
||||
#
|
||||
# Makefile for Poco SQLite
|
||||
#
|
||||
|
||||
include $(POCO_BASE)/build/rules/global
|
||||
|
||||
SYSFLAGS += -DSQLITE_THREADSAFE=1 -DSQLITE_OMIT_UTF16 -DSQLITE_OMIT_PROGRESS_CALLBACK \
|
||||
-DSQLITE_OMIT_COMPLETE -DSQLITE_OMIT_TCL_VARIABLE -DSQLITE_OMIT_DEPRECATED
|
||||
#
|
||||
# Makefile
|
||||
#
|
||||
# $Id: //poco/1.4/Data/SQLite/Makefile#2 $
|
||||
#
|
||||
# Makefile for Poco SQLite
|
||||
#
|
||||
|
||||
INCLUDE += -Isrc
|
||||
|
||||
objects = Binder Extractor SessionImpl Connector \
|
||||
SQLiteException SQLiteStatementImpl Utility \
|
||||
sqlite3
|
||||
|
||||
target = PocoDataSQLite
|
||||
target_version = $(LIBVERSION)
|
||||
target_libs = PocoData PocoFoundation
|
||||
|
||||
include $(POCO_BASE)/build/rules/lib
|
||||
include $(POCO_BASE)/build/rules/global
|
||||
|
||||
SYSFLAGS += -DSQLITE_THREADSAFE=1 -DSQLITE_DISABLE_LFS \
|
||||
-DSQLITE_OMIT_UTF16 -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_COMPLETE \
|
||||
-DSQLITE_OMIT_TCL_VARIABLE -DSQLITE_OMIT_DEPRECATED
|
||||
|
||||
objects = Binder Extractor SessionImpl Connector \
|
||||
SQLiteException SQLiteStatementImpl Utility
|
||||
|
||||
sqlite_objects = sqlite3
|
||||
|
||||
ifdef POCO_UNBUNDLED
|
||||
SYSLIBS += -lsqlite3
|
||||
else
|
||||
objects += $(sqlite_objects)
|
||||
endif
|
||||
|
||||
target = PocoDataSQLite
|
||||
target_version = $(LIBVERSION)
|
||||
target_libs = PocoData PocoFoundation
|
||||
|
||||
include $(POCO_BASE)/build/rules/lib
|
||||
|
@ -1,42 +1,56 @@
|
||||
#
|
||||
# Makefile
|
||||
#
|
||||
# $Id: //poco/svn/Foundation/Makefile#2 $
|
||||
# $Id: //poco/1.4/Foundation/Makefile#4 $
|
||||
#
|
||||
# Makefile for Poco Foundation
|
||||
#
|
||||
|
||||
include $(POCO_BASE)/build/rules/global
|
||||
|
||||
objects = ArchiveStrategy Ascii ASCIIEncoding AsyncChannel AtomicCounter Base64Decoder Base64Encoder \
|
||||
objects = ArchiveStrategy Ascii ASCIIEncoding AsyncChannel Base64Decoder Base64Encoder \
|
||||
BinaryReader BinaryWriter Bugcheck ByteOrder Channel Checksum Configurable ConsoleChannel \
|
||||
CountingStream DateTime LocalDateTime DateTimeFormat DateTimeFormatter DateTimeParser \
|
||||
Debugger DeflatingStream DigestEngine DigestStream DirectoryIterator \
|
||||
Environment Event EventArgs ErrorHandler Exception FPEnvironment File Glob \
|
||||
FileChannel Formatter FormattingChannel HexBinaryDecoder LineEndingConverter \
|
||||
HexBinaryEncoder InflatingStream Latin1Encoding Latin2Encoding Latin9Encoding LogFile Logger \
|
||||
HexBinaryEncoder InflatingStream Latin1Encoding Latin9Encoding LogFile Logger \
|
||||
LoggingFactory LoggingRegistry LogStream NamedEvent NamedMutex NullChannel \
|
||||
MemoryPool MD4Engine MD5Engine Manifest MemoryStream Message Mutex \
|
||||
MemoryPool MD4Engine MD5Engine Manifest Message Mutex \
|
||||
NestedDiagnosticContext Notification NotificationCenter \
|
||||
TimedNotificationQueue PriorityNotificationQueue \
|
||||
NotificationQueue NullStream NumberFormatter NumberParser AbstractObserver \
|
||||
NotificationQueue PriorityNotificationQueue TimedNotificationQueue \
|
||||
NullStream NumberFormatter NumberParser AbstractObserver \
|
||||
Path PatternFormatter Process PurgeStrategy RWLock Random RandomStream \
|
||||
RegularExpression RefCountedObject Runnable RotateStrategy Condition \
|
||||
SHA1Engine Semaphore SharedLibrary SimpleFileChannel \
|
||||
SignalHandler SplitterChannel Stopwatch StreamChannel StreamConverter StreamCopier \
|
||||
StreamTokenizer String StringTokenizer SynchronizedObject \
|
||||
Task TaskManager TaskNotification TeeStream Hash HashStatistic \
|
||||
TemporaryFile TextConverter TextEncoding TextBufferIterator TextIterator Thread ThreadLocal \
|
||||
TemporaryFile TextConverter TextEncoding TextIterator TextBufferIterator Thread ThreadLocal \
|
||||
ThreadPool ThreadTarget ActiveDispatcher Timer Timespan Timestamp Timezone Token URI \
|
||||
FileStreamFactory URIStreamFactory URIStreamOpener UTF16Encoding Windows1250Encoding Windows1251Encoding Windows1252Encoding \
|
||||
UTF8Encoding UnicodeConverter UUID UUIDGenerator Var VarHolder Void Format \
|
||||
Pipe PipeImpl PipeStream SharedMemory FileStream Unicode UTF8String \
|
||||
adler32 compress crc32 deflate gzclose gzlib gzread gzwrite infback inffast inflate inftrees trees uncompr zutil \
|
||||
pcre_chartables pcre_compile pcre_globals pcre_maketables pcre_study \
|
||||
pcre_tables pcre_try_flipped pcre_ucd pcre_valid_utf8 \
|
||||
FileStreamFactory URIStreamFactory URIStreamOpener UTF16Encoding Windows1252Encoding \
|
||||
UTF8Encoding UnicodeConverter UUID UUIDGenerator Void Format \
|
||||
Pipe PipeImpl PipeStream DynamicAny DynamicAnyHolder SharedMemory \
|
||||
MemoryStream FileStream Unicode UTF8String AtomicCounter \
|
||||
Windows1250Encoding Windows1251Encoding Latin2Encoding
|
||||
|
||||
zlib_objects = adler32 compress crc32 deflate \
|
||||
infback inffast inflate inftrees trees zutil
|
||||
|
||||
pcre_objects = pcre_chartables pcre_compile pcre_globals pcre_maketables \
|
||||
pcre_study pcre_try_flipped pcre_valid_utf8 \
|
||||
pcre_exec pcre_ord2utf8 pcre_newline pcre_fullinfo pcre_xclass
|
||||
|
||||
ifeq ($(POCO_CONFIG),MinGW)
|
||||
pcre_utf8_objects = pcre_ucd pcre_tables
|
||||
|
||||
ifdef POCO_UNBUNDLED
|
||||
objects += $(pcre_utf8_objects)
|
||||
SYSLIBS += -lpcre -lz
|
||||
else
|
||||
objects += $(zlib_objects) $(pcre_objects) $(pcre_utf8_objects)
|
||||
endif
|
||||
|
||||
ifeq ($(findstring MinGW, $(POCO_CONFIG)), MinGW)
|
||||
objects += EventLogChannel WindowsConsoleChannel
|
||||
else
|
||||
objects += SyslogChannel
|
||||
|
Loading…
x
Reference in New Issue
Block a user