Commit 844fb40c authored by Utkarsh Ayachit's avatar Utkarsh Ayachit

More windows export fixes.

Making sure that the protobuf-generated header has correct import/exports for
dlls. Just using VTK_EXPORT doesn't work since the generated has several inline
functions that use static member variables.
parent 357e6a40
......@@ -212,7 +212,7 @@ FUNCTION (protobuf_generate out_cpp_file in_proto_file)
ADD_CUSTOM_COMMAND(
OUTPUT ${out_file}
COMMAND protoc_compiler
--cpp_out=dllexport_decl=VTK_EXPORT:${CMAKE_CURRENT_BINARY_DIR}
--cpp_out=dllexport_decl=VTK_PROTOBUF_EXPORT:${CMAKE_CURRENT_BINARY_DIR}
--proto_path ${path} ${absolute}
DEPENDS ${in_proto_file} protoc_compiler
)
......
......@@ -48,6 +48,7 @@ SET (Kit_SRCS
vtkPMVectorProperty.cxx
vtkPMWriterProxy.cxx
vtkPMXMLAnimationWriterRepresentationProperty.cxx
vtkSMMessage.cxx
vtkSMProxyDefinitionIterator.cxx
vtkSMProxyDefinitionManager.cxx
vtkSMSessionBase.cxx
......@@ -56,16 +57,17 @@ SET (Kit_SRCS
vtkSMSessionServer.cxx
)
#SET_SOURCE_FILES_PROPERTIES(
#
# WRAP_EXCLUDE
# )
#
SET_SOURCE_FILES_PROPERTIES(
vtkSMMessage.cxx
WRAP_EXCLUDE
)
SET_SOURCE_FILES_PROPERTIES(
vtkSMProxyDefinitionIterator.cxx
vtkPMObject.cxx
vtkPMVectorProperty.cxx
vtkSMSessionBase.cxx
vtkSMMessage.cxx
ABSTRACT)
INCLUDE_DIRECTORIES(
......@@ -152,9 +154,6 @@ SET (dynamicHeaders
"${dynamicHeaders};${CMAKE_CURRENT_BINARY_DIR}/vtkParaViewIncludeModulesToSMApplication.h")
SET_SOURCE_FILES_PROPERTIES(vtkSMApplication.cxx PROPERTIES OBJECT_DEPENDS
${CMAKE_CURRENT_BINARY_DIR}/vtkSMGeneratedModules.h)
SET_SOURCE_FILES_PROPERTIES(vtkSMProxyDefinitionManager.cxx PROPERTIES OBJECT_DEPENDS
${CMAKE_CURRENT_BINARY_DIR}/vtkSMGeneratedModules.h)
......@@ -213,9 +212,7 @@ ENDIF (PARAVIEW_ENABLE_PYTHON)
# Create the library.
VTK_ADD_LIBRARY(vtk${KIT}
${protobuf_generated_files}
${Kit_SRCS}
vtkPVMessage.cxx
${KitInstantiator_SRCS}
)
TARGET_LINK_LIBRARIES(vtk${KIT}
......@@ -225,6 +222,9 @@ TARGET_LINK_LIBRARIES(vtk${KIT}
protobuf
)
SET_SOURCE_FILES_PROPERTIES(vtkSMMessage.cxx PROPERTIES OBJECT_DEPENDS
${protobuf_generated_files})
IF(NOT PV_INSTALL_NO_LIBRARIES)
SET(temp_TO_INSTALL
vtk${KIT})
......
/*=========================================================================
Program: ParaView
Module: $RCSfile$
Module: vtkSMMessage.cxx
Copyright (c) Kitware, Inc.
All rights reserved.
......@@ -12,5 +12,8 @@
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "vtkSystemIncludes.h"
// bring in the definition for VTK_PROTOBUF_EXPORT.
#include "vtkSMMessage.h"
// The actual implementation is the file generated from "protoc".
#include "vtkPVMessage.pb.cc"
......@@ -21,6 +21,18 @@
#ifndef __vtkSMMessageMinimal_h
#define __vtkSMMessageMinimal_h
#include "vtkSystemIncludes.h"
// Define the export Macro
#if defined(VTK_BUILD_SHARED_LIBS)
#if defined(vtkPVServerImplementation_EXPORTS)
#define VTK_PROTOBUF_EXPORT VTK_ABI_EXPORT
#else
#define VTK_PROTOBUF_EXPORT VTK_ABI_IMPORT
#endif
#else
#define VTK_PROTOBUF_EXPORT VTK_EXPORT
#endif
namespace paraview_protobuf
{
class Message;
......
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