Dear list, and Pavel mostly :)

I'm starting again to configure LyX on Windows, and the CMake files do not
behave as expected.

I am setting -DLYX_DEPENDENCIES_DOWNLOAD=1 on the command line, but this is
what it outputs:

"C:\Program Files\JetBrains\CLion\bin\cmake\win\bin\cmake.exe"
-DCMAKE_BUILD_TYPE=Debug -DLYX_DEPENDENCIES_DOWNLOAD=1 -G "CodeBlocks -
NMake Makefiles" D:\Thibaut\LyX
-- TOP_SRC_DIR = D:/Thibaut/LyX
-- 
-- Building out-of-source
-- Selecting build type defaults from configure.ac
-- ERROR: Could NOT find GNUWIN32, please set GNUWIN32_DIR
-- ERROR: or let cmake download all required files by using
-DLYX_DEPENDENCIES_DOWNLOAD=1
CMake Error at development/cmake/modules/FindGNUWIN32.cmake:43 (message):
Call Stack (most recent call first):
  development/cmake/modules/LyXPaths.cmake:57 (find_package)
  CMakeLists.txt:251 (include)

It really looks like the parameter I set is disregarded (as if the check is
done before any downloading can happen). My CMake skills do not allow me to
debug this thoroughly…

Moreover, the variables MSVC14 and MSVC10 are discouraged since CMake 3.8:
https://cmake.org/cmake/help/v3.8/variable/MSVC14.html. Plus, the same set
of dependencies can be used for Visual C++ 2017 and 2019, which the current
code cannot do (and there are no more MSVC variables for these). I am
joining a patch to switch to the now recommended MSVC_VERSION. It is
untested due to the above issue.
Index: CMakeLists.txt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt	(revision d81673ecf0836b77fb7ddd38f6eaceddc1511581)
+++ b/CMakeLists.txt	(date 1611238973381)
@@ -311,12 +311,12 @@
 
 if(LYX_DEPENDENCIES_DOWNLOAD)
 	message(STATUS)
-	if(MSVC14)
+	if(MSVC_VERSION GREATER_EQUAL 1900)
 		set(LYX_DEPENDENCIES_DIR ${TOP_BINARY_DIR}/msvc2015-deps)
 		set(deps_files lyx-windows-deps-msvc2015.zip)
 		set(deps_server http://ftp.lyx.de/LyX-Windows-Deps)
 		set(GNUWIN32_DIR ${LYX_DEPENDENCIES_DIR}/lyx-windows-deps-msvc2015)
-	elseif(MSVC10)
+	elseif(MSVC_VERSION EQUAL 1600)
 		set(LYX_DEPENDENCIES_DIR ${TOP_BINARY_DIR}/msvc2010-deps)
 		set(deps_files lyx-windows-deps-msvc2010.zip)
 		set(deps_server http://ftp.lyx.de/LyX-Windows-Deps)
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel

Reply via email to