From 86481fa4598f9c604b1f565a3a201be81ca49ac4 Mon Sep 17 00:00:00 2001 From: Martchus Date: Tue, 18 Feb 2020 19:40:48 +0100 Subject: [PATCH] Prevent CMake error when using CMake < 3.15.0 --- lib/cmake/modules/ReflectionGenerator.cmake | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/cmake/modules/ReflectionGenerator.cmake b/lib/cmake/modules/ReflectionGenerator.cmake index cb07cc3..4f269d6 100644 --- a/lib/cmake/modules/ReflectionGenerator.cmake +++ b/lib/cmake/modules/ReflectionGenerator.cmake @@ -68,7 +68,12 @@ set(REFLECTION_GENERATOR_TRIPLE CACHE STRING "platform triple for code generator") function (_reflective_rapidjson_set_prop TARGET_NAME PROPERTY_NAME) - set(PROP "$,EXCLUDE,^$>" PARENT_SCOPE) + if ("${CMAKE_VERSION}" VERSION_LESS "3.15.0") + set(PROP "$" PARENT_SCOPE) + message(WARNING "Passing empty flags to the code generator for property ${PROPERTY_NAME} of target ${TARGET_NAME} might not be prevented. Consider updating to CMake 3.15.0 or newer.") + else () + set(PROP "$,EXCLUDE,^$>" PARENT_SCOPE) + endif () endfunction () # define helper function to add a reflection generator invocation for a specified list of source files