Commit baf137ed authored by François Grisez's avatar François Grisez

CMakeLists.txt: Introduce ENABLE_PACKAGE_SOURCE option

This option makes the creation of 'package_source' custom target optional,
allowing to build with CMake < 3.11 if it is disabled (default).

(cherry picked from commit 6b63669f)
parent fb8a7984
......@@ -20,7 +20,7 @@
#
############################################################################
cmake_minimum_required(VERSION 3.11) # we need CMake 3.11 for defining 'package_source' target as custom target
cmake_minimum_required(VERSION 3.1)
project(BELR VERSION 4.3.0 LANGUAGES C CXX)
set(BELR_SO_VERSION "1")
......@@ -30,6 +30,7 @@ option(ENABLE_STATIC "Build static library." ON)
option(ENABLE_STRICT "Build with strict compile options." YES)
option(ENABLE_TOOLS "Turn on or off compilation of tools." YES)
option(ENABLE_TESTS "Enable compilation of unit tests." YES)
option(ENABLE_PACKAGE_SOURCE "Create 'package_source' target for source archive making (CMake >= 3.11)" OFF)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
......@@ -151,4 +152,6 @@ install(FILES
DESTINATION ${ConfigPackageLocation}
)
add_subdirectory(build)
if (ENABLE_PACKAGE_SOURCE)
add_subdirectory(build)
endif()
......@@ -20,6 +20,8 @@
#
############################################################################
cmake_minimum_required(VERSION 3.11) # we need CMake 3.11 for defining 'package_source' target as custom target
if(NOT CPACK_PACKAGE_NAME)
set(CPACK_PACKAGE_NAME "belr")
endif()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment