CMake build: Fix configuring with CMake 3.10 and external yaml-cpp

CMake 3.10 does not allow using target_include_directories with
INTERFACE on imported targets.

https://gitlab.kitware.com/cmake/cmake/-/issues/15689

Fixes: QTCREATORBUG-24356
Change-Id: I2427276f0851010cda2321c45eff0628713af2ff
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
Eike Ziller
2020-07-15 16:25:56 +02:00
parent ded5c64d53
commit a065175d58

View File

@@ -15,7 +15,7 @@ if (yaml-cpp_FOUND)
unset(yaml_cpp_include_dir CACHE) unset(yaml_cpp_include_dir CACHE)
find_path(yaml_cpp_include_dir yaml-cpp/yaml.h) find_path(yaml_cpp_include_dir yaml-cpp/yaml.h)
endif() endif()
target_include_directories(yaml-cpp INTERFACE ${yaml_cpp_include_dir}) set_target_properties(yaml-cpp PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${yaml_cpp_include_dir}")
else() else()
set(yaml-cpp_FOUND 1) set(yaml-cpp_FOUND 1)
set_package_properties(yaml-cpp PROPERTIES DESCRIPTION "using internal src/libs/3rdparty/yaml-cpp") set_package_properties(yaml-cpp PROPERTIES DESCRIPTION "using internal src/libs/3rdparty/yaml-cpp")