2025-02-14 21:01:46 +03:00
|
|
|
cmake_minimum_required(VERSION 3.22.0)
|
|
|
|
|
2025-03-19 21:08:58 +03:00
|
|
|
project(zecsy LANGUAGES C)
|
2025-02-14 21:01:46 +03:00
|
|
|
|
2025-03-19 21:08:58 +03:00
|
|
|
set(CMAKE_C_STANDARD 11)
|
|
|
|
set(CMAKE_C_STANDARD_REQUIRED ON)
|
2025-02-20 14:36:09 +03:00
|
|
|
|
2025-02-14 21:01:46 +03:00
|
|
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
2025-02-21 19:05:59 +03:00
|
|
|
option(BUILD_ZECSY_TESTS "Build tests?" ON)
|
|
|
|
|
2025-03-20 18:12:46 +03:00
|
|
|
add_library(zecsy STATIC zecsy.h stb_ds.h)
|
2025-03-19 21:08:58 +03:00
|
|
|
set_target_properties(zecsy PROPERTIES LINKER_LANGUAGE C)
|
2025-02-14 21:01:46 +03:00
|
|
|
|
2025-02-21 19:05:59 +03:00
|
|
|
if(${BUILD_ZECSY_TESTS})
|
2025-03-19 21:08:58 +03:00
|
|
|
Include(FetchContent)
|
|
|
|
FetchContent_Declare(
|
|
|
|
clove-unit
|
|
|
|
GIT_REPOSITORY https://github.com/fdefelici/clove-unit.git
|
|
|
|
GIT_TAG master # or eventually any branch, tag or commit sha
|
|
|
|
)
|
|
|
|
FetchContent_MakeAvailable(clove-unit)
|
|
|
|
|
|
|
|
add_executable(tests tests/zecsy.c)
|
2025-03-20 18:12:46 +03:00
|
|
|
target_link_libraries(tests clove-unit zecsy)
|
2025-02-21 19:05:59 +03:00
|
|
|
endif()
|