-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
32 lines (24 loc) · 760 Bytes
/
Copy pathCMakeLists.txt
File metadata and controls
32 lines (24 loc) · 760 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
cmake_minimum_required(VERSION 3.16)
project(sql C)
# Set C standard
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED ON)
# Set output directories for binaries and object files
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/db)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/objects)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/objects)
# Include directories
include_directories(${CMAKE_SOURCE_DIR}/include)
# Gather all source files
file(GLOB SRC_FILES
${CMAKE_SOURCE_DIR}/src/*.c
)
# Add main.c separately
set(MAIN_FILE ${CMAKE_SOURCE_DIR}/app/main.c)
# Optional: Enable compile commands JSON generation
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# Add executable
add_executable(db
${MAIN_FILE}
${SRC_FILES}
)