Merge tag 'upstream/2.4.1'
authorAlastair McKinstry <mckinstry@debian.org>
Wed, 4 Oct 2017 14:22:29 +0000 (15:22 +0100)
committerAlastair McKinstry <mckinstry@debian.org>
Wed, 4 Oct 2017 14:22:29 +0000 (15:22 +0100)
1  2 
CMakeLists.txt

diff --cc CMakeLists.txt
index c9eb64b299dae28e9452f7552c1aaf95e3a6d180,907059505fff356e0fe6355fc74bb9dcd116fb8c..7a95dce4e83f8847d5428c8de5c8ad30b3b7aafa
@@@ -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")