option(ENABLE_LIBSVN "Set to ON to build FlightGear/terrasync with libsvnclient support (default)" ON)
option(ENABLE_RTI "Set to ON to build FlightGear with RTI support" OFF)
option(JPEG_FACTORY "Set to ON to build FlightGear with JPEG-factory support" OFF)
+option(SYSTEM_SQLITE "Set to ON to build FlightGear with the system's SQLite3 library" OFF)
# additional utilities
option(ENABLE_FGADMIN "Set to ON to build the FGADMIN application (default)" ON)
endif(LIBSVN_FOUND)
endif(ENABLE_LIBSVN)
+if (SYSTEM_SQLITE)
+ find_package(SQLite3 REQUIRED)
+ set(CMAKE_REQUIRED_INCLUDES ${SQLITE3_INCLUDED_DIR})
+ message(STATUS "Using system SQLite3 library")
+endif (SYSTEM_SQLITE)
+
find_package(PLIB REQUIRED puaux pu js fnt)
# FlightGear and SimGear versions need to match
--- /dev/null
+# Find Sqlite3
+# ~~~~~~~~~~~~
+# Copyright (c) 2007, Martin Dobias <wonder.sk at gmail.com>
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+#
+# CMake module to search for Sqlite3 library
+#
+# If it's found it sets SQLITE3_FOUND to TRUE
+# and following variables are set:
+# SQLITE3_INCLUDE_DIR
+# SQLITE3_LIBRARY
+
+
+# FIND_PATH and FIND_LIBRARY normally search standard locations
+# before the specified paths. To search non-standard paths first,
+# FIND_* is invoked first with specified paths and NO_DEFAULT_PATH
+# and then again with no specified paths to search the default
+# locations. When an earlier FIND_* succeeds, subsequent FIND_*s
+# searching for the same item do nothing.
+
+FIND_PATH(SQLITE3_INCLUDE_DIR sqlite3.h
+ PATH_SUFFIXES include
+ HINTS $ENV{SQLITE3DIR}
+ PATHS
+ /usr/local
+ /usr
+ /opt/local
+ )
+
+FIND_LIBRARY(SQLITE3_LIBRARY NAMES sqlite3 sqlite3
+ HINTS $ENV{SQLITE3DIR}
+ PATH_SUFFIXES lib64 lib libs64 libs libs/Win32 libs/Win64
+ PATHS
+ /usr/local
+ /usr
+ /opt/local
+ )
+
+include(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(SQLITE3 DEFAULT_MSG SQLITE3_LIBRARY SQLITE3_INCLUDE_DIR)
LevelDXML.cxx
FlightPlan.cxx
NavDataCache.cxx
- sqlite3.c
PositionedOctree.cxx
)
LevelDXML.hxx
FlightPlan.hxx
NavDataCache.hxx
- sqlite3.h
PositionedOctree.hxx
)
+if (NOT SYSTEM_SQLITE)
+ list(APPEND SOURCES sqlite3.c)
+ list(APPEND HEADERS sqlite3.h)
+endif()
+
flightgear_component(Navaids "${SOURCES}" "${HEADERS}")
\ No newline at end of file