forked from SudoMaker/chAT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
24 lines (17 loc) · 862 Bytes
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
cmake_minimum_required(VERSION 3.14)
project(chAT)
set(CMAKE_CXX_STANDARD 17)
file(GLOB_RECURSE SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/*.*")
add_library(chAT ${SOURCES})
target_include_directories(chAT PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src)
set(chAT_LIBRARY_ONLY OFF CACHE BOOL "Only build library")
if (NOT chAT_LIBRARY_ONLY)
add_executable(chAT_example_parser examples/parser.cpp)
target_link_libraries(chAT_example_parser chAT)
add_executable(chAT_example_posix_stdio_blocking examples/posix_stdio_blocking.cpp)
target_link_libraries(chAT_example_posix_stdio_blocking chAT)
add_executable(chAT_example_posix_stdio_nonblocking examples/posix_stdio_nonblocking.cpp)
target_link_libraries(chAT_example_posix_stdio_nonblocking chAT)
enable_testing()
add_test(NAME chAT_example_parser COMMAND chAT_example_parser)
endif()