-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
30 lines (21 loc) · 980 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
25
26
27
28
29
30
cmake_minimum_required(VERSION 3.10)
project(nooks VERSION 1.4.2)
set(CMAKE_C_STANDARD 17)
set(CMAKE_C_STANDARD_REQUIRED True)
add_compile_options(-Wall -Wextra -Wpedantic)
add_executable(nooks nooks.c handle_arguments.c actions.c)
# Set the default build output directory
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
# Add nooks version from header of this file to function that print --version
target_compile_definitions(nooks PUBLIC NOOKS_VERSION="${PROJECT_VERSION}")
# Find the install directory for executables
include(GNUInstallDirs)
# Set the install target for the executable
install(TARGETS nooks
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
# Install Zsh completion script
install(FILES _nooks
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/zsh/site-functions
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
# Option for custom installation
option(INSTALL_TO_TARGET_DIR "Install the binary to a target directory" ON)