+ allow to load PartDesign even if PySide is not found, suppress MinGW warnings

This commit is contained in:
wmayer 2014-08-30 23:26:29 +02:00
parent cef2c1bc8c
commit 7c89591ff6
3 changed files with 16 additions and 6 deletions

View File

@ -702,8 +702,13 @@ ELSE(MSVC)
MESSAGE(STATUS "Build type: ${CMAKE_BUILD_TYPE}") MESSAGE(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
ENDIF(MSVC) ENDIF(MSVC)
IF(MINGW) IF(MINGW)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mthreads") # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=12477
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mthreads") # Actually '-Wno-inline-dllimport' should work to suppress warnings of the form:
# inline function 'foo' is declared as dllimport: attribute ignored
# But it doesn't work with MinGW gcc 4.5.0 while using '-Wno-attributes' seems to
# do the trick.
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mthreads -Wno-attributes")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mthreads -Wno-attributes")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -mthreads -Wl,--export-all-symbols") SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -mthreads -Wl,--export-all-symbols")
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -mthreads -Wl,--export-all-symbols") SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -mthreads -Wl,--export-all-symbols")
# http://stackoverflow.com/questions/8375310/warning-auto-importing-has-been-activated-without-enable-auto-import-specifie # http://stackoverflow.com/questions/8375310/warning-auto-importing-has-been-activated-without-enable-auto-import-specifie

View File

@ -191,11 +191,13 @@ Gui::MenuItem* Workbench::setupMenuBar() const
<< "PartDesign_LinearPattern" << "PartDesign_LinearPattern"
<< "PartDesign_PolarPattern" << "PartDesign_PolarPattern"
// << "PartDesign_Scaled" // << "PartDesign_Scaled"
<< "PartDesign_MultiTransform" << "PartDesign_MultiTransform";
<< "PartDesign_InvoluteGear";
// For 0.13 a couple of python packages like numpy, matplotlib and others // For 0.13 a couple of python packages like numpy, matplotlib and others
// are not deployed with the installer on Windows. Thus, the WizardShaft is // are not deployed with the installer on Windows. Thus, the WizardShaft is
// not deployed either hence the check for the existence of the command. // not deployed either hence the check for the existence of the command.
if (Gui::Application::Instance->commandManager().getCommandByName("PartDesign_InvoluteGear")) {
*part << "PartDesign_InvoluteGear";
}
if (Gui::Application::Instance->commandManager().getCommandByName("PartDesign_WizardShaft")) { if (Gui::Application::Instance->commandManager().getCommandByName("PartDesign_WizardShaft")) {
*part << "Separator" << "PartDesign_WizardShaft"; *part << "Separator" << "PartDesign_WizardShaft";
} }

View File

@ -69,10 +69,13 @@ class PartDesignWorkbench ( Workbench ):
try: try:
from WizardShaft import WizardShaft from WizardShaft import WizardShaft
except: except:
print "Wizard shaft not installed" print "Wizard shaft module cannot be loaded"
import PartDesignGui import PartDesignGui
import PartDesign import PartDesign
try:
import InvoluteGearFeature import InvoluteGearFeature
except:
print "Involute gear module cannot be loaded"
def GetClassName(self): def GetClassName(self):
return "PartDesignGui::Workbench" return "PartDesignGui::Workbench"