Make sure that Ninja knows the version header (fixes #4209)
This is required, because Ninja otherwise doesn't properly rebuild after updating the version string header file. Because BYPRODUCTS requires CMake 3.2, bump the minimum version and remove now unused compatibility code for older CMake versions.
This commit is contained in:
parent
b29f55c1ca
commit
2341b69840
|
@ -21,14 +21,7 @@
|
|||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
#
|
||||
|
||||
cmake_minimum_required( VERSION 3.0.2 FATAL_ERROR )
|
||||
# because of http://public.kitware.com/Bug/view.php?id=10395
|
||||
|
||||
# See https://gitlab.kitware.com/cmake/cmake/issues/15943
|
||||
# Remove as soon as 3.1 is minimum required version
|
||||
if(POLICY CMP0025)
|
||||
cmake_policy(SET CMP0025 NEW) # CMake 3.0
|
||||
endif()
|
||||
cmake_minimum_required( VERSION 3.2 FATAL_ERROR )
|
||||
|
||||
# Default to CMAKE_BUILD_TYPE = Release unless overridden on command line
|
||||
# http://www.cmake.org/pipermail/cmake/2008-September/023808.html
|
||||
|
@ -222,24 +215,6 @@ include( PerformFeatureChecks )
|
|||
perform_feature_checks()
|
||||
|
||||
|
||||
# Workaround: CMake < 3.1 does not support CMAKE_CXX_STANDARD
|
||||
if( NOT CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 3.1 )
|
||||
message( FATAL_ERROR "Remove compatibility code" )
|
||||
endif()
|
||||
|
||||
if( CMAKE_VERSION VERSION_LESS 3.1 AND ( CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" ) )
|
||||
include(CheckCXXCompilerFlag)
|
||||
|
||||
CHECK_CXX_COMPILER_FLAG("-std=gnu++14" COMPILER_SUPPORTS_CXX14)
|
||||
|
||||
if(COMPILER_SUPPORTS_CXX14)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++14")
|
||||
else()
|
||||
message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++14 support. Please use a different C++ compiler.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
# Setup the compiler warnings
|
||||
include( ${CMAKE_MODULE_PATH}/Warnings.cmake )
|
||||
|
||||
|
|
|
@ -144,6 +144,7 @@ add_custom_target(
|
|||
-DCMAKE_MODULE_PATH=${CMAKE_MODULE_PATH}
|
||||
-P ${CMAKE_MODULE_PATH}/WriteVersionHeader.cmake
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
BYPRODUCTS ${CMAKE_BINARY_DIR}/kicad_build_version.h
|
||||
COMMENT "Generating version string header"
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in New Issue