[LyX/master] Cmake build: Prevent multiple configuration runs

Kornel Benko kornel at lyx.org
Fri Apr 17 09:58:44 UTC 2020


commit 5ec95f703c8f4ca37be9389154a96e8b2bc6514d
Author: Kornel Benko <kornel at lyx.org>
Date:   Fri Apr 17 12:13:08 2020 +0200

    Cmake build: Prevent multiple configuration runs
    
    Normally the sequence to compile is
    1.) cmake <source> <some parameters>
    2.) make
    
    but since 'unset(var CACHE)' changed the cache, the following call to 'make'
    triggered the configuration run.
---
 CMakeLists.txt |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9410c39..69b4d3a 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


More information about the lyx-cvs mailing list