From: Alastair McKinstry Date: Wed, 4 Oct 2017 14:22:29 +0000 (+0100) Subject: Merge tag 'upstream/2.4.1' X-Git-Tag: archive/raspbian/2.5-2+rpi1^2~77^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=92ae9b8fae4c900177b8b7d36736919646f2b965;p=mathgl.git Merge tag 'upstream/2.4.1' --- 92ae9b8fae4c900177b8b7d36736919646f2b965 diff --cc CMakeLists.txt index c9eb64b,9070595..7a95dce --- a/CMakeLists.txt +++ b/CMakeLists.txt @@@ -91,11 -138,14 +138,14 @@@ MACRO(MGL_DEPENDENT_OPTION option doc d ENDMACRO(MGL_DEPENDENT_OPTION) include(CMakeDependentOption) - set(MGL_LIB_INSTALL_DIR "lib" CACHE STRING "Set library install directory") string(TIMESTAMP MGL_NIGHT "%d.%m.%y") + if(WIN32) + option(enable-dep-dll "Enable copying off all dependent dll libraries to the install directory" OFF) + endif(WIN32) + option(enable-double "Enable double precision in MathGL library" ON) -option(enable-mpi "Enable mpi") +option(enable-mpi "Enable mpi" ON) option(enable-opengl "Enable OpenGL support" ON) option(enable-all-docs "Enable all documentation building") #option(enable-doc "Enable documentation building") @@@ -126,36 -177,63 +176,55 @@@ CMAKE_DEPENDENT_OPTION(enable-mgltex "E CMAKE_DEPENDENT_OPTION(enable-zlib "Enable zlib support" ON "NOT enable-all" ON) CMAKE_DEPENDENT_OPTION(enable-png "Enable png support" ON "NOT enable-all" ON) -CMAKE_DEPENDENT_OPTION(enable-jpeg "Enable jpeg support" OFF "NOT enable-all" ON) -MGL_DEPENDENT_OPTION(enable-gsl "Enable gsl support" OFF "NOT enable-lgpl" ON "NOT enable-all" ON) -MGL_DEPENDENT_OPTION(enable-hdf4 "Enable hdf4 support" OFF "NOT enable-lgpl" ON "NOT enable-all" ON) -MGL_DEPENDENT_OPTION(enable-hdf5 "Enable hdf5 support" OFF "NOT enable-lgpl" ON "NOT enable-all" ON) -CMAKE_DEPENDENT_OPTION(enable-pdf "Enable pdf support" OFF "NOT enable-all" ON) -CMAKE_DEPENDENT_OPTION(enable-gif "Enable gif support" OFF "NOT enable-all" ON) -CMAKE_DEPENDENT_OPTION(enable-glut "Enable glut support" OFF "NOT enable-all-widgets" ON) -CMAKE_DEPENDENT_OPTION(enable-fltk "Enable fltk widget" OFF "NOT enable-all-widgets" ON) -CMAKE_DEPENDENT_OPTION(enable-wx "Enable wxWidget widget" OFF "NOT enable-all-widgets" ON) +CMAKE_DEPENDENT_OPTION(enable-jpeg "Enable jpeg support" ON "NOT enable-all" ON) +MGL_DEPENDENT_OPTION(enable-gsl "Enable gsl support" ON "NOT enable-lgpl" ON "NOT enable-all" ON) +MGL_DEPENDENT_OPTION(enable-hdf4 "Enable hdf4 support" ON "NOT enable-lgpl" ON "NOT enable-all" ON) +MGL_DEPENDENT_OPTION(enable-hdf5 "Enable hdf5 support" ON "NOT enable-lgpl" ON "NOT enable-all" ON) +CMAKE_DEPENDENT_OPTION(enable-pdf "Enable pdf support" ON "NOT enable-all" ON) +CMAKE_DEPENDENT_OPTION(enable-gif "Enable gif support" ON "NOT enable-all" ON) +CMAKE_DEPENDENT_OPTION(enable-glut "Enable glut support" ON "NOT enable-all-widgets" ON) +CMAKE_DEPENDENT_OPTION(enable-fltk "Enable fltk widget" ON "NOT enable-all-widgets" ON) +CMAKE_DEPENDENT_OPTION(enable-wx "Enable wxWidget widget" ON "NOT enable-all-widgets" ON) CMAKE_DEPENDENT_OPTION(enable-qt4 "Enable Qt4 widget" OFF "NOT enable-all-widgets" ON) -CMAKE_DEPENDENT_OPTION(enable-qt4asqt "Set Qt4 as default libmgl-qt" OFF "enable-qt4" OFF) -CMAKE_DEPENDENT_OPTION(enable-qt5 "Enable Qt5 widget" OFF "NOT enable-all-widgets" ON) -CMAKE_DEPENDENT_OPTION(enable-qt5asqt "Set Qt5 as default libmgl-qt" OFF "enable-qt5" OFF) - -# msvc fwprintf print char* for the specifier of "%s" format -if(MSVC AND MSVC_VERSION GREATER 1899) - SET(CMAKE_CXX_FLAGS "/EHsc -D_CRT_STDIO_ISO_WIDE_SPECIFIERS ${CMAKE_CXX_FLAGS}") - SET(CMAKE_C_FLAGS "-D_CRT_STDIO_ISO_WIDE_SPECIFIERS ${CMAKE_C_FLAGS}") -endif(MSVC AND MSVC_VERSION GREATER 1899) +CMAKE_DEPENDENT_OPTION(enable-qt5 "Enable Qt5 widget" ON "NOT enable-all-widgets" ON) +CMAKE_DEPENDENT_OPTION(enable-qt5asqt "Set Qt5 as default libmgl-qt" ON "enable-qt5" ON) - if(UNIX AND enable-rvalue) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11") - endif(UNIX AND enable-rvalue) + include(CheckCXXSourceCompiles) - # MSVC does not require any special flags + if(${CMAKE_SIZEOF_VOID_P} EQUAL 4) + set(CMAKE_REQUIRED_FLAGS -msse2 -mfpmath=sse) + CHECK_CXX_SOURCE_COMPILES(" + int main(void){}" mgl_sse) + if(mgl_sse) + SET(CMAKE_CXX_FLAGS "-msse2 -mfpmath=sse ${CMAKE_CXX_FLAGS}") + SET(CMAKE_C_FLAGS "-msse2 -mfpmath=sse ${CMAKE_C_FLAGS}") + endif(mgl_sse) + unset(CMAKE_REQUIRED_FLAGS) + endif(${CMAKE_SIZEOF_VOID_P} EQUAL 4) if(enable-qt4 OR enable-qt5) - set(QT_ENABLED ON) + set(QT_ENABLED ON) + if(enable-qt4asqt AND enable-qt5asqt) + message(SEND_ERROR "You cannot make Qt4 and Qt5 as qt at the same time.") + endif(enable-qt4asqt AND enable-qt5asqt) + if(enable-qt4 AND NOT enable-qt5) + set(enable-qt4asqt TRUE) + endif(enable-qt4 AND NOT enable-qt5) + if(enable-qt5 AND NOT enable-qt4) + set(enable-qt5asqt TRUE) + endif(enable-qt5 AND NOT enable-qt4) + # if(NOT enable-opengl) + # message(SEND_ERROR "You cannot build MathGL with Qt4 or Qt5 without OpenGL enabled.") + # endif(NOT enable-opengl) endif(enable-qt4 OR enable-qt5) -CMAKE_DEPENDENT_OPTION(enable-json-sample "Enable JSON sample (WebKit variant is the default)." ON "QT_ENABLED" OFF) -CMAKE_DEPENDENT_OPTION(enable-json-sample-we "Enable JSON sample (WebEngine variant)." OFF "enable-json-sample" OFF) -MGL_DEPENDENT_OPTION(enable-python "Enable python interface" OFF "NOT enable-lgpl" ON "NOT enable-all-swig" ON) +CMAKE_DEPENDENT_OPTION(enable-json-sample "Enable JSON sample" ON "QT_ENABLED" ON) +MGL_DEPENDENT_OPTION(enable-python "Enable python interface" ON "NOT enable-lgpl" ON "NOT enable-all-swig" ON) MGL_DEPENDENT_OPTION(enable-lua "Enable Lua (v.5.1) interface" OFF "NOT enable-lgpl" ON "NOT enable-all-swig" ON) -MGL_DEPENDENT_OPTION(enable-octave "Enable octave interface" OFF "NOT enable-lgpl" ON "NOT enable-all-swig" ON) +MGL_DEPENDENT_OPTION(enable-octave "Enable octave interface" ON "NOT enable-lgpl" ON "NOT enable-all-swig" ON) MGL_DEPENDENT_OPTION(enable-octave-install "Octave interface will install for all users" ON "NOT enable-lgpl" ON "NOT enable-all-swig" ON) - include_directories( ${MathGL_SOURCE_DIR}/include ${MathGL_BINARY_DIR}/include) + include_directories( ${MathGL2_SOURCE_DIR}/include ${MathGL2_BINARY_DIR}/include) set(MGL_INCLUDE_PATH "${CMAKE_INSTALL_PREFIX}/include/mgl2") set(MGL_CGI_PATH "${CMAKE_INSTALL_PREFIX}/share/mathgl" CACHE STRING "Set CGI install directory") set(MGL_DEF_FONT "STIX" CACHE STRING "Set default font name")