summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
blob: 0c81004c03c246fa0e16476e5209e03d9f08dba2 (plain)
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
cmake_minimum_required(VERSION 3.0...3.31)
project(pom)

if (MSVC)
    add_compile_options(/W4)
else()
    add_compile_options(-Wall -Wextra -Wpedantic -Wshadow)
endif()


add_library(pom STATIC pom.c)
add_library(pom-shared SHARED pom.c)
set_target_properties(pom-shared PROPERTIES OUTPUT_NAME pom)
add_executable(tests tests/errors.c tests/location.c tests/parsing.c tests/interpretation.c tests/main.c)
target_include_directories(tests PRIVATE .)
target_link_libraries(tests pom)
add_executable(example_read_conf examples/read_conf.c)
target_include_directories(example_read_conf PRIVATE .)
target_link_libraries(example_read_conf pom)
add_executable(example_custom_alloc examples/custom_alloc.c)
target_include_directories(example_custom_alloc PRIVATE .)
target_link_libraries(example_custom_alloc pom)

install(TARGETS pom pom-shared DESTINATION lib)
install(FILES pom.pc DESTINATION lib)
install(FILES pom.h DESTINATION include)