commit f01141a77d1ca2ace88fd340f0a4f818d0237b56
Author: Kornel Benko <kor...@lyx.org>
Date:   Fri May 24 20:26:04 2024 +0200

    Cmake build: Initialize variable 'CMAKE_INSTALL_PREFIX' before use
    
    Spotted by Eugene Chornyi <yu_...@lyx.org>
    
    (cherry picked from commit ea74574d8f02481732b591306410e3c49faae87d)
---
 CMakeLists.txt | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 228ef34a2e..26bca21728 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -526,8 +526,19 @@ endif()
 if(LYX_INSTALL_PREFIX)
        set(CMAKE_INSTALL_PREFIX ${LYX_INSTALL_PREFIX} CACHE PATH "LyX user's 
choice install prefix" FORCE)
        set(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+        set(LYX_INSTALL_PREFIX ${LYX_INSTALL_PREFIX} CACHE PATH "LyX user's 
choice install prefix" FORCE)
 endif()
-set(LYX_INSTALL_PREFIX ${LYX_INSTALL_PREFIX} CACHE PATH "LyX user's choice 
install prefix" FORCE)
+if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+         # see http://www.cmake.org/pipermail/cmake/2006-October/011559.html
+         if (UNIX)
+                 # use the default "/usr/local"
+                 # but respect the user-choice on the command-line
+                 set(CMAKE_INSTALL_PREFIX "/usr/local" CACHE PATH "LyX default 
install prefix" FORCE)
+         endif()
+         if(WIN32)
+                 set(CMAKE_INSTALL_PREFIX LYX_INSTALLED CACHE PATH "LyX 
default install prefix" FORCE)
+         endif()
+ endif()
 
 if(UNIX)
   set(SYSTEM_DATADIR "${CMAKE_INSTALL_PREFIX}/share")
@@ -561,17 +572,6 @@ else()
        set(PACKAGE ${PACKAGE_BASE})
 endif()
 
-if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
-       # see http://www.cmake.org/pipermail/cmake/2006-October/011559.html
-       if (UNIX)
-               # use the default "/usr/local"
-               # but respect the user-choice on the command-line
-               set(CMAKE_INSTALL_PREFIX "/usr/local" CACHE PATH "LyX default 
install prefix" FORCE)
-       endif()
-endif()
-if(WIN32)
-       set(CMAKE_INSTALL_PREFIX LYX_INSTALLED CACHE PATH "LyX default install 
prefix" FORCE)
-endif()
 if(IS_ABSOLUTE)
        set(CMAKE_INSTALL_PREFIX_ABSOLUTE ${CMAKE_INSTALL_PREFIX})
 else()
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to