mirror of
https://github.com/ceph/ceph
synced 2025-01-03 01:22:53 +00:00
cmake: enable CMP0051
the new behavior of get_target_property(<var> <target> SOURCES) will be enforced in future versions of cmake, so let ready for this change now by removing the generator expressions from the returned source file list. Signed-off-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
parent
4aea3bed7f
commit
791af5459e
@ -19,13 +19,7 @@ if(POLICY CMP0065)
|
|||||||
cmake_policy(SET CMP0065 NEW)
|
cmake_policy(SET CMP0065 NEW)
|
||||||
endif()
|
endif()
|
||||||
if(POLICY CMP0051)
|
if(POLICY CMP0051)
|
||||||
# cmake 3.1 and higher include generator expressions in SOURCES property.
|
cmake_policy(SET CMP0051 NEW)
|
||||||
# in BuildBoost.cmake, get_target_property(<var> <target> SOURCES) is used
|
|
||||||
# to retrieve the source files of a target. in that case, we are only
|
|
||||||
# interested in the *source* files. and i don't want to bother stripping off
|
|
||||||
# the TARGET_OBJECTS elements from the returned SOURCES. so let's stick with
|
|
||||||
# the old behavior now.
|
|
||||||
cmake_policy(SET CMP0051 OLD)
|
|
||||||
endif()
|
endif()
|
||||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules/")
|
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules/")
|
||||||
|
|
||||||
|
@ -254,6 +254,9 @@ function(maybe_add_boost_dep target)
|
|||||||
return()
|
return()
|
||||||
endif()
|
endif()
|
||||||
get_target_property(sources ${target} SOURCES)
|
get_target_property(sources ${target} SOURCES)
|
||||||
|
if(NOT CMAKE_VERSION VERSION_LESS 3.1)
|
||||||
|
string(GENEX_STRIP "${sources}" sources)
|
||||||
|
endif()
|
||||||
foreach(src ${sources})
|
foreach(src ${sources})
|
||||||
get_filename_component(ext ${src} EXT)
|
get_filename_component(ext ${src} EXT)
|
||||||
# assuming all cxx source files include boost header(s)
|
# assuming all cxx source files include boost header(s)
|
||||||
|
Loading…
Reference in New Issue
Block a user