2013-12-18 19:28:48 -05:00
|
|
|
|
|
|
|
cmake_minimum_required (VERSION 2.6)
|
|
|
|
project (sqlite)
|
|
|
|
|
|
|
|
include_directories ("${PROJECT_SOURCE_DIR}/../")
|
|
|
|
|
|
|
|
file(GLOB SOURCE
|
|
|
|
"*.c"
|
|
|
|
)
|
|
|
|
|
2013-12-27 05:51:08 -05:00
|
|
|
|
2014-07-01 00:40:38 -04:00
|
|
|
# Lua is required as a DLL for LuaSQLite:
|
2013-12-27 05:51:08 -05:00
|
|
|
if (WIN32)
|
2014-07-01 00:40:38 -04:00
|
|
|
add_definitions(-DLUA_BUILD_AS_DLL)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
# add headers to MSVC project files:
|
|
|
|
if (MSVC)
|
2013-12-27 05:51:08 -05:00
|
|
|
file(GLOB HEADERS "src/*.h")
|
|
|
|
list(REMOVE_ITEM SOURCE "${PROJECT_SOURCE_DIR}/src/lua.h" "${PROJECT_SOURCE_DIR}/src/luac.h")
|
|
|
|
set(SOURCE ${SOURCE} ${HEADERS})
|
|
|
|
source_group("Sources" FILES ${SOURCE})
|
|
|
|
endif()
|
|
|
|
|
2014-05-28 15:39:47 -04:00
|
|
|
# FreeBSD requires us to define this to get POSIX 2001 standard
|
2014-05-28 16:39:28 -04:00
|
|
|
if (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
|
2015-05-24 22:07:31 -04:00
|
|
|
add_flags_cxx("-D_XOPEN_SOURCE=600")
|
2014-05-28 15:39:47 -04:00
|
|
|
endif()
|
2013-12-27 05:51:08 -05:00
|
|
|
|
2013-12-18 19:28:48 -05:00
|
|
|
add_library(sqlite ${SOURCE})
|
2014-07-01 02:01:39 -04:00
|
|
|
target_link_libraries(sqlite lua)
|
2013-12-18 19:28:48 -05:00
|
|
|
|
2013-12-27 05:51:08 -05:00
|
|
|
if (UNIX)
|
2014-07-01 02:01:39 -04:00
|
|
|
target_link_libraries(sqlite ${DYNAMIC_LOADER})
|
2013-12-27 05:51:08 -05:00
|
|
|
endif()
|