1
0
mirror of https://github.com/altlinux/admc.git synced 2024-10-26 17:25:38 +03:00
admc/CMakeLists.txt

47 lines
1.5 KiB
CMake
Raw Normal View History

2020-05-21 17:11:45 +03:00
cmake_minimum_required(VERSION 3.0)
# You can get version from spec by first finding Versions keyword.
# After that you can use awk to split line by : and then select second part of it.
# Finally you want to clear all the spaces around version.
# OUTPUT_VARIABLE argument of execute_process allows you to capture output of the command.
execute_process(
COMMAND
bash -c "grep Version: .gear/admc.spec | awk -F\":\" '{ print $2 }' | tr -d [:space:]"
OUTPUT_VARIABLE GEAR_VERSION
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
# To ensure that we have indeed captured the project version we use message to provide us with console output.
message(STATUS "Project version is: " ${GEAR_VERSION})
project(admc VERSION ${GEAR_VERSION})
2020-05-21 17:11:45 +03:00
set(CMAKE_MODULE_PATH
2020-05-27 13:26:08 +03:00
${CMAKE_MODULE_PATH}
${PROJECT_SOURCE_DIR}/cmake
2020-05-21 17:11:45 +03:00
)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR})
set(LIBRARY_OUTPUT_PATH ${EXECUTABLE_OUTPUT_PATH})
2021-02-08 15:36:04 +03:00
enable_testing()
include(GNUInstallDirs)
2021-06-02 16:21:28 +03:00
option(ADMC_BUILD_DEB "Build the deb package of ADMC." OFF)
add_subdirectory(src)
2021-06-02 16:21:28 +03:00
if(NOT ADMC_BUILD_DEB)
add_subdirectory(tests)
endif(NOT ADMC_BUILD_DEB)
2021-03-04 14:34:50 +03:00
add_subdirectory(doc)
2021-06-02 16:21:28 +03:00
if (ADMC_BUILD_DEB)
SET(CPACK_GENERATOR "DEB")
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Kees van Vloten")
SET(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
SET(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
SET(CPACK_DEBIAN_PACKAGE_DESCRIPTION "Samba domain management console.")
SET(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://github.com/altlinux/admc")
INCLUDE(CPack)
endif(ADMC_BUILD_DEB)