From db31ff6879d18bd42cb328c9f7d6ede521a3cfb2 Mon Sep 17 00:00:00 2001 From: rnv Date: Mon, 24 Jun 2013 10:36:30 +0000 Subject: [PATCH] Preparation of the SALOME7.2.0 win32 version. --- CMakeLists.txt | 10 +++--- adm_local/cmake_files/FindSalomeCAS.cmake | 14 ++------ adm_local/cmake_files/FindSalomeVTK.cmake | 2 +- doc/salome/gui/CMakeLists.txt | 2 +- src/GuiHelpers/CMakeLists.txt | 2 +- src/OBJECT/CMakeLists.txt | 3 +- .../SALOME_PYQT_GUI/CMakeLists.txt | 1 + src/Session/CMakeLists.txt | 1 + src/TOOLSGUI/CMakeLists.txt | 9 +++--- src/VTKViewer/CMakeLists.txt | 2 +- src/VTKViewer/VTKViewer_PolyDataMapper.cxx | 7 ++++ tools/dlgfactory/CMakeLists.txt | 4 +-- tools/vtkEDFOverloads/vtkEDFFactory.cxx | 32 +++++++++++++++++++ 13 files changed, 63 insertions(+), 26 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 89f8d3582..6354fb3bf 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,11 +70,13 @@ SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${KERNEL_ROOT_DIR}/salome_adm/cmake_f find_package(PLATFORM) - # Threads -SET(CMAKE_THREAD_PREFER_PTHREAD) -find_package(Threads REQUIRED) - +if(WINDOWS) + find_package(SalomePTHREAD REQUIRED) +else(WINDOWS) + SET(CMAKE_THREAD_PREFER_PTHREAD) + find_package(Threads REQUIRED) +endif(WINDOWS) # required prerequisites from KERNEL diff --git a/adm_local/cmake_files/FindSalomeCAS.cmake b/adm_local/cmake_files/FindSalomeCAS.cmake index c2b4ac325..66a93e73a 100644 --- a/adm_local/cmake_files/FindSalomeCAS.cmake +++ b/adm_local/cmake_files/FindSalomeCAS.cmake @@ -25,20 +25,12 @@ if(EXISTS ${CAS_ROOT_DIR}) set(CMAKE_PROGRAM_PATH ${CAS_ROOT_DIR}/bin) if(WINDOWS) if(CMAKE_BUILD_TYPE STREQUAL Debug) - set(CMAKE_LIBRARY_PATH ${CAS_ROOT}/win32/libd) + set(CMAKE_LIBRARY_PATH ${CAS_ROOT_DIR}/win32/libd) else(CMAKE_BUILD_TYPE STREQUAL Debug) - set(CMAKE_LIBRARY_DIR ${CAS_ROOT}/win32/lib) + set(CMAKE_LIBRARY_PATH ${CAS_ROOT_DIR}/win32/lib) endif(CMAKE_BUILD_TYPE STREQUAL Debug) else(WINDOWS) set(CMAKE_LIBRARY_PATH ${CAS_ROOT_DIR}/lib) endif(WINDOWS) endif(EXISTS ${CAS_ROOT_DIR}) -find_package(CAS) - -IF(CAS_StdLPlugin) - SET(CAS_STDPLUGIN StdPlugin) -ELSE(CAS_StdLPlugin) - IF(CAS_TKStdSchema) - SET(CAS_STDPLUGIN TKStdSchema) - ENDIF(CAS_TKStdSchema) -ENDIF(CAS_StdLPlugin) \ No newline at end of file +find_package(CAS) \ No newline at end of file diff --git a/adm_local/cmake_files/FindSalomeVTK.cmake b/adm_local/cmake_files/FindSalomeVTK.cmake index 3f6ec83f5..8f2d10d07 100644 --- a/adm_local/cmake_files/FindSalomeVTK.cmake +++ b/adm_local/cmake_files/FindSalomeVTK.cmake @@ -24,7 +24,7 @@ set(PARAVIEW_VERSION $ENV{PARAVIEW_VERSION} CACHE STRING "Version of Paraview") if(EXISTS ${PARAVIEW_ROOT_DIR}) set(VTK_DIR ${PARAVIEW_ROOT_DIR}/lib/cmake/paraview-${PARAVIEW_VERSION} CACHE PATH "Path to directory including VTKConfig.cmake") endif(EXISTS ${PARAVIEW_ROOT_DIR}) -set(VTK_COMPONENTS vtkRenderingFreeTypeOpenGL vtkRenderingLOD vtkRenderingAnnotation vtkFiltersParallel vtkIOExport) +set(VTK_COMPONENTS vtkRenderingFreeTypeOpenGL vtkRenderingLOD vtkRenderingAnnotation vtkFiltersParallel vtkIOExport vtkWrappingPython) find_package(VTK 6.0 REQUIRED COMPONENTS ${VTK_COMPONENTS} NO_MODULE) if (VTK_FOUND) message(STATUS "VTK version is ${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}") diff --git a/doc/salome/gui/CMakeLists.txt b/doc/salome/gui/CMakeLists.txt index 1abb0f4c3..c39cf66a7 100755 --- a/doc/salome/gui/CMakeLists.txt +++ b/doc/salome/gui/CMakeLists.txt @@ -34,6 +34,6 @@ ADD_CUSTOM_TARGET(usr_docs ${DOXYGEN_EXECUTABLE}) ADD_DEPENDENCIES(usr_docs html_docs) -INSTALL(CODE "EXECUTE_PROCESS(COMMAND \"${CMAKE_COMMAND}\" --build ${CMAKE_BINARY_DIR} --target usr_docs)") +INSTALL(CODE "EXECUTE_PROCESS(COMMAND \"${DOXYGEN_EXECUTABLE}\" WORKING_DIRECTORY \"${CMAKE_CURRENT_BINARY_DIR}\")") INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/GUI DESTINATION share/doc/salome/gui) INSTALL(FILES images/head.png DESTINATION share/doc/salome/gui/GUI) diff --git a/src/GuiHelpers/CMakeLists.txt b/src/GuiHelpers/CMakeLists.txt index 7fda47fd2..8bf278a4a 100755 --- a/src/GuiHelpers/CMakeLists.txt +++ b/src/GuiHelpers/CMakeLists.txt @@ -44,7 +44,7 @@ SET(SalomeGuiHelpers_SOURCES ADD_DEFINITIONS(${CAS_DEFINITIONS} ${QT_DEFINITIONS} ${BOOST_DEFINITIONS} ${OMNIORB_DEFINITIONS}) ADD_LIBRARY(SalomeGuiHelpers ${SalomeGuiHelpers_SOURCES} ${GUI_HEADERS_MOC}) -TARGET_LINK_LIBRARIES(SalomeGuiHelpers SalomeApp ${SalomeKernelHelpers} ${CORBA_LIBS}) +TARGET_LINK_LIBRARIES(SalomeGuiHelpers SalomeApp ${KERNEL_SalomeKernelHelpers} ${CORBA_LIBS}) INSTALL(TARGETS SalomeGuiHelpers DESTINATION ${GUI_salomelib_LIBS}) FILE(GLOB COMMON_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx") diff --git a/src/OBJECT/CMakeLists.txt b/src/OBJECT/CMakeLists.txt index d0eeb0d71..4fafadc38 100755 --- a/src/OBJECT/CMakeLists.txt +++ b/src/OBJECT/CMakeLists.txt @@ -27,7 +27,8 @@ INCLUDE_DIRECTORIES( SET(COMMON_LIBS ${QT_LIBRARIES} ${CAS_LDPATH} - ${TKV3d} + ${CAS_KERNEL} + ${CAS_TKV3d} ) SET(SalomeObject_SOURCES diff --git a/src/SALOME_PYQT/SALOME_PYQT_GUI/CMakeLists.txt b/src/SALOME_PYQT/SALOME_PYQT_GUI/CMakeLists.txt index df2eab738..8346300b7 100755 --- a/src/SALOME_PYQT/SALOME_PYQT_GUI/CMakeLists.txt +++ b/src/SALOME_PYQT/SALOME_PYQT_GUI/CMakeLists.txt @@ -49,6 +49,7 @@ SET(COMMON_LIBS ${VTK_LIBRARIES} ${OPENGL_LIBRARIES} ${PLATFORM_LIBS} + ${OMNIORB_LIBRARIES} PyInterp SalomeApp OCCViewer diff --git a/src/Session/CMakeLists.txt b/src/Session/CMakeLists.txt index 77dda275e..6a7e9c91a 100755 --- a/src/Session/CMakeLists.txt +++ b/src/Session/CMakeLists.txt @@ -51,6 +51,7 @@ SET(COMMON_LIBS ${KERNEL_SalomeLauncher} ${KERNEL_Registry} ${KERNEL_SALOMEBasics} + ${OMNIORB_LIBRARIES} suit Event SalomeIDLGUI diff --git a/src/TOOLSGUI/CMakeLists.txt b/src/TOOLSGUI/CMakeLists.txt index 46cc1eff5..4f4e3b0f9 100755 --- a/src/TOOLSGUI/CMakeLists.txt +++ b/src/TOOLSGUI/CMakeLists.txt @@ -34,10 +34,11 @@ SET(COMMON_LIBS ${QT_LIBRARIES} suit ${CAS_KERNEL} - ${SalomeIDLKernel} - ${SALOMELocalTrace} - ${SalomeNS} - ${OpUtil} + ${KERNEL_SalomeIDLKernel} + ${KERNEL_SALOMELocalTrace} + ${KERNEL_SalomeNS} + ${KERNEL_OpUtil} + ${OMNIORB_LIBRARIES} SalomeIDLGUI ) diff --git a/src/VTKViewer/CMakeLists.txt b/src/VTKViewer/CMakeLists.txt index 7ae0a27ba..c1cfaf9c8 100755 --- a/src/VTKViewer/CMakeLists.txt +++ b/src/VTKViewer/CMakeLists.txt @@ -30,7 +30,7 @@ INCLUDE_DIRECTORIES( ADD_DEFINITIONS(${CAS_DEFINITIONS} ${QT_DEFINITIONS}) -SET(COMMON_LIBS ${QT_LIBRARIES} ${OPENGL_LIBRARIES} ${VTK_LIBRARIES} ${CAS_KERNEL} qtx suit ${SALOMELocalTrace}) +SET(COMMON_LIBS ${QT_LIBRARIES} ${OPENGL_LIBRARIES} ${VTK_LIBRARIES} ${CAS_KERNEL} qtx suit ${KERNEL_SALOMELocalTrace}) SET(GUI_HEADERS VTKViewer_RenderWindow.h diff --git a/src/VTKViewer/VTKViewer_PolyDataMapper.cxx b/src/VTKViewer/VTKViewer_PolyDataMapper.cxx index b032653e3..dc0e23331 100644 --- a/src/VTKViewer/VTKViewer_PolyDataMapper.cxx +++ b/src/VTKViewer/VTKViewer_PolyDataMapper.cxx @@ -97,6 +97,13 @@ static PFNGLDELETEBUFFERSARBPROC vglDeleteBuffersARB = NULL #define GL_GetProcAddress( x ) wglGetProcAddress( (const LPCSTR)x ) #endif +#ifdef WIN32 + #ifdef max + #undef max + #endif +#endif + + bool InitializeBufferExtensions() { vglGenBuffersARB = (PFNGLGENBUFFERSARBPROC)GL_GetProcAddress( "glGenBuffersARB" ); diff --git a/tools/dlgfactory/CMakeLists.txt b/tools/dlgfactory/CMakeLists.txt index 8510d1f92..47c976b56 100755 --- a/tools/dlgfactory/CMakeLists.txt +++ b/tools/dlgfactory/CMakeLists.txt @@ -59,11 +59,11 @@ SET(GenericDialog_FORMS ADD_DEFINITIONS(${QT_DEFINITIONS}) ADD_CUSTOM_COMMAND( OUTPUT QDialogTest.cxx QDialogTest.h QDialogTest.ui - COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/dlgfactory.py -s -n QDialogTest -t qdialog + COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/dlgfactory.py -s -n QDialogTest -t qdialog ) ADD_CUSTOM_COMMAND( OUTPUT GDialogTest.cxx GDialogTest.h GDialogTest.ui - COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/dlgfactory.py -s -n GDialogTest -t gdialog + COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/dlgfactory.py -s -n GDialogTest -t gdialog ) QT4_WRAP_UI(qtester_FORMS_HEADERS ${qtester_FORMS} ) diff --git a/tools/vtkEDFOverloads/vtkEDFFactory.cxx b/tools/vtkEDFOverloads/vtkEDFFactory.cxx index 25c153de8..d138b45d4 100755 --- a/tools/vtkEDFOverloads/vtkEDFFactory.cxx +++ b/tools/vtkEDFOverloads/vtkEDFFactory.cxx @@ -44,4 +44,36 @@ const char* vtkEDFFactory::GetDescription() return "VTK EDF Factory"; } +#ifdef WIN32 + //rnv: workaround to avoid definition __declspec( dllimport ) + //for the vtkGetFactoryCompilerUsed(), vtkGetFactoryVersion() + //and vtkLoad(). This happens because a bug in the + //vtkObjectFactory.h file. + //This workaround will be removed in the future. + #ifdef VTK_FACTORY_INTERFACE_IMPLEMENT + #undef VTK_FACTORY_INTERFACE_IMPLEMENT + + #define VTK_FACTORY_INTERFACE_IMPLEMENT(factoryName) \ + extern "C" \ + VTKEDF_OVERLOADS_EXPORT \ + const char* vtkGetFactoryCompilerUsed() \ + { \ + return VTK_CXX_COMPILER; \ + } \ + extern "C" \ + VTKEDF_OVERLOADS_EXPORT \ + const char* vtkGetFactoryVersion() \ + { \ + return VTK_SOURCE_VERSION; \ + } \ + extern "C" \ + VTKEDF_OVERLOADS_EXPORT \ + vtkObjectFactory* vtkLoad() \ + { \ + return factoryName ::New(); \ + } + #endif +#endif + + VTK_FACTORY_INTERFACE_IMPLEMENT(vtkEDFFactory); -- 2.39.2