-
Notifications
You must be signed in to change notification settings - Fork 6
/
CMakeLists.txt
28 lines (23 loc) · 1.01 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
cmake_minimum_required(VERSION 3.5.1)
if(APPLE)
# Homebrew's preferred prefix is /usr/local for macOS Intel & /opt/homebrew for Apple Silicon
include_directories(AFTER "/opt/homebrew/include" "/usr/local/include")
endif(APPLE)
set(TARGET_UTIL gsc)
project(${TARGET_UTIL})
file(GLOB SOURCES "src/*.c")
find_library(LIBM m)
find_library(LIBEV ev)
find_library(LIBJSON json-c)
find_library(LIBPREDICT predict)
find_library(LIBPTHREAD pthread)
find_library(LIBXMLRPC xmlrpc)
find_library(LIBXMLRPC_UTIL xmlrpc_util)
find_library(LIBXMLRPC_CLIENT xmlrpc_client)
find_library(LIBCONFIG config)
add_compile_options(-pedantic -Wall -Werror)
add_definitions(-DSATFILE_PATH="/etc/${TARGET_UTIL}/")
add_executable(${TARGET_UTIL} ${SOURCES})
target_link_libraries(${TARGET_UTIL} ${LIBM} ${LIBEV} ${LIBJSON} ${LIBPREDICT} ${LIBPTHREAD} ${LIBXMLRPC} ${LIBXMLRPC_UTIL} ${LIBXMLRPC_CLIENT} ${LIBCONFIG})
install(TARGETS ${TARGET_UTIL} DESTINATION sbin)
install(CODE "execute_process(COMMAND ${CMAKE_SOURCE_DIR}/post_install.sh ${CMAKE_SOURCE_DIR})")