-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
44 lines (38 loc) · 1.14 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
39
40
41
42
43
44
cmake_minimum_required(VERSION 3.0)
project(libwish)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
set(CMAKE_C_FALGS "${CMAKE_C_FLAGS} -std=c99 -pedantic -Wall -Wextra -fstrict-aliasing")
option(BUILD_SHARED_LIBS "Build shared libs" OFF)
file(GLOB_RECURSE SOURCES "src/*.c")
add_library(libwish ${SOURCES})
set_target_properties(libwish PROPERTIES OUTPUT_NAME wish)
target_link_libraries(libwish -lncurses)
include_directories("include")
add_custom_command(
OUTPUT
${CMAKE_SOURCE_DIR}/src/caps.c
${CMAKE_SOURCE_DIR}/src/wish_caps.h
COMMAND
ruby
${CMAKE_SOURCE_DIR}/scripts/gen_caps
${CMAKE_SOURCE_DIR}/data/caps.txt
${CMAKE_SOURCE_DIR}/src/wish_caps.h
${CMAKE_SOURCE_DIR}/src/caps.c
DEPENDS
${CMAKE_SOURCE_DIR}/data/caps.txt
${CMAKE_SOURCE_DIR}/scripts/gen_caps
COMMENT
"Generating caps code"
VERBATIM
)
install(
TARGETS libwish
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
)
install(
FILES include/wish.h
DESTINATION include
)