From a9f1655c9ccba63867e93ac359119fa9557a5dd3 Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Sun, 24 May 2020 22:02:48 +0200 Subject: [PATCH 1/2] CMake: set policy for VERSION variables Also update the description of other policies to the description on the CMake website. --- build/cmake/policies.cmake | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/build/cmake/policies.cmake b/build/cmake/policies.cmake index 1a7415d0e1..8935c59ea2 100644 --- a/build/cmake/policies.cmake +++ b/build/cmake/policies.cmake @@ -10,7 +10,7 @@ # Please keep the policies in the order of their numbers. if(POLICY CMP0025) - # Compiler id for Apple Clang is now AppleClang + # Compiler id for Apple Clang is now AppleClang. cmake_policy(SET CMP0025 NEW) endif() @@ -20,7 +20,7 @@ if(POLICY CMP0028) endif() if(POLICY CMP0038) - # targets may not link directly to themselves + # Targets may not link directly to themselves. cmake_policy(SET CMP0038 NEW) endif() @@ -30,27 +30,32 @@ if(POLICY CMP0042) endif() if(POLICY CMP0045) - # error on non-existent target in get_target_property + # Error on non-existent target in get_target_property. cmake_policy(SET CMP0045 NEW) endif() if(POLICY CMP0046) - # error on non-existent dependency in add_dependencies + # Error on non-existent dependency in add_dependencies. cmake_policy(SET CMP0046 NEW) endif() +if(POLICY CMP0048) + # The project() command manages VERSION variables. + cmake_policy(SET CMP0048 NEW) +endif() + if(POLICY CMP0049) - # do not expand variables in target source entries + # Do not expand variables in target source entries. cmake_policy(SET CMP0049 NEW) endif() if(POLICY CMP0053) - # simplify variable reference and escape sequence evaluation + # Simplify variable reference and escape sequence evaluation. cmake_policy(SET CMP0053 NEW) endif() if(POLICY CMP0054) - # only interpret if() arguments as variables or keywords when unquoted + # Only interpret if() arguments as variables or keywords when unquoted. cmake_policy(SET CMP0054 NEW) endif() @@ -65,6 +70,6 @@ if(POLICY CMP0072) endif() if(POLICY CMP0092) - # MSVC warning flags are not in CMAKE__FLAGS by default + # MSVC warning flags are not in CMAKE__FLAGS by default. cmake_policy(SET CMP0092 NEW) endif() From 7b4ee6100fba6ceab800e3427322bfafacd3b58e Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Sun, 24 May 2020 22:03:47 +0200 Subject: [PATCH 2/2] CMake: set the project version --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9b6b4ed5b0..c671fb1c0b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,8 +34,6 @@ endif() include(build/cmake/policies.cmake NO_POLICY_SCOPE) -project(wxWidgets) - # Initialize variables for quick access to wx root dir in sub dirs set(wxSOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) set(wxBINARY_DIR ${CMAKE_BINARY_DIR}) @@ -66,6 +64,8 @@ endif() set(wxVERSION ${wxMAJOR_VERSION}.${wxMINOR_VERSION}.${wxRELEASE_NUMBER}) set(wxCOPYRIGHT "1992-2020 wxWidgets") +project(wxWidgets VERSION ${wxVERSION}) + include(build/cmake/main.cmake) # Set the default startup project for Visual Studio