-
Notifications
You must be signed in to change notification settings - Fork 12
/
CMakeLists.txt
31 lines (22 loc) · 1.15 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
CMAKE_MINIMUM_REQUIRED(VERSION 2.4)
PROJECT(unco)
SET(serial "0.2.0")
SET(soserial "1")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -g")
SET(BINDIR_REL "bin")
SET(LIBDIR_REL "lib")
SET(MANDIR_REL "share/man")
INCLUDE_DIRECTORIES(third-party/kazutils.c third-party/sha1)
ADD_LIBRARY(unco-preload SHARED src/preload.c src/log.c src/misc.c third-party/kazutils.c/file.c third-party/kazutils.c/string.c)
ADD_EXECUTABLE(unco src/cmd.c src/log.c src/misc.c third-party/kazutils.c/file.c third-party/kazutils.c/list.c third-party/kazutils.c/string.c third-party/sha1/sha1.c)
CONFIGURE_FILE(src/config.h.cmake src/config.h)
IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
TARGET_LINK_LIBRARIES(unco-preload dl)
ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
INSTALL(TARGETS unco unco-preload
RUNTIME DESTINATION ${BINDIR_REL}
LIBRARY DESTINATION ${LIBDIR_REL})
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/unco.1 DESTINATION ${MANDIR_REL}/man1)
ADD_CUSTOM_TARGET(test prove)
FIND_PROGRAM(POD2MAN NAMES pod2man5.12 pod2man)
ADD_CUSTOM_TARGET(man ${POD2MAN} --section=1 --center="LOCAL USER COMMANDS" --release ${serial} --name ${PROJECT_NAME} README.pod > ${CMAKE_CURRENT_BINARY_DIR}/unco.1)