Commit 908696bc authored by Manuel Grizonnet's avatar Manuel Grizonnet

Merge branch 'muparserx_4_0_7' into develop

parents fda9f6f7 80676832
......@@ -118,7 +118,7 @@ See table \ref{tab:otb-dependencies} for the full list of dependencies.
\hline
\textbf{MuParser} & \url{http://www.muparser.sourceforge.net} & no & - \\
\hline
\textbf{MuParserX} & \url{http://muparserx.beltoforion.de} & no & 3.0.5 \\
\textbf{MuParserX} & \url{http://muparserx.beltoforion.de} & no & 4.0.7 \\
\hline
\textbf{OpenCV} & \url{http://opencv.org} & no & 2 \\
\hline
......
......@@ -2,13 +2,5 @@ project(OTBMuParserX)
set(OTBMuParserX_SYSTEM_INCLUDE_DIRS ${MUPARSERX_INCLUDE_DIRS})
set(OTBMuParserX_LIBRARIES "${MUPARSERX_LIBRARIES}")
set(OTBMuParserX_INCLUDE_DIRS ${OTBMuParserX_BINARY_DIR}/src)
configure_file( src/mpCompat.h.in src/mpCompat.h )
otb_module_impl()
install(FILES ${OTBMuParserX_BINARY_DIR}/src/mpCompat.h
DESTINATION ${OTBMuParserX_INSTALL_INCLUDE_DIR}
COMPONENT Development
)
......@@ -10,3 +10,5 @@ otb_module(OTBMuParserX
)
otb_module_activation_option("Enable MuParserX dependent modules" OFF)
otb_module_requires_cxx11()
/*=========================================================================
Program: ORFEO Toolbox
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
See OTBCopyright.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef MUP_COMPAT_H
#define MUP_COMPAT_H
/* defined if OTB_CXX_HAS_UNIQUE_PTR cmake check is OK. */
/* See CMake/OTBCheckCpp11Keywords.cmake for more details */
#cmakedefine OTB_CXX_HAS_UNIQUE_PTR
#ifndef OTB_CXX_HAS_UNIQUE_PTR
#define unique_ptr auto_ptr
#endif
/* defined if OTB_CXX_HAS_OVERRIDE_SPECIFIER cmake check is OK. */
/* See CMake/OTBCheckCpp11Keywords.cmake for more details */
#cmakedefine OTB_CXX_HAS_OVERRIDE_SPECIFIER
#ifndef OTB_CXX_HAS_OVERRIDE_SPECIFIER
#define override
#endif
/* defined if OTB_CXX_HAS_NULLPTR cmake check is OK. */
/* See CMake/OTBCheckCpp11Keywords.cmake for more details */
#cmakedefine OTB_CXX_HAS_NULLPTR
#ifndef OTB_CXX_HAS_NULLPTR
#define nullptr NULL
#endif
#endif //MUP_COMPAT_H
......@@ -2,33 +2,31 @@ INCLUDE_ONCE_MACRO(MUPARSERX)
SETUP_SUPERBUILD(MUPARSERX)
package_require_cxx11(MUPARSERX)
#Don't build muparserx examples
set(MUPARSERX_FLAGS)
if(APPLE)
set(MUPARSERX_FLAGS "-DCMAKE_CXX_FLAGS:STRING=-std=c++0x")
endif()
list(APPEND MUPARSERX_FLAGS -DBUILD_EXAMPLES:BOOL=OFF)
# We provide a zip archive of last muparserx release (3.0.5)
# Archive was generated using commit sha on muparserx github page
# Commands to create source archive:
# wget https://github.com/beltoforion/muparserx/archive/2ace83b5411f1ab9940653c2bab0efa5140efb71.zip
# mv 2ace83b5411f1ab9940653c2bab0efa5140efb71.zip muparserx_v3_0_5.zip
if(MSVC AND BUILD_SHARED_LIBS)
list(APPEND MUPARSERX_FLAGS -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS:BOOL=ON)
endif()
ExternalProject_Add(MUPARSERX
PREFIX MUPARSERX
URL "https://www.orfeo-toolbox.org/packages/muparserx_v3_0_5.zip"
URL_MD5 ad86b88c159ab68f4bfc99d71166e3c5
URL "https://github.com/beltoforion/muparserx/archive/v4.0.7.zip"
URL_MD5 67819fc478436ea8f647c804e6f2e1a2
BINARY_DIR ${MUPARSERX_SB_BUILD_DIR}
INSTALL_DIR ${SB_INSTALL_PREFIX}
DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
CMAKE_CACHE_ARGS ${SB_CMAKE_CACHE_ARGS} ${MUPARSERX_FLAGS}
CMAKE_CACHE_ARGS
${SB_CMAKE_CACHE_ARGS}
${MUPARSERX_FLAGS}
CMAKE_COMMAND ${SB_CMAKE_COMMAND}
DEPENDS ${MUPARSERX_DEPENDENCIES}
PATCH_COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_SOURCE_DIR}/patches/MUPARSERX/CMakeLists.txt
${MUPARSERX_SB_SRC}
UPDATE_COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_SOURCE_DIR}/patches/MUPARSERX/mpParserMessageProvider.cpp
${MUPARSERX_SB_SRC}/parser/
)
SUPERBUILD_UPDATE_CMAKE_VARIABLES(MUPARSERX FALSE)
\ No newline at end of file
#Patch mpParserMessageProvider.cpp. This patch is integrated upstream but not yet released (last release is 4.0.7)
SUPERBUILD_PATCH_SOURCE(MUPARSERX)
SUPERBUILD_UPDATE_CMAKE_VARIABLES(MUPARSERX FALSE)
cmake_minimum_required(VERSION 2.8.3)
project(muparserx)
# Set a default build type if none was specified
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to 'Release' as none was specified.")
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()
option(BUILD_SHARED_LIBS "Building shared libs. Default is ON" ON)
if(MSVC AND BUILD_SHARED_LIBS)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
endif()
file(GLOB MUPARSERX_SRCS "parser/*.cpp" )
file(GLOB MUPARSERX_HEADERS "parser/*.h")
# avoid noxious mpCompat.h
list(REMOVE_ITEM MUPARSERX_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/parser/mpCompat.h")
add_library(muparserx ${MUPARSERX_SRCS})
option(BUILD_SAMPLES "Build sample executable" ON)
include_directories(parser)
add_executable(muparserx-sample sample/timer.cpp sample/example.cpp)
target_link_libraries(muparserx-sample muparserx)
install(TARGETS muparserx
RUNTIME DESTINATION bin COMPONENT RuntimeLibraries
LIBRARY DESTINATION lib COMPONENT RuntimeLibraries
ARCHIVE DESTINATION lib COMPONENT Development)
install(FILES ${MUPARSERX_HEADERS}
DESTINATION include
COMPONENT Development)
diff --git a/parser/mpParserMessageProvider.cpp b/parser/mpParserMessageProvider.cpp
index 22534e6..dbd4427 100644
--- a/parser/mpParserMessageProvider.cpp
+++ b/parser/mpParserMessageProvider.cpp
@@ -1,5 +1,4 @@
-#include "mpParserMessageProvider.h"
-
+#include "mpParserMessageProvider.h"
#include <cassert>
#include "mpError.h"
@@ -111,7 +110,7 @@ MUP_NAMESPACE_START
//-------------------------------------------------------------------------------------------------
//
- // class ParserMessageProviderGerman - German translations of Parser Messages
+ // class ParserMessageProviderGerman - German translations of Parser Messages
//
//-------------------------------------------------------------------------------------------------
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9cd37d6..7964e22 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -18,7 +18,7 @@ set(MUPARSERX_VERSION ${CMAKE_MATCH_1})
########################################################################
# Compiler specific flags
########################################################################
-if(CMAKE_COMPILER_IS_GNUCXX)
+if(CMAKE_COMPILER_IS_GNUCXX OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
@@ -33,7 +33,7 @@ if(CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
endif()
-endif(CMAKE_COMPILER_IS_GNUCXX)
+endif(CMAKE_COMPILER_IS_GNUCXX OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
#enable c++11 extensions for OSX
if (APPLE)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment