Skip to content
Permalink
Browse files

CMake: Require CMake 3.4

This update allows us to remove some old legacy CMake code.
  • Loading branch information
sanssecours committed Dec 12, 2019
1 parent 4f589de commit bd239d57f3ad55a08c75fed47a0621a9ec69a3d8
@@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 3.0)
cmake_minimum_required (VERSION 3.4)

# allows us to override platform specific variables
set (CMAKE_USER_MAKE_RULES_OVERRIDE "${CMAKE_SOURCE_DIR}/scripts/cmake/Platform.cmake")
@@ -160,7 +160,7 @@ you up to date with the multi-language support provided by Elektra.
- We fixed warnings about CMake policy [CMP0078](https://cmake.org/cmake/help/latest/policy/CMP0078.html) and [CMP0086](https://cmake.org/cmake/help/latest/policy/CMP0086.html). _(René Schwaiger)_
- The CMake functions `add_msr_test` and `add_msr_test_plugin` do not export the list of required plugins as environment variable any more. _(René Schwaiger)_
- The CMake code of the code generation does not print warnings about unknown regex operators any more. _(René Schwaiger)_
- <<TODO>>
- Generating the build system now requires CMake `3.4` (released in November 2015). _(René Schwaiger)_

### Docker

@@ -26,11 +26,7 @@ if (ELEKTRA_FOUND)
add_executable (application ../src/application.c ${CMAKE_CURRENT_BINARY_DIR}/genelektra.c)
target_link_libraries (application ${ElektraCodegen_LIBRARIES})

if (CMAKE_VERSION VERSION_LESS "3.1")
target_compile_options (application PRIVATE "-std=c99")
else ()
set_property (TARGET application PROPERTY C_STANDARD 99)
endif ()
set_property (TARGET application PROPERTY C_STANDARD 99)
else (ELEKTRA_FOUND)
message (FATAL_ERROR "Elektra not found")
endif (ELEKTRA_FOUND)
@@ -26,11 +26,7 @@ if (ELEKTRA_FOUND)
add_executable (application ../src/application.c ${CMAKE_CURRENT_BINARY_DIR}/genelektra.c)
target_link_libraries (application ${ElektraCodegen_LIBRARIES})

if (CMAKE_VERSION VERSION_LESS "3.1")
target_compile_options (application PRIVATE "-std=c99")
else ()
set_property (TARGET application PROPERTY C_STANDARD 99)
endif ()
set_property (TARGET application PROPERTY C_STANDARD 99)
else (ELEKTRA_FOUND)
message (FATAL_ERROR "Elektra not found")
endif (ELEKTRA_FOUND)
@@ -26,11 +26,7 @@ if (ELEKTRA_FOUND)
add_executable (application ../src/application.c ${CMAKE_CURRENT_BINARY_DIR}/genelektra.c)
target_link_libraries (application ${ElektraCodegen_LIBRARIES})

if (CMAKE_VERSION VERSION_LESS "3.1")
target_compile_options (application PRIVATE "-std=c99")
else ()
set_property (TARGET application PROPERTY C_STANDARD 99)
endif ()
set_property (TARGET application PROPERTY C_STANDARD 99)
else (ELEKTRA_FOUND)
message (FATAL_ERROR "Elektra not found")
endif (ELEKTRA_FOUND)
@@ -9,8 +9,6 @@
# Distributed under the BSD license. See COPYING-CMAKE-SCRIPTS for details.
# ~~~

include (LibFindMacros)

if (LIBAUGEAS_INCLUDE_DIR
AND LIBAUGEAS_LIBRARIES
AND LIBAUGEAS_PREFIX) # in cache already

This file was deleted.

@@ -22,7 +22,6 @@ if (INSTALL_SYSTEM_FILES)
if (PKG_CONFIG_FOUND)
pkg_check_modules (BASH_COMPLETION bash-completion QUIET)
if (BASH_COMPLETION_FOUND)
include (LibFindMacros)
pkg_get_variable (BASH_COMPLETION_COMPLETIONSDIR bash-completion completionsdir)
endif ()
endif ()
@@ -40,7 +39,6 @@ if (INSTALL_SYSTEM_FILES)
if (PKG_CONFIG_FOUND)
pkg_check_modules (FISH_FOUND fish QUIET)
if (FISH_FOUND)
include (LibFindMacros)
pkg_get_variable (FISH_COMPLETION_COMPLETIONSDIR fish completionsdir)
endif ()
endif ()
@@ -42,7 +42,6 @@ set (
CACHE STRING "GIO Module Priority. Higher than 100 means the Elektra gsettings backend will be default.")
target_compile_definitions (elektrasettings PRIVATE G_ELEKTRA_SETTINGS_MODULE_PRIORITY=${GSETTINGS_MODULE_PRIORITY})
if (GELEKTRA_LIBRARY)
include (LibFindMacros)
pkg_get_variable (GIO_MODULE_DIR gio-2.0 giomoduledir)
add_dependencies (elektrasettings elektra_config_headers)
file (MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/include/elektra/)
@@ -61,9 +60,6 @@ if (GELEKTRA_LIBRARY)
install (TARGETS elektrasettings LIBRARY DESTINATION ${GIO_MODULE_DIR})
endif ()
else ()
if (CMAKE_VERSION VERSION_LESS 3.4)
message (FATAL_ERROR "Out of Elektra tree builds need cmake greater 3.3")
endif ()
pkg_get_variable (GIO_MODULE_DIR gio-2.0 giomoduledir)
pkg_check_modules (GELEKTRA gelektra-4.0>=0.8.16 QUIET)
if (!GELEKTRA_FOUND)
@@ -19,18 +19,14 @@ if (ENABLE_TESTING)
set (googletest_BINARY_DIR "${CMAKE_BINARY_DIR}/gtest")
else (DEFINED GOOGLETEST_ROOT)
include (DownloadProject)
if (CMAKE_VERSION VERSION_LESS 3.2)
set (UPDATE_DISCONNECTED_IF_AVAILABLE "")
else ()
set (UPDATE_DISCONNECTED_IF_AVAILABLE "UPDATE_DISCONNECTED 1")
endif ()

download_project (
PROJ googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG release-1.10.0
QUIET
${UPDATE_DISCONNECTED_IF_AVAILABLE})
UPDATE_DISCONNECTED
1)
endif (DEFINED GOOGLETEST_ROOT)

# Prevent GoogleTest from overriding our compiler/linker options when building with Visual Studio
@@ -66,24 +62,20 @@ macro (do_test source)
set_property (TEST ${source} PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib")
endmacro (do_test)

if (NOT CMAKE_VERSION VERSION_LESS 3.2)
set (USES_TERMINAL USES_TERMINAL)
endif (NOT CMAKE_VERSION VERSION_LESS 3.2)

add_custom_target (
run_all
COMMAND "${CMAKE_BINARY_DIR}/scripts/dev/run_all" "$<CONFIGURATION>"
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}" ${USES_TERMINAL})
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}" USES_TERMINAL)

add_custom_target (
run_checkshell
COMMAND "${CMAKE_BINARY_DIR}/scripts/dev/run_checkshell" "$<CONFIGURATION>"
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}" ${USES_TERMINAL})
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}" USES_TERMINAL)

add_custom_target (
run_nocheckshell
COMMAND "${CMAKE_BINARY_DIR}/scripts/dev/run_nocheckshell" "$<CONFIGURATION>"
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}" ${USES_TERMINAL})
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}" USES_TERMINAL)

add_custom_target (
run_nokdbtests

0 comments on commit bd239d5

Please sign in to comment.
You can’t perform that action at this time.