fast_obj/CMakeLists.txt
Sergey Kosarevsky fce8123891 Update CMake file to CMake version 3.5...3.31
This approach allows us to maintain compatibility with the minimum supported CMake version 3.5,
while suppressing all policy warnings up to the latest version 3.31.
2024-12-06 16:46:51 -08:00

18 lines
558 B
CMake

CMAKE_MINIMUM_REQUIRED(VERSION 3.5...3.31)
PROJECT(fast_obj)
OPTION(FAST_OBJ_BUILD_TEST "Build test application" OFF)
ADD_LIBRARY(fast_obj INTERFACE)
TARGET_INCLUDE_DIRECTORIES(fast_obj INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
ADD_LIBRARY(fast_obj_lib STATIC fast_obj.c)
TARGET_INCLUDE_DIRECTORIES(fast_obj_lib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
IF(${FAST_OBJ_BUILD_TEST})
ADD_EXECUTABLE(fast_obj_test test/test.cpp)
TARGET_COMPILE_FEATURES(fast_obj_test PRIVATE cxx_std_11)
TARGET_LINK_LIBRARIES(fast_obj_test PRIVATE fast_obj_lib)
ENDIF()