Handle CMake policy 0071 correctly
This commit is contained in:
parent
0762af76c2
commit
cf5e2b39f1
3 changed files with 20 additions and 0 deletions
|
@ -14,6 +14,14 @@ if(COMMAND cmake_policy)
|
||||||
if(POLICY CMP0042)
|
if(POLICY CMP0042)
|
||||||
cmake_policy(SET CMP0042 NEW)
|
cmake_policy(SET CMP0042 NEW)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# AUTOMOC/AUTOUIC on generated files policy. Since we only
|
||||||
|
# generate resource files with fgrcc which don't use Qt,
|
||||||
|
# we set those files source property. See the help for this
|
||||||
|
# policy for more info
|
||||||
|
if(POLICY CMP0071)
|
||||||
|
cmake_policy(SET CMP0071 NEW)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
message("CMAKE Build type: ${CMAKE_BUILD_TYPE}")
|
message("CMAKE Build type: ${CMAKE_BUILD_TYPE}")
|
||||||
|
|
|
@ -9,6 +9,13 @@ function(setup_fgfs_embedded_resources)
|
||||||
set_property(GLOBAL APPEND PROPERTY EMBEDDED_RESOURCE_SOURCES ${SOURCES})
|
set_property(GLOBAL APPEND PROPERTY EMBEDDED_RESOURCE_SOURCES ${SOURCES})
|
||||||
set_property(GLOBAL APPEND PROPERTY EMBEDDED_RESOURCE_HEADERS ${HEADERS})
|
set_property(GLOBAL APPEND PROPERTY EMBEDDED_RESOURCE_HEADERS ${HEADERS})
|
||||||
|
|
||||||
|
# set the flag for CMake polocy 00071, ensure Qt AUTOfoo don't process
|
||||||
|
# generated files
|
||||||
|
foreach(sourcefile IN LISTS ${SOURCES} ${HEADERS})
|
||||||
|
set_property(SOURCE ${sourcefile} PROPERTY SKIP_AUTOMOC ON)
|
||||||
|
set_property(SOURCE ${sourcefile} PROPERTY SKIP_AUTOUIC ON)
|
||||||
|
endforeach()
|
||||||
|
|
||||||
# On Windows, make sure fgrcc can be run (it needs third-party libraries)
|
# On Windows, make sure fgrcc can be run (it needs third-party libraries)
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
if(MSVC_3RDPARTY_ROOT AND MSVC_3RDPARTY_DIR)
|
if(MSVC_3RDPARTY_ROOT AND MSVC_3RDPARTY_DIR)
|
||||||
|
|
|
@ -2,6 +2,11 @@ cmake_minimum_required(VERSION 3.0)
|
||||||
set(CMAKE_CXX_STANDARD 11)
|
set(CMAKE_CXX_STANDARD 11)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED YES)
|
set(CMAKE_CXX_STANDARD_REQUIRED YES)
|
||||||
|
|
||||||
|
# AUTOMOC/AUTOUIC on generated files policy.
|
||||||
|
if(POLICY CMP0071)
|
||||||
|
cmake_policy(SET CMP0071 NEW)
|
||||||
|
endif()
|
||||||
|
|
||||||
include(GNUInstallDirs)
|
include(GNUInstallDirs)
|
||||||
|
|
||||||
project(FGQCanvas)
|
project(FGQCanvas)
|
||||||
|
|
Loading…
Reference in a new issue