Amend 26fa3b3d, Cmake build: Move interpretation of configure.ac to own function

Use of posix packaging needs to be known prior to call to determineversionandbuildtype()
(Spotted by Scott)
This commit is contained in:
Kornel Benko 2020-07-13 10:17:54 +02:00
parent 907f020724
commit 690ad94f9e

View File

@ -103,8 +103,21 @@ include(LyXMacros)
include(LyXDestinations)
# Try to get some informations from configure.ac
include(LyXPaths)
# Value of USE_POSIX_PACKAGING is needed in determineversionandbuildtype()
if(WIN32)
set(CMAKE_PREFIX_PATH Specify-path-to-Qt CACHE PATH "Used Qt version")
if(MSVC)
set(LYX_3RDPARTY_BUILD ON CACHE BOOL "Build 3rdparty libraries" FORCE)
endif()
set(USE_WINDOWS_PACKAGING ON)
elseif(APPLE)
set(USE_MACOSX_PACKAGING ON)
else()
set(USE_POSIX_PACKAGING ON)
endif()
determineversionandbuildtype("${TOP_SRC_DIR}/configure.ac" _package_list _version_list _envlist LYX_DATE LYX_BUILD_TYPE)
list(GET _package_list 0 PACKAGE_BASE)
list(GET _package_list 1 PACKAGE_VERSION)
@ -356,20 +369,6 @@ else()
endif()
endif()
file(STRINGS "${TOP_SRC_DIR}/configure.ac" _config_lines)
if(WIN32)
set(CMAKE_PREFIX_PATH Specify-path-to-Qt CACHE PATH "Used Qt version")
if(MSVC)
set(LYX_3RDPARTY_BUILD ON CACHE BOOL "Build 3rdparty libraries" FORCE)
endif()
set(USE_WINDOWS_PACKAGING ON)
elseif(APPLE)
set(USE_MACOSX_PACKAGING ON)
else()
set(USE_POSIX_PACKAGING ON)
endif()
if(LYX_3RDPARTY_BUILD)
# LYX_3RDPARTY_BUILD is not cached anymore, but for compatibility reasons
# this enables the build of all 3rd_party libs