Skip to content

Commit 09284f4

Browse files
authored
Merge pull request #2 from compnerd/cmake
2 parents 9cff1f8 + d880346 commit 09284f4

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

CMakeLists.txt

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
2+
cmake_minimum_required(VERSION 3.12.3)
3+
4+
project(SQLite
5+
LANGUAGES C)
6+
7+
set(CMAKE_POSITION_INDEPENDENT_CODE YES)
8+
9+
add_library(SQLite3
10+
Sources/CSQLite/sqlite3.c)
11+
if(CMAKE_SYSTEM_NAME STREQUAL Windows AND BUILD_SHARED_LIBS)
12+
target_compile_definitions(SQLite3 PRIVATE
13+
"SQLITE_API=__declspec(dllexport)")
14+
endif()
15+
target_include_directories(SQLite3 PUBLIC
16+
Sources/CSQLite/include)
17+
18+
add_executable(sqlite
19+
Sources/sqlite/shell.c)
20+
target_compile_definitions(sqlite PRIVATE
21+
SQLITE_OMIT_LOAD_EXTENSION)
22+
target_link_libraries(sqlite PRIVATE
23+
SQLite3)
24+
25+
install(TARGETS SQLite3
26+
ARCHIVE DESTINATION lib
27+
LIBRARY DESTINATION lib
28+
RUNTIME DESTINATION bin)
29+
install(FILES
30+
Sources/CSQLite/include/sqlite3.h
31+
Sources/CSQLite/include/sqlite3ext.h
32+
DESTINATION
33+
include)
34+

0 commit comments

Comments
 (0)