From b93651493795783ca607ea08b959ce7494052a20 Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 21 Sep 2015 00:45:03 +0200 Subject: [PATCH] + fix build problems with MSVC and libpack --- src/3rdParty/salomesmesh/CMakeLists.txt | 4 +++- src/App/Expression.cpp | 5 +++-- src/App/PropertyStandard.cpp | 7 ++++--- src/Mod/Draft/App/CMakeLists.txt | 1 + src/Mod/Drawing/App/CMakeLists.txt | 1 + src/Mod/PartDesign/Gui/TaskLinearPatternParameters.cpp | 6 ++++-- src/Mod/PartDesign/Gui/TaskPolarPatternParameters.cpp | 6 ++++-- src/Mod/PartDesign/Gui/TaskScaledParameters.cpp | 6 ++++-- src/Mod/Points/App/CMakeLists.txt | 1 + src/Mod/Raytracing/App/CMakeLists.txt | 1 + 10 files changed, 26 insertions(+), 12 deletions(-) diff --git a/src/3rdParty/salomesmesh/CMakeLists.txt b/src/3rdParty/salomesmesh/CMakeLists.txt index ff6fc5982..09e797477 100644 --- a/src/3rdParty/salomesmesh/CMakeLists.txt +++ b/src/3rdParty/salomesmesh/CMakeLists.txt @@ -6,7 +6,9 @@ SET(SMESH_VERSION_MINOR 1) SET(SMESH_VERSION_PATCH 2) SET(SMESH_VERSION_TWEAK 2) -set(CMAKE_CXX_FLAGS " ${CMAKE_CXX_FLAGS} -Wno-sign-compare -Wno-reorder -Wno-switch -Wno-unused-variable -Wno-unused-but-set-variable -Wno-comment") +if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGXX) + set(CMAKE_CXX_FLAGS " ${CMAKE_CXX_FLAGS} -Wno-sign-compare -Wno-reorder -Wno-switch -Wno-unused-variable -Wno-unused-but-set-variable -Wno-comment") +endif() CMAKE_MINIMUM_REQUIRED(VERSION 2.6) diff --git a/src/App/Expression.cpp b/src/App/Expression.cpp index 047179b8c..2e61cdc9c 100644 --- a/src/App/Expression.cpp +++ b/src/App/Expression.cpp @@ -46,6 +46,7 @@ #include #include #include +#include #ifndef M_PI #define M_PI 3.14159265358979323846 @@ -770,10 +771,10 @@ Expression * FunctionExpression::eval() const break; } case ROUND: - output = round(value); + output = boost::math::round(value); break; case TRUNC: - output = trunc(value); + output = boost::math::trunc(value); break; case CEIL: output = ceil(value); diff --git a/src/App/PropertyStandard.cpp b/src/App/PropertyStandard.cpp index 558ec05fa..abce4a8da 100644 --- a/src/App/PropertyStandard.cpp +++ b/src/App/PropertyStandard.cpp @@ -30,6 +30,7 @@ #endif /// Here the FreeCAD includes sorted by Base,App,Gui...... +#include #include #include @@ -139,9 +140,9 @@ void PropertyInteger::setValue(const ObjectIdentifier &path, const boost::any &v if (value.type() == typeid(long)) setValue(boost::any_cast(value)); else if (value.type() == typeid(double)) - setValue(round(boost::any_cast(value))); + setValue(boost::math::round(boost::any_cast(value))); else if (value.type() == typeid(Quantity) && boost::any_cast(value).getUnit().isEmpty()) - setValue(round(boost::any_cast(value).getValue())); + setValue(boost::math::round(boost::any_cast(value).getValue())); else if (value.type() == typeid(int)) setValue(boost::any_cast(value)); else @@ -1914,7 +1915,7 @@ void PropertyBool::setValue(const ObjectIdentifier &path, const boost::any &valu else if (value.type() == typeid(int)) setValue(boost::any_cast(value) != 0); else if (value.type() == typeid(double)) - setValue(round(boost::any_cast(value))); + setValue(boost::math::round(boost::any_cast(value))); else if (value.type() == typeid(Quantity) && boost::any_cast(value).getUnit().isEmpty()) setValue(boost::any_cast(value).getValue() != 0); else diff --git a/src/Mod/Draft/App/CMakeLists.txt b/src/Mod/Draft/App/CMakeLists.txt index 87a357889..d801f51d6 100644 --- a/src/Mod/Draft/App/CMakeLists.txt +++ b/src/Mod/Draft/App/CMakeLists.txt @@ -14,6 +14,7 @@ include_directories( ${OCC_INCLUDE_DIR} ${PYTHON_INCLUDE_DIRS} ${XercesC_INCLUDE_DIRS} + ${QT_QTCORE_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} ) link_directories(${OCC_LIBRARY_DIR}) diff --git a/src/Mod/Drawing/App/CMakeLists.txt b/src/Mod/Drawing/App/CMakeLists.txt index 51394aea1..483f0886d 100644 --- a/src/Mod/Drawing/App/CMakeLists.txt +++ b/src/Mod/Drawing/App/CMakeLists.txt @@ -11,6 +11,7 @@ include_directories( ${ZLIB_INCLUDE_DIR} ${PYTHON_INCLUDE_DIRS} ${XercesC_INCLUDE_DIRS} + ${QT_QTCORE_INCLUDE_DIR} ) link_directories(${OCC_LIBRARY_DIR}) diff --git a/src/Mod/PartDesign/Gui/TaskLinearPatternParameters.cpp b/src/Mod/PartDesign/Gui/TaskLinearPatternParameters.cpp index d9a839fee..f6b576563 100644 --- a/src/Mod/PartDesign/Gui/TaskLinearPatternParameters.cpp +++ b/src/Mod/PartDesign/Gui/TaskLinearPatternParameters.cpp @@ -28,6 +28,8 @@ # include #endif +#include + #include "ui_TaskLinearPatternParameters.h" #include "TaskLinearPatternParameters.h" #include "TaskMultiTransformParameters.h" @@ -278,7 +280,7 @@ void TaskLinearPatternParameters::onOccurrences(const double n) { if (blockUpdate) return; PartDesign::LinearPattern* pcLinearPattern = static_cast(getObject()); - pcLinearPattern->Occurrences.setValue(round(n)); + pcLinearPattern->Occurrences.setValue(boost::math::round(n)); exitSelectionMode(); kickUpdateViewTimer(); @@ -380,7 +382,7 @@ const double TaskLinearPatternParameters::getLength(void) const const unsigned TaskLinearPatternParameters::getOccurrences(void) const { - return round(ui->spinOccurrences->value().getValue()); + return boost::math::round(ui->spinOccurrences->value().getValue()); } diff --git a/src/Mod/PartDesign/Gui/TaskPolarPatternParameters.cpp b/src/Mod/PartDesign/Gui/TaskPolarPatternParameters.cpp index 66ed8e1d3..bea806bda 100644 --- a/src/Mod/PartDesign/Gui/TaskPolarPatternParameters.cpp +++ b/src/Mod/PartDesign/Gui/TaskPolarPatternParameters.cpp @@ -28,6 +28,8 @@ # include #endif +#include + #include "ui_TaskPolarPatternParameters.h" #include "TaskPolarPatternParameters.h" #include "TaskMultiTransformParameters.h" @@ -251,7 +253,7 @@ void TaskPolarPatternParameters::onOccurrences(const double n) { if (blockUpdate) return; PartDesign::PolarPattern* pcPolarPattern = static_cast(getObject()); - pcPolarPattern->Occurrences.setValue(round(n)); + pcPolarPattern->Occurrences.setValue(boost::math::round(n)); exitSelectionMode(); kickUpdateViewTimer(); @@ -326,7 +328,7 @@ const double TaskPolarPatternParameters::getAngle(void) const const unsigned TaskPolarPatternParameters::getOccurrences(void) const { - return round(ui->spinOccurrences->value().getValue()); + return boost::math::round(ui->spinOccurrences->value().getValue()); } diff --git a/src/Mod/PartDesign/Gui/TaskScaledParameters.cpp b/src/Mod/PartDesign/Gui/TaskScaledParameters.cpp index 4ad3f6dcd..74c3e498d 100644 --- a/src/Mod/PartDesign/Gui/TaskScaledParameters.cpp +++ b/src/Mod/PartDesign/Gui/TaskScaledParameters.cpp @@ -27,6 +27,8 @@ # include #endif +#include + #include "ui_TaskScaledParameters.h" #include "TaskScaledParameters.h" #include "TaskMultiTransformParameters.h" @@ -160,7 +162,7 @@ void TaskScaledParameters::onOccurrences(const double n) if (blockUpdate) return; PartDesign::Scaled* pcScaled = static_cast(getObject()); - pcScaled->Occurrences.setValue(round(n)); + pcScaled->Occurrences.setValue(boost::math::round(n)); recomputeFeature(); } @@ -183,7 +185,7 @@ const double TaskScaledParameters::getFactor(void) const const unsigned TaskScaledParameters::getOccurrences(void) const { - return round(ui->spinOccurrences->value().getValue()); + return boost::math::round(ui->spinOccurrences->value().getValue()); } TaskScaledParameters::~TaskScaledParameters() diff --git a/src/Mod/Points/App/CMakeLists.txt b/src/Mod/Points/App/CMakeLists.txt index 082493c2c..6064b0466 100644 --- a/src/Mod/Points/App/CMakeLists.txt +++ b/src/Mod/Points/App/CMakeLists.txt @@ -15,6 +15,7 @@ include_directories( ${EIGEN3_INCLUDE_DIR} ${PCL_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS} + ${QT_QTCORE_INCLUDE_DIR} ${XercesC_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIR} ) diff --git a/src/Mod/Raytracing/App/CMakeLists.txt b/src/Mod/Raytracing/App/CMakeLists.txt index a4cb239cf..1da8a094c 100644 --- a/src/Mod/Raytracing/App/CMakeLists.txt +++ b/src/Mod/Raytracing/App/CMakeLists.txt @@ -11,6 +11,7 @@ include_directories( ${Boost_INCLUDE_DIRS} ${OCC_INCLUDE_DIR} ${PYTHON_INCLUDE_DIRS} + ${QT_QTCORE_INCLUDE_DIR} ${XercesC_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIR} )