From: Kornel Benko Date: Fri, 17 Apr 2020 10:13:08 +0000 (+0200) Subject: Cmake build: Prevent multiple configuration runs X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=e41060d8f7678d39a75fa4db2d02de541ef6ba37;p=features.git Cmake build: Prevent multiple configuration runs Normally the sequence to compile is 1.) cmake 2.) make but since 'unset(var CACHE)' changed the cache, the following call to 'make' triggered the configuration run. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 9410c391d2..69b4d3af18 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -580,18 +580,22 @@ get_locale_destination(LYX_LOCALEDIR) set(LYX_ABS_INSTALLED_LOCALEDIR "${CMAKE_INSTALL_PREFIX}/${LYX_LOCALEDIR}") set(LYX_ABS_TOP_SRCDIR "${TOP_SRC_DIR}") -unset(LYX_MAN_DIR CACHE) if(LYX_BUNDLE AND APPLE) - set(LYX_MAN_DIR "${LYX_DATA_SUBDIR}" CACHE STRING "Install location for man pages.") + set(LYX_MAN_DIR_tmp "${LYX_DATA_SUBDIR}") else() if(WIN32) - set(LYX_MAN_DIR "${CMAKE_BINARY_DIR}/usr/local/man/" CACHE STRING "Install location for man pages.") + set(LYX_MAN_DIR_tmp "${CMAKE_BINARY_DIR}/usr/local/man/") elseif(UNIX) - set(LYX_MAN_DIR "${CMAKE_INSTALL_PREFIX}/share/man/" CACHE STRING "Install location for man pages.") + set(LYX_MAN_DIR_tmp "${CMAKE_INSTALL_PREFIX}/share/man/") else() - set(LYX_MAN_DIR "${CMAKE_INSTALL_PREFIX}/man/" CACHE STRING "Install location for man pages.") + set(LYX_MAN_DIR_tmp "${CMAKE_INSTALL_PREFIX}/man/") endif() endif() +if (NOT LYX_MAN_DIR_tmp EQUAL "${LYX_MAN_DIR}") + unset(LYX_MAN_DIR CACHE) + set(LYX_MAN_DIR "${LYX_MAN_DIR_tmp}" CACHE STRING "Install location for man pages.") +endif() +unset(LYX_MAN_DIR_tmp) mark_as_advanced(LYX_MAN_DIR) # The Win installer cannot be built by CMake because one needs to install plugins for NSIS