summaryrefslogtreecommitdiffstats
path: root/modules/FindTDE.cmake
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2020-05-10 12:43:42 +0200
committerSlávek Banko <slavek.banko@axis.cz>2020-05-11 00:42:15 +0200
commit778522d10450a8a45133c65ae0175224c6abc700 (patch)
treee3ed06dd939195c5c60bd7f5a66adc51a3b9cad3 /modules/FindTDE.cmake
parent4ced9fd928bfdf8a44152492b504bba4e0f98da5 (diff)
downloadtde-cmake-778522d10450a8a45133c65ae0175224c6abc700.tar.gz
tde-cmake-778522d10450a8a45133c65ae0175224c6abc700.zip
Add caching of variables from checks results and add conditions
to avoid unnecessary repetition of checks. Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Diffstat (limited to 'modules/FindTDE.cmake')
-rw-r--r--modules/FindTDE.cmake12
1 files changed, 9 insertions, 3 deletions
diff --git a/modules/FindTDE.cmake b/modules/FindTDE.cmake
index ff33a13..269bec3 100644
--- a/modules/FindTDE.cmake
+++ b/modules/FindTDE.cmake
@@ -28,6 +28,8 @@ if( NOT TDE_FOUND )
if( NOT KDECONFIG_EXECUTABLE )
tde_message_fatal( "tde-config are NOT found." )
endif( NOT KDECONFIG_EXECUTABLE )
+ set( KDECONFIG_EXECUTABLE ${KDECONFIG_EXECUTABLE}
+ CACHE INTERNAL "tde-config executable" )
endif( NOT DEFINED KDECONFIG_EXECUTABLE )
set( ENV{LD_LIBRARY_PATH} "${TDE_LIBDIR}:$ENV{LD_LIBRARY_PATH}" )
@@ -41,7 +43,7 @@ if( NOT TDE_FOUND )
# parse tde-config output, to extract TDE version
string( REGEX MATCH "TDE: R([0-9\\.]+).*" __dummy "${_version}" )
- set( TDE_VERSION "${CMAKE_MATCH_1}" )
+ set( TDE_VERSION "${CMAKE_MATCH_1}" CACHE INTERNAL "" )
# ask tde-config for few paths
macro( __internal_get_path __type __var )
@@ -80,8 +82,12 @@ if( NOT TDE_FOUND )
__internal_find_program( tdeconfig_compiler KDE3_KCFGC_EXECUTABLE )
__internal_find_program( maketdewidgets KDE3_MAKETDEWIDGETS_EXECUTABLE )
# Don't use __internal_find_program due to it's not mandatory
- find_program( TDELFEDITOR_EXECUTABLE NAMES tdelfeditor
- HINTS "${TDE_PREFIX}/bin" ${BIN_INSTALL_DIR} OUTPUT_STRIP_TRAILING_WHITESPACE )
+ if( NOT DEFINED TDELFEDITOR_EXECUTABLE )
+ find_program( TDELFEDITOR_EXECUTABLE NAMES tdelfeditor
+ HINTS "${TDE_PREFIX}/bin" ${BIN_INSTALL_DIR} OUTPUT_STRIP_TRAILING_WHITESPACE )
+ set( TDELFEDITOR_EXECUTABLE ${TDELFEDITOR_EXECUTABLE}
+ CACHE INTERNAL "tdelfeditor executable" )
+ endif( )
# dcopidlng is a bash script which using tde-config;
# if PATH to tde-config is not set, dcopidlng will fail;