aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
blob: b03d8e23d4ac5f82dcab1e916b1cc146845aa080 (plain) (blame)
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
cmake_minimum_required(VERSION 3.29)
project(justify VERSION 0.1.3)
include_directories(${CMAKE_SOURCE_DIR}/include)

set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED True)

set(CMAKE_C_COMPILER clang)
set(CMAKE_CXX_COMPILER clang++)
if (CMAKE_C_COMPILER_ID STREQUAL "Clang")
    add_compile_options(-Wall -Wextra -ansi)
endif()

set(SRC_FILES
    src/linebuffer.c
    src/word.c
    src/main.c
)

include_directories(src)
add_executable(justify ${SRC_FILES})

install(TARGETS justify RUNTIME DESTINATION bin)
install(FILES doc/justify.1 DESTINATION share/man/man1)

include(CTest)
if(BUILD_TESTING)
    add_subdirectory(tests)
endif()