1- # Copyright (C) 2019 - 2025 by Pedro Mendes, Rector and Visitors of the
1+ # Copyright (C) 2019 - 2026 by Pedro Mendes, Rector and Visitors of the
22# University of Virginia, University of Heidelberg, and University
33# of Connecticut School of Medicine.
44# All rights reserved.
2828###############################################################################
2929
3030# we need at least cmake 2.8 for the FindLAPACK functions
31- cmake_minimum_required (VERSION 2.8.12... 3.19.1 )
31+ cmake_minimum_required (VERSION 2.8... 3.19)
3232
3333if (POLICY CMP0048)
3434 cmake_policy (SET CMP0048 NEW)
@@ -129,9 +129,10 @@ if (NOT WIN32 AND PREFER_STATIC)
129129endif ()
130130
131131if (CMAKE_MAJOR_VERSION LESS 3 OR CMAKE_MINOR_VERSION LESS 1)
132- set (CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-std=c++11 " )
132+ set (CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-std=c++20 " )
133133else ()
134- set (CMAKE_CXX_STANDARD 11)
134+ set (CMAKE_CXX_STANDARD 20)
135+ set (CMAKE_CXX_EXTENSIONS OFF )
135136endif ()
136137
137138CHECK_FUNCTION_EXISTS(strptime HAVE_STRPTIME)
@@ -261,7 +262,7 @@ option(CLAPACK_NO_BLASWRAP "If defined the NO_BLASWRAP compile option will be ad
261262set (ENABLE_JIT_DEFAULT OFF )
262263
263264if (APPLE )
264- if (CMAKE_OSX_ARCHITECTURES STREQUAL arm64)
265+ if (CMAKE_OSX_ARCHITECTURES STREQUAL arm64 OR ( NOT CMAKE_OSX_ARCHITECTURES AND CMAKE_SYSTEM_PROCESSOR MATCHES "arm64" ) )
265266 set (ENABLE_JIT_DEFAULT OFF )
266267 else ()
267268 set (ENABLE_JIT_DEFAULT ON )
@@ -390,8 +391,20 @@ endif ()
390391include_directories (BEFORE ${CLAPACK_INCLUDE_DIR} )
391392# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${LAPACK_CFLAGS}")
392393
394+ option (COPASI_USE_CROSSGUID "Use CrossGUID for UUID generation" OFF )
395+ if (COPASI_USE_CROSSGUID)
393396find_package (CROSSGUID REQUIRED)
394397include_directories (BEFORE ${CROSSGUID_INCLUDE_DIR} )
398+ SET (UUID_MESSAGE "
399+ UUID library = CrossGUID
400+ crossguid Libs = ${CROSSGUID_LIBRARY}
401+ cross include = ${CROSSGUID_INCLUDE_DIR}
402+ " )
403+ else ()
404+ SET (UUID_MESSAGE "
405+ UUID library = stduuid
406+ " )
407+ endif ()
395408
396409if (ENABLE_JIT)
397410 find_package (NATIVEJIT REQUIRED)
@@ -492,10 +505,22 @@ if(BUILD_GUI)
492505 option (QT5_USE_WEBENGINE "Use QWebEngine instead of the deprecated QtWebKit for notes" OFF )
493506 option (QT5_USE_DATAVISUALIZATION "Use Qt5DataVisualization instead of the deprecated QwtPlot3D" ON )
494507 if (QT5_USE_DATAVISUALIZATION)
495- option (WITH_DATAVISUALIZATION_NAMESPACES "The DataVisualization modeule uses c++ namespaces" ON )
508+ # compile a test program against the datavisualization
509+ # to figure out whether the namespace flag is needed
510+ if (NOT DEFINED WITH_DATAVISUALIZATION_NAMESPACES)
511+ check_cxx_source_compiles("
512+ #include <QtDataVisualization/Q3DSurface>
513+ int main() {
514+ QtDataVisualization::Q3DSurface surface;
515+ return 0;
516+ }"
517+ DATAVISUALIZATION_USES_NAMESPACES)
518+
519+ option (WITH_DATAVISUALIZATION_NAMESPACES "The DataVisualization modeule uses c++ namespaces" ${DATAVISUALIZATION_USES_NAMESPACES} )
520+ endif ()
496521 endif ()
497522 option (COPASI_USE_QTCHARTS "Use QtCharts instead of the Qwt" OFF )
498- option (COPASI_USE_QCUSTOMPLOT "Use QCustomPlot instead of the Qwt" OFF )
523+ option (COPASI_USE_QCUSTOMPLOT "Use QCustomPlot instead of the Qwt" ON )
499524 if (COPASI_USE_QCUSTOMPLOT)
500525 find_package (QCP REQUIRED)
501526 endif ()
@@ -509,7 +534,7 @@ if(BUILD_GUI)
509534 set (ADDITIONAL_QT5_MODULES ${ADDITIONAL_QT5_MODULES} Charts)
510535 endif ()
511536
512- if (${SELECT_QT} MATCHES "Qt6" )
537+ if (${SELECT_QT} MATCHES "Qt6" OR SELECT_QT STREQUAL "Any" )
513538 # for xml sax parser and qregex
514539 set (ADDITIONAL_QT5_MODULES ${ADDITIONAL_QT5_MODULES} Core5Compat)
515540 endif ()
@@ -947,8 +972,7 @@ message(STATUS "-----------------------------------------------------------
947972 LAPACK LDFLAGS = ${CLAPACK_LINKER_FLAGS}
948973 LAPACK include = ${CLAPACK_INCLUDE_DIR}
949974
950- crossguid Libs = ${CROSSGUID_LIBRARY}
951- cross include = ${CROSSGUID_INCLUDE_DIR}
975+ ${UUID_MESSAGE}
952976
953977 Expat version = ${EXPAT_VERSION}
954978 Expat Libs = ${EXPAT_LIBRARY}
0 commit comments