-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
38 lines (28 loc) · 1.07 KB
/
Copy pathCMakeLists.txt
File metadata and controls
38 lines (28 loc) · 1.07 KB
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
32
33
34
35
36
37
38
cmake_minimum_required(VERSION 3.29)
project(BaseEncodeKit C)
set(CMAKE_C_STANDARD 17)
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
find_package(Git QUIET)
if (GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git")
# Option to enable/disable submodule updates
option(GIT_SUBMODULE "Check submodules during build" ON)
if (GIT_SUBMODULE)
# Update submodules recursively
execute_process(
COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
RESULT_VARIABLE GIT_SUBMODULE_RESULT
)
if (NOT GIT_SUBMODULE_RESULT EQUAL 0)
message(FATAL_ERROR "Error updating submodules: ${GIT_SUBMODULE_RESULT}")
endif ()
endif ()
endif ()
if (NOT EXISTS "${PROJECT_SOURCE_DIR}/external/unity/CMakeLists.txt")
message(FATAL_ERROR "unity submodule is missing. Please initialize and update submodules.")
endif ()
add_subdirectory(src)
add_subdirectory(examples)
add_subdirectory(tests)
add_subdirectory(external/unity)
include(CTest)