aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
blob: 6bec2cc0a9cdb23f5cc6c0342b35c6d7e0778861 (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.2)
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()