forked from winterheart/accel-pptp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
56 lines (45 loc) · 1.69 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
45
46
47
48
49
50
51
52
53
54
55
56
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(accel-pptp)
SET(PLUGIN_VERSION_MAJOR 0)
SET(PLUGIN_VERSION_MINOR 8)
SET(PLUGIN_VERSION_PATCH 7)
SET(PPP_PREFIX_DIR "/usr" CACHE STRING "Prefix dir for installed PPP")
TRY_RUN(RUN_RESULT COMPILE_RESULT
${PROJECT_BINARY_DIR}/CMakeTmp
${PROJECT_SOURCE_DIR}/ppp_path_check.c
COMPILE_DEFINITIONS "-DPLUGIN -DDESTDIR=\"${PPP_PREFIX_DIR}\""
RUN_OUTPUT_VARIABLE PPP_PLUGIN_PATH
)
MESSAGE(STATUS "PPP_PLUGIN_PATH is " ${PPP_PLUGIN_PATH})
SET(srcDir src)
SET(srcFileList
${srcDir}/dirutil.c
${srcDir}/orckit_quirks.c
${srcDir}/pptp.c
${srcDir}/pptp_callmgr.c
${srcDir}/pptp_ctrl.c
${srcDir}/pptp_quirks.c
${srcDir}/util.c
${srcDir}/vector.c
)
CONFIGURE_FILE(
"${PROJECT_SOURCE_DIR}/${srcDir}/pptp.h.in"
"${PROJECT_BINARY_DIR}/${srcDir}/pptp.h"
)
INCLUDE_DIRECTORIES("${PROJECT_BINARY_DIR}/${srcDir}")
ADD_LIBRARY(pptp SHARED ${srcFileList})
SET_TARGET_PROPERTIES(pptp PROPERTIES PREFIX "")
INSTALL(TARGETS pptp LIBRARY DESTINATION ${PPP_PLUGIN_PATH})
INSTALL(FILES pppd-pptp.8 DESTINATION share/man/man8)
# Packaging stuff
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Accel-PPTP client plugin for PPPd")
SET(CPACK_PACKAGE_VENDOR "Dmitry Kozlov <[email protected]>")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING")
SET(CPACK_PACKAGE_VERSION_MAJOR ${PLUGIN_VERSION_MAJOR})
SET(CPACK_PACKAGE_VERSION_MINOR ${PLUGIN_VERSION_MINOR})
SET(CPACK_PACKAGE_VERSION_PATCH ${PLUGIN_VERSION_PATCH})
set(CPACK_SOURCE_PACKAGE_FILE_NAME
"${CMAKE_PROJECT_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
SET(CPACK_SOURCE_GENERATOR TBZ2)
INCLUDE(CPack)