forked from kamailio/kamailio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
74 lines (58 loc) · 1.84 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
cmake_minimum_required(VERSION 3.10)
# Use cmake -DCMAKE_SYSTEM_NAME .. for cross-compiling (inside build directory)
# Set the project name
project(kamailio VERSION 6.0.0)
# Set the version number
set(EXTRAVERSION "-pre0")
set(RELEASE "${PROJECT_VERSION}${EXTRAVERSION}")
message(STATUS "PROJECT_VERSION: ${PROJECT_VERSION}")
message(STATUS "RELEASE: ${RELEASE}")
# cmake-format: off
# Set the version number as a single integer
math(EXPR VERSIONVAL
"${PROJECT_VERSION_MAJOR}*1000000
+ ${PROJECT_VERSION_MINOR}*1000
+ ${PROJECT_VERSION_PATCH}"
)
message(STATUS "VERSIONVAL: ${VERSIONVAL}")
# cmake-format: on
# Specify the C standard if non provided by user
if(NOT CMAKE_C_STANDARD)
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED True)
endif()
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules")
include(${CMAKE_SOURCE_DIR}/cmake/BuildType.cmake)
# -----------------------
# Main project name
# -----------------------
# main binary name
set(MAIN_NAME
"kamailio"
CACHE STRING "Main binary name")
# use kamailio config
set(CFG_NAME
"kamailio"
CACHE STRING "Config name")
include(GNUInstallDirs)
# Add the source directory
add_subdirectory(src)
# Add utils
add_subdirectory(utils/kamctl)
# TODO: Packaging stuuf. These should be on different file propably
set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
set(CPACK_PACKAGE_NAME kamailio)
set(CPACK_GENERATOR DEB)
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "test")
include(CPack)
# Add uninstall target
if(NOT TARGET uninstall)
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake-uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake/cmake-uninstall.cmake" IMMEDIATE @ONLY)
add_custom_target(
uninstall
COMMAND ${CMAKE_COMMAND} -P
${CMAKE_CURRENT_BINARY_DIR}/cmake/cmake-uninstall.cmake
COMMENT "Uninstalling")
endif()