-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
38 lines (32 loc) · 1.22 KB
/
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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
cmake_minimum_required(VERSION "3.19.2")
project(parser)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_CXX_FLAGS "-Wall -Wpedantic -Wextra -fsanitize=address -O3")
set(CMAKE_CXX_STANDARD 20)
add_subdirectory(includes)
add_library(${PROJECT_NAME} INTERFACE)
target_link_libraries(${PROJECT_NAME} INTERFACE Parser)
if(BUILD_PROJECT STREQUAL "tests")
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()
add_library(catch_main STATIC catch_main.cpp)
target_link_libraries(catch_main PRIVATE ${CONAN_LIBS})
add_executable(tests tests.cpp)
target_link_libraries(tests PRIVATE catch_main Parser)
elseif(BUILD_PROJECT STREQUAL "binary")
add_subdirectory(examples)
add_executable(main main.cpp)
target_link_libraries(main PRIVATE Parser)
elseif(BUILD_PROJECT STREQUAL "all")
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()
add_library(catch_main STATIC catch_main.cpp)
target_link_libraries(catch_main PRIVATE ${CONAN_LIBS})
add_executable(tests PRIVATE tests.cpp)
target_link_libraries(tests PRIVATE catch_main Parser)
add_subdirectory(examples)
add_executable(main main.cpp)
target_link_libraries(main PRIVATE Parser)
else()
endif()