2016-09-19 06:50:08 +03:00
|
|
|
cmake_minimum_required(VERSION 3.0)
|
|
|
|
project(sqlite3 C)
|
|
|
|
|
|
|
|
include_directories(${SOURCE})
|
2016-10-18 23:09:04 +03:00
|
|
|
if(BUILD_SHARED_LIBS)
|
|
|
|
set(API "-DSQLITE_API=__declspec(dllexport)")
|
|
|
|
else()
|
|
|
|
set(API "-DSQLITE_API=extern")
|
|
|
|
endif()
|
|
|
|
add_library(sqlite3 ${SOURCE}/sqlite3.c)
|
|
|
|
|
|
|
|
|
2016-10-18 23:01:48 +03:00
|
|
|
target_compile_definitions(sqlite3 PRIVATE
|
2016-10-18 23:09:04 +03:00
|
|
|
$<$<CONFIG:Debug>:-DSQLITE_DEBUG>
|
|
|
|
${API}
|
2016-10-18 23:01:48 +03:00
|
|
|
-DSQLITE_ENABLE_RTREE
|
|
|
|
-DSQLITE_ENABLE_UNLOCK_NOTIFY
|
|
|
|
)
|
2016-10-19 07:42:21 +03:00
|
|
|
target_include_directories(sqlite3 INTERFACE $<INSTALL_INTERFACE:include>)
|
2016-09-19 06:50:08 +03:00
|
|
|
if(TRIPLET_SYSTEM_NAME MATCHES "WindowsStore")
|
|
|
|
target_compile_definitions(sqlite3 PRIVATE -DSQLITE_OS_WINRT=1)
|
|
|
|
endif()
|
|
|
|
|
2016-10-19 07:37:33 +03:00
|
|
|
install(TARGETS sqlite3 EXPORT sqlite3Config
|
2016-09-19 06:50:08 +03:00
|
|
|
RUNTIME DESTINATION bin
|
|
|
|
LIBRARY DESTINATION lib
|
|
|
|
ARCHIVE DESTINATION lib
|
|
|
|
)
|
|
|
|
install(FILES ${SOURCE}/sqlite3.h ${SOURCE}/sqlite3ext.h DESTINATION include CONFIGURATIONS Release)
|
2016-10-19 07:37:33 +03:00
|
|
|
install(EXPORT sqlite3Config DESTINATION share/sqlite3)
|