From 6cdd9bd5ebf31bdd0a743acceca3c6e5a5b2cff7 Mon Sep 17 00:00:00 2001 From: Jonas Bilal <57180794+bilaljo@users.noreply.github.com> Date: Sat, 13 Jul 2024 19:09:43 +0200 Subject: [PATCH] Compile Error on Windows fixed See Build Fails on Windows because of std::min #130 --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 564fbea2af3..1c884e2c8d4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,7 +16,11 @@ project(JKQTPlotter HOMEPAGE_URL https://github.com/jkriege2/JKQtPlotter DESCRIPTION "an extensive Qt5 & Qt6 Plotter framework (including a feature-richt plotter widget, a speed-optimized, but limited variant and a LaTeX equation renderer!), written fully in C/C++ and without external dependencies" ) - +if (WIN32) + # Needed because windows.h otherwise defines a macro for min + # See https://stackoverflow.com/a/5004874/12585571 + add_compile_definitions(NOMINMAX) +endif (WIN32) # set search path for CMake files list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake)