From cb30eb91b8a0265c620e155b4b2acf916cab20a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20G=C3=A2teau?= Date: Wed, 14 May 2014 15:08:22 +0200 Subject: Do not fail if vars like CMAKE_INSTALL_LIBDIR are defined as normal vars REVIEW: 118127 --- kde-modules/KDEInstallDirs.cmake | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'kde-modules/KDEInstallDirs.cmake') diff --git a/kde-modules/KDEInstallDirs.cmake b/kde-modules/KDEInstallDirs.cmake index 6102d9e5..061e542b 100644 --- a/kde-modules/KDEInstallDirs.cmake +++ b/kde-modules/KDEInstallDirs.cmake @@ -247,12 +247,15 @@ macro(_define_relative varname parent subdir docstring) CACHE PATH "${docstring} (${_docpath})") set(CMAKE_INSTALL_${varname} "${_realpath}") else() - # make sure the docs are still set if it was passed on the command line - set_property(CACHE CMAKE_INSTALL_${varname} - PROPERTY HELPSTRING "${docstring} (${_docpath})") - # make sure the type is correct if it was passed on the command line - set_property(CACHE CMAKE_INSTALL_${varname} - PROPERTY TYPE PATH) + get_property(_iscached CACHE CMAKE_INSTALL_${varname} PROPERTY VALUE SET) + if (_iscached) + # make sure the docs are still set if it was passed on the command line + set_property(CACHE CMAKE_INSTALL_${varname} + PROPERTY HELPSTRING "${docstring} (${_docpath})") + # make sure the type is correct if it was passed on the command line + set_property(CACHE CMAKE_INSTALL_${varname} + PROPERTY TYPE PATH) + endif() endif() if(_oldstylename) -- cgit v1.2.1