This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
yap-6.3/packages/myddas/sqlite3/CMakeLists.txt

82 lines
1.9 KiB
CMake
Raw Normal View History

2015-11-05 17:06:15 +00:00
2018-06-18 12:16:36 +01:00
2019-01-09 13:59:58 +00:00
if (WITH_SQLITE3)
2018-11-23 10:55:05 +00:00
set (SQLITE_TEST
sqlitest.yap)
2015-11-05 17:06:15 +00:00
2018-11-23 10:55:05 +00:00
set (SQLITE_DB chinook.db)
set( YAPSQLITE3_SOURCES
myddas_sqlite3.c
)
2018-02-15 00:02:44 +00:00
2019-01-09 13:59:58 +00:00
message( " * Sqlite3 Data-Base (http://www.sqlite3.org), distributed with MYDDAS" )
2019-01-09 09:32:09 +00:00
add_to_dir(SQLITE_DB ${YAP_INSTALL_DATADIR})
add_to_dir( SQLITE_TEST ${YAP_INSTALL_DATADIR})
2016-11-11 07:23:34 +00:00
#sqlite3 is now in the system
2016-11-11 07:23:34 +00:00
set (SQLITE3_FOUND ON CACHE PRIVATE "")
2016-11-11 07:23:34 +00:00
2019-01-09 09:32:09 +00:00
set_property(DIRECTORY
APPEND PROPERTY
2019-01-09 13:59:58 +00:00
INCLUDE_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/src )
2017-09-19 13:19:13 +01:00
2016-11-11 07:23:34 +00:00
add_definitions(-DSQLITE_ENABLE_COLUMN_METADATA=1 )
2016-11-11 07:23:34 +00:00
add_definitions(-DSQLITE_ENABLE_JSON1=1 )
2016-11-11 07:23:34 +00:00
add_definitions(-DSQLITE_ENABLE_RBU=1 )
2016-11-11 07:23:34 +00:00
add_definitions(-DSQLITE_ENABLE_RTREE=1 )
add_definitions(-DSQLITE_ENABLE_FTS5=1 )
2016-11-11 07:23:34 +00:00
SET_PROPERTY(DIRECTORY PROPERTY COMPILE_DEFINITIONS YAP_KERNEL=1 )
2019-01-09 13:59:58 +00:00
message("ql ${EMBEDDED_SQLITE3}")
message( " * Sqlite3 Data-Base (http://www.sqlite3.org), distributed with MYDDAS" )
if ( ANDROID )
add_definitions(-DSQLITE_FCNTL_MMAP_SIZE=0 )
2019-04-05 18:31:45 +01:00
file(MAKE_DIRECTORY ${YAP_INSTALL_DATADIR}/myddas)
file(COPY ${SQLITE_DB} ${SQLITE_TEST}
DESTINATION ${YAP_INSTALL_DATADIR}/myddas)
2016-11-11 15:53:09 +00:00
2019-01-09 13:59:58 +00:00
add_library( YAPsqlite3 OBJECT
${YAPSQLITE3_SOURCES} )
else()
2018-02-15 00:02:44 +00:00
2019-01-09 13:59:58 +00:00
list(APPEND YAPSQLITE3_SOURCES src/sqlite3.c)
add_library( YAPsqlite3 SHARED
${YAPSQLITE3_SOURCES})
2018-07-02 15:20:17 +01:00
target_link_libraries(YAPsqlite3 libYap )
2017-07-25 01:10:44 +01:00
set_target_properties(YAPsqlite3
PROPERTIES
2018-11-16 14:02:56 +00:00
# RPATH ${CMAKE_INSTALL_LIBDIR} VERSION ${LIBYAPTAI_FULL_VERSION}
# SOVERSION ${LIBYAPTAI_MAJOR_VERSION}.${LIBYAPTAI_MINOR_VERSION}
POSITION_INDEPENDENT_CODE ON
PREFIX ""
)
install(TARGETS YAPsqlite3
2018-11-16 14:02:56 +00:00
RUNTIME DESTINATION ${YAP_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${YAP_INSTALL_LIBDIR}
LIBRARY DESTINATION ${YAP_INSTALL_LIBDIR}
)
endif()
2018-03-19 15:41:06 +00:00
2019-04-05 18:31:45 +01:00
install(FILES ${SQLITE_DB} ${SQLITE_TEST}
DESTINATION ${YAP_INSTALL_DATADIR}/myddas
)
2018-11-23 10:55:05 +00:00
endif()