25 lines
693 B
CMake
25 lines
693 B
CMake
cmake_minimum_required(VERSION 3.22.0)
|
|
|
|
project(zecsy LANGUAGES C)
|
|
|
|
set(CMAKE_C_STANDARD 11)
|
|
set(CMAKE_C_STANDARD_REQUIRED ON)
|
|
|
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
|
option(BUILD_ZECSY_TESTS "Build tests?" ON)
|
|
|
|
add_library(zecsy STATIC zecsy.h stb_ds.h)
|
|
set_target_properties(zecsy PROPERTIES LINKER_LANGUAGE C)
|
|
|
|
if(${BUILD_ZECSY_TESTS})
|
|
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)
|
|
target_link_libraries(tests clove-unit zecsy)
|
|
endif()
|