[Paraview] Problem when compiling Paraview 3.12 on Visual Studio 2010.
Utkarsh Ayachit
utkarsh.ayachit at kitware.com
Fri Mar 16 14:46:40 EDT 2012
Francisco,
Hopefully this should do it. I tested on my Windows build as well and
seems to work as expected.
Attached as the new set of files to be placed as follows:
PV.CMakeLists.txt ==>
<ParaViewSource>/ParaViewCore/ServerImplementation/CMakeLists.txt
PROTOBUF.CMakeLists.txt ==>
<ParaViewSource>/Utilities/protobuf/CMakeLists.txt
PROTOBUF.src.CMakeLists.txt ==>
<ParaViewSource>/Utilities/protobuf/src/CMakeLists.txt
On Fri, Mar 16, 2012 at 12:37 PM, Francisco Caraballo
<francisco.caraballo at gmail.com> wrote:
> Now I'm getting this error all over the place:
>
> error C2491: 'google::protobuf::compiler::CodeGeneratorRequest::_default_parameter_'
> : definition of dllimport static data member not allowed
>
> Saludos,
>
> Francisco Caraballo
>
>
>
> On Fri, Mar 16, 2012 at 5:10 PM, Utkarsh Ayachit
> <utkarsh.ayachit at kitware.com> wrote:
>> In that case, just put the two attached files in the source tree as
>> follows (ensure that you replace the exisiting files):
>>
>> PV.CMakeLists.txt ==>
>> <ParaViewSource>/ParaViewCore/ServerImplementation/CMakeLists.txt
>> PROTOBUF.CMakeLists.txt ==>
>> <ParaViewSource>/Utilities/protobuf/src/CMakeLists.txt
>>
>> Utkarsh
>>
>>
>> On Fri, Mar 16, 2012 at 12:04 PM, Francisco Caraballo
>> <francisco.caraballo at gmail.com> wrote:
>>> I didn't originally get the code via git, so git checkout -f is not
>>> working. Should I restore the whole Paraview 3.14 tree to what I
>>> originally downloaded and then apply the new patches?
>>>
>>> Saludos/greetings,
>>>
>>> Francisco Caraballo
>>>
>>>
>>>
>>> On Fri, Mar 16, 2012 at 4:53 PM, Utkarsh Ayachit
>>> <utkarsh.ayachit at kitware.com> wrote:
>>>> Better yet, can you try the attached patches please? What I've done is
>>>> removed the dependency of protoc.exe on these unnecessary extra
>>>> libraries making it possible to avoid such traps.
>>>>
>>>> Patch the files as follows (from ParaView Source Tree):
>>>>
>>>> # discard any changes from previous patches
>>>>> git checkout -f
>>>>
>>>>> git apply paraview.patch
>>>>
>>>>> cd Utilities/protobuf
>>>>> git apply protobuf.patch
>>>>
>>>> Hopefully, this should solve the issue. If all works, I'll push this
>>>> to git and we can have these changes in the next release of ParaView.
>>>> Thanks a lot for helping track this one down.
>>>>
>>>> Utkarsh
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> On Fri, Mar 16, 2012 at 11:43 AM, Francisco Caraballo
>>>> <francisco.caraballo at gmail.com> wrote:
>>>>> This file in my computer is in C:\Program Files (x86)\zlib\bin. Should
>>>>> I add this folder somewhere?
>>>>>
>>>>> Saludos,
>>>>>
>>>>> Francisco Caraballo
>>>>>
>>>>>
>>>>>
>>>>> On Fri, Mar 16, 2012 at 4:35 PM, Utkarsh Ayachit
>>>>> <utkarsh.ayachit at kitware.com> wrote:
>>>>>> Interesting. Where is it? Isn't it already in the ParaVIew build tree?
>>>>>>
>>>>>> Utkarsh
>>>>>>
>>>>>> On Fri, Mar 16, 2012 at 11:32 AM, Francisco Caraballo
>>>>>> <francisco.caraballo at gmail.com> wrote:
>>>>>>> The DLL that is missing is zlibd1.dll
>>>>>>>
>>>>>>> Saludos/greetings,
>>>>>>>
>>>>>>> Francisco Caraballo
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Fri, Mar 16, 2012 at 3:49 PM, Utkarsh Ayachit
>>>>>>> <utkarsh.ayachit at kitware.com> wrote:
>>>>>>>> Ok. Next, can you try to locate protoc.exe under the ParaView build
>>>>>>>> tree and manually run it? You may get some missing dlls errors and
>>>>>>>> those are the ones we need to identify. In the mean time I'm going to
>>>>>>>> try to see if we can build protoc.exe statically without any
>>>>>>>> dependencies to ensure that it runs cleanly always.
>>>>>>>>
>>>>>>>> Utkarsh
>>>>>>>>
>>>>>>>> On Thu, Mar 15, 2012 at 8:55 PM, Francisco Caraballo
>>>>>>>> <francisco.caraballo at gmail.com> wrote:
>>>>>>>>> I applied it, ran cmake again from the beggining and tried building
>>>>>>>>> again, but it didnt work, same error.
>>>>>>>>> Is there any way I can validate the patch was applied correctly? I did
>>>>>>>>> it using <<git apply file.patch>> but it didnt print any success
>>>>>>>>> message.
>>>>>>>>>
>>>>>>>>> Thanks a lot for all the help!
>>>>>>>>>
>>>>>>>>> Saludos/greetings,
>>>>>>>>>
>>>>>>>>> Francisco Caraballo
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Thu, Mar 15, 2012 at 10:34 PM, Utkarsh Ayachit
>>>>>>>>> <utkarsh.ayachit at kitware.com> wrote:
>>>>>>>>>> The problem is that a tool (namely, protoc.exe) isn't being run
>>>>>>>>>> correctly to generate the needed files. Can you to apply the attached
>>>>>>>>>> patch to see if that helps solve the problem? You'll have to apply it
>>>>>>>>>> to the 3.14.0 source code.
>>>>>>>>>>
>>>>>>>>>> Utkarsh
>>>>>>>>>>
>>>>>>>>>> On Thu, Mar 15, 2012 at 4:01 PM, Francisco Caraballo
>>>>>>>>>> <francisco.caraballo at gmail.com> wrote:
>>>>>>>>>>> I'm getting the same error with 3.14:
>>>>>>>>>>> fatal error C1083: Cannot open include file: 'vtkPVMessage.pb.h': No
>>>>>>>>>>> such file or directory
>>>>>>>>>>>
>>>>>>>>>>> Saludos/greetings,
>>>>>>>>>>>
>>>>>>>>>>> Francisco Caraballo
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> On Thu, Mar 15, 2012 at 6:30 PM, Utkarsh Ayachit
>>>>>>>>>>> <utkarsh.ayachit at kitware.com> wrote:
>>>>>>>>>>>> sorry typo: I meant "unless using nmake -- which is the command line
>>>>>>>>>>>> build mechanism for VS"
>>>>>>>>>>>>
>>>>>>>>>>>> On Thu, Mar 15, 2012 at 12:44 PM, Francisco Caraballo
>>>>>>>>>>>> <francisco.caraballo at gmail.com> wrote:
>>>>>>>>>>>>> I could try with 3.14, but I am using cmake.
>>>>>>>>>>>>> What do you mean with "unless using cmake".That if I am using cmake
>>>>>>>>>>>>> 3.14 wont work either?
>>>>>>>>>>>>>
>>>>>>>>>>>>> Saludos greetings,
>>>>>>>>>>>>>
>>>>>>>>>>>>> Francisco Caraballo
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> On Thu, Mar 15, 2012 at 5:25 PM, Utkarsh Ayachit
>>>>>>>>>>>>> <utkarsh.ayachit at kitware.com> wrote:
>>>>>>>>>>>>>> Any reason you're not using 3.14? I'm not sure if this is a known
>>>>>>>>>>>>>> issue with 3.12, but we haven't seen this with 3.14 unless using
>>>>>>>>>>>>>> cmake.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Utkarsh
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> On Thu, Mar 15, 2012 at 12:20 PM, Francisco Caraballo
>>>>>>>>>>>>>> <francisco.caraballo at gmail.com> wrote:
>>>>>>>>>>>>>>> I build using the Visual Studio Express 2010 IDE
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Saludos,
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Francisco Caraballo
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> On Thu, Mar 15, 2012 at 4:46 PM, Utkarsh Ayachit
>>>>>>>>>>>>>>> <utkarsh.ayachit at kitware.com> wrote:
>>>>>>>>>>>>>>>> How do you build? Using the visual studio IDE or command line?
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> On Thu, Mar 15, 2012 at 11:33 AM, Francisco Caraballo
>>>>>>>>>>>>>>>> <francisco.caraballo at gmail.com> wrote:
>>>>>>>>>>>>>>>>> I generated the project files with Cmake. I'm not using nmake, as far
>>>>>>>>>>>>>>>>> as I know.
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> Saludos greetings,
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> Francisco Caraballo
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> On Thu, Mar 15, 2012 at 3:40 PM, Utkarsh Ayachit
>>>>>>>>>>>>>>>>> <utkarsh.ayachit at kitware.com> wrote:
>>>>>>>>>>>>>>>>>> Is this with nmake?
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> Utkarsh
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> On Thu, Mar 15, 2012 at 10:14 AM, Francisco Caraballo
>>>>>>>>>>>>>>>>>> <francisco.caraballo at gmail.com> wrote:
>>>>>>>>>>>>>>>>>>> I get the following error when compiling Paraview 3.12 on Visual
>>>>>>>>>>>>>>>>>>> Studio Express 2010.
>>>>>>>>>>>>>>>>>>> << fatal error C1083: Cannot open include file: 'vtkPVMessage.pb.h':
>>>>>>>>>>>>>>>>>>> No such file or directory >>
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>> Following other messages on this mailing-list I gathered that this has
>>>>>>>>>>>>>>>>>>> something to do with Protobuf (whatever that is). So I checked the
>>>>>>>>>>>>>>>>>>> messages related to protobuf and found this message:
>>>>>>>>>>>>>>>>>>> 4>------ Build started: Project: protobuf_code_generation,
>>>>>>>>>>>>>>>>>>> Configuration: Release Win32 ------
>>>>>>>>>>>>>>>>>>> 4> Generating vtkPVMessage.pb.h, vtkPVMessage.pb.cc
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>> So in theory the file should exist, but it doesnt.
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>> Can anyone help me out with this? Is this a Paraview problem, or a
>>>>>>>>>>>>>>>>>>> Cmake problem, or a VS Express 2010 problem?
>>>>>>>>>>>>>>>>>>> I'm compiling without MPI support (because that generates a whole
>>>>>>>>>>>>>>>>>>> other bunch of problems) could that have something to do with my
>>>>>>>>>>>>>>>>>>> problem?
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>> Saludos/greetings,
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>> Francisco Caraballo
>>>>>>>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>>>>>>> Powered by www.kitware.com
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>> Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>> Follow this link to subscribe/unsubscribe:
>>>>>>>>>>>>>>>>>>> http://www.paraview.org/mailman/listinfo/paraview
-------------- next part --------------
PROJECT(PVServerImplementation)
INCLUDE_REGULAR_EXPRESSION("^vtk.*$")
# Any build configured headers should be added to this
# variable so that they also get installed.
SET (dynamicHeaders)
# needed by vtkExportKit.cmake
SET(VTK_INSTALL_PACKAGE_DIR_CM24 ${PV_INSTALL_LIB_DIR})
SET(VTK_INSTALL_PACKAGE_DIR ${PV_INSTALL_LIB_DIR})
SET(KIT PVServerImplementation)
SET(KIT_UPCASE "PVSERVERIMPLEMENTATION")
IF(NOT WIN32)
SET(CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS}")
ADD_DEFINITIONS(-D_HPUX_SOURCE)
ENDIF(NOT WIN32)
SET (Kit_SRCS
vtkPVProxyDefinitionIterator.cxx
vtkPVSessionBase.cxx
vtkPVSessionCore.cxx
vtkPVSessionCoreInterpreterHelper.cxx
vtkPVSessionServer.cxx
vtkSIArraySelectionProperty.cxx
vtkSIChartRepresentationProxy.cxx
vtkSICollaborationManager.cxx
vtkSICompoundSourceProxy.cxx
vtkSIContextArraysProperty.cxx
vtkSIDataArrayProperty.cxx
vtkSIDoubleVectorProperty.cxx
vtkSIFileSeriesReaderProxy.cxx
vtkSIIdTypeVectorProperty.cxx
vtkSIImageTextureProxy.cxx
vtkSIInputProperty.cxx
vtkSIIntVectorProperty.cxx
vtkSIObject.cxx
vtkSIProperty.cxx
vtkSIProxy.cxx
vtkSIProxyDefinitionManager.cxx
vtkSIProxyProperty.cxx
vtkSIPVRepresentationProxy.cxx
vtkSIScalarBarActorProxy.cxx
vtkSISelectionRepresentationProxy.cxx
vtkSISILProperty.cxx
vtkSISourceProxy.cxx
vtkSIStringVectorProperty.cxx
vtkSITextSourceRepresentationProxy.cxx
vtkSITimeRangeProperty.cxx
vtkSITimeStepsProperty.cxx
vtkSIUniformGridVolumeRepresentationProxy.cxx
vtkSIUnstructuredGridVolumeRepresentationProxy.cxx
vtkSIVectorProperty.cxx
vtkSIWriterProxy.cxx
vtkSIXMLAnimationWriterRepresentationProperty.cxx
vtkSMMessage.cxx
)
SET_SOURCE_FILES_PROPERTIES(
vtkSMMessage.cxx
WRAP_EXCLUDE
)
SET_SOURCE_FILES_PROPERTIES(
vtkPVProxyDefinitionIterator.cxx
vtkSIVectorProperty.cxx
vtkPVSessionBase.cxx
vtkSMMessage.cxx
ABSTRACT)
INCLUDE_DIRECTORIES(
${PVCommon_SOURCE_DIR}
${PVCommon_BINARY_DIR}
${PVVTKExtensions_SOURCE_DIR}
${PVVTKExtensions_BINARY_DIR}
${PVClientServerCore_SOURCE_DIR}
${PVClientServerCore_BINARY_DIR}
${PVServerImplementation_SOURCE_DIR}
${PVServerImplementation_BINARY_DIR}
${protobuf_SOURCE_DIR}/src
${VTK_INCLUDE_DIR}
)
#------------------------------------------------------------------------------
# Compile protobuf resources.
# run it from a script so we can set necessary paths.
get_target_property(PROTOC_LOCATION protoc_compiler LOCATION)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/vtkPVMessage.pb.h
${CMAKE_CURRENT_BINARY_DIR}/vtkPVMessage.pb.cc
COMMAND protoc_compiler
"--cpp_out=dllexport_decl=VTK_PROTOBUF_EXPORT:${CMAKE_CURRENT_BINARY_DIR}"
--proto_path "@CMAKE_CURRENT_SOURCE_DIR@/Resources"
"${CMAKE_CURRENT_SOURCE_DIR}/Resources/vtkPVMessage.proto"
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/Resources/vtkPVMessage.proto protoc_compiler
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
add_custom_target(
protobuf_code_generation
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/vtkPVMessage.pb.h ${CMAKE_CURRENT_BINARY_DIR}/vtkPVMessage.pb.cc
)
#------------------------------------------------------------------------------
SET(resourceFiles
${CMAKE_CURRENT_SOURCE_DIR}/Resources/filters.xml
${CMAKE_CURRENT_SOURCE_DIR}/Resources/sources.xml
${CMAKE_CURRENT_SOURCE_DIR}/Resources/readers.xml
${CMAKE_CURRENT_SOURCE_DIR}/Resources/utilities.xml
${CMAKE_CURRENT_SOURCE_DIR}/Resources/rendering.xml
${CMAKE_CURRENT_SOURCE_DIR}/Resources/views_and_representations.xml
${CMAKE_CURRENT_SOURCE_DIR}/Resources/3d_widgets.xml
${CMAKE_CURRENT_SOURCE_DIR}/Resources/internal_writers.xml
${CMAKE_CURRENT_SOURCE_DIR}/Resources/writers.xml
${PARAVIEW_EXTRA_SERVERMANAGER_RESOURCES}
)
IF(PARAVIEW_ENABLE_PYTHON)
OPTION(PARAVIEW_ENABLE_PYTHON_FILTERS "Enable Python calculator and programmable filters." ON)
IF(PARAVIEW_ENABLE_PYTHON_FILTERS)
SET(resourceFiles
${resourceFiles}
${CMAKE_CURRENT_SOURCE_DIR}/Resources/pythonfilter.xml
)
ENDIF(PARAVIEW_ENABLE_PYTHON_FILTERS)
ENDIF(PARAVIEW_ENABLE_PYTHON)
SET (PARAVIEW_SERVERMANAGER_XMLS ${resourceFiles}
CACHE INTERNAL "Server Manager XMLs")
#needs to depend on vtkParaViewIncludeModulesToSMApplication so
#we can regenerate when python filters or VisItBridge are toggled on/off
SET(CMD_DEP kwProcessXML)
IF(CMAKE_CROSSCOMPILING)
SET(CMD kwProcessXML)
ELSE(CMAKE_CROSSCOMPILING)
GET_TARGET_PROPERTY(CMD kwProcessXML LOCATION)
ENDIF(CMAKE_CROSSCOMPILING)
ADD_CUSTOM_COMMAND(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/vtkSMGeneratedModules.h
DEPENDS ${resourceFiles}
${CMD_DEP}
"${CMAKE_CURRENT_BINARY_DIR}/vtkParaViewIncludeModulesToSMApplication.h"
COMMAND ${CMD}
ARGS ${CMAKE_CURRENT_BINARY_DIR}/vtkSMGeneratedModules.h
vtkSMDefaultModules Interface GetInterfaces
${resourceFiles}
COMMENT "generating modules")
SET(PARAVIEW_INCLUDE_MODULES_TO_SMAPPLICATION "")
FOREACH(rf ${resourceFiles})
STRING(REGEX REPLACE "^.*/(.*).(xml|pvsm)$" "\\1" moduleName "${rf}")
SET(oneModule " init_string = vtkSMDefaultModules${moduleName}GetInterfaces();\n")
SET(oneModule "${oneModule} parser_ret = parser->Parse(init_string);\n")
SET(oneModule "${oneModule} assert(parser_ret != 0);\n")
SET(oneModule "${oneModule} this->LoadConfigurationXML(parser->GetRootElement());\n")
SET(oneModule "${oneModule} delete[] init_string;\n")
SET(PARAVIEW_INCLUDE_MODULES_TO_SMAPPLICATION
"${PARAVIEW_INCLUDE_MODULES_TO_SMAPPLICATION}\n${oneModule}")
ENDFOREACH(rf)
CONFIGURE_FILE(
"${CMAKE_CURRENT_SOURCE_DIR}/vtkParaViewIncludeModulesToSMApplication.h.in"
"${CMAKE_CURRENT_BINARY_DIR}/vtkParaViewIncludeModulesToSMApplication.h"
@ONLY IMMEDIATE)
SET (dynamicHeaders
"${dynamicHeaders};${CMAKE_CURRENT_BINARY_DIR}/vtkParaViewIncludeModulesToSMApplication.h")
SET_SOURCE_FILES_PROPERTIES(vtkSIProxyDefinitionManager.cxx PROPERTIES OBJECT_DEPENDS
${CMAKE_CURRENT_BINARY_DIR}/vtkSMGeneratedModules.h)
# Setup vtkInstantiator registration for this library's classes.
INCLUDE(${ParaView_SOURCE_DIR}/VTK/CMake/vtkMakeInstantiator.cmake)
VTK_MAKE_INSTANTIATOR3(vtk${KIT}Instantiator KitInstantiator_SRCS
"${Kit_SRCS}"
VTK_EXPORT
"${CMAKE_CURRENT_BINARY_DIR}" "")
# load the ClientServer command
INCLUDE(${ParaView_SOURCE_DIR}/Utilities/VTKClientServer/vtkClientServer.cmake)
CS_INITIALIZE_WRAP()
INCLUDE_DIRECTORIES(${VTKCLIENTSERVER_INCLUDE_DIR})
# Wrap PVServer
# Create ClientServer wrappers for ParaView classes.
SET(_VTK_BINARY_DIR "${VTK_BINARY_DIR}")
SET(VTK_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}")
INCLUDE(${VTK_CMAKE_DIR}/vtkExportKit.cmake)
VTK_EXPORT_KIT("${KIT}" "${KIT_UPCASE}" "${Kit_SRCS}")
SET(VTK_BINARY_DIR "${_VTK_BINARY_DIR}")
# Wrap PVServerCommon
SET(KIT_WRAP_DEPS PVClientServerCore)
SET(VTK_KITS_DIR "${CMAKE_CURRENT_BINARY_DIR}/Utilities")
PV_WRAP_VTK_CS("${KIT}" "${KIT_UPCASE}" "${KIT_WRAP_DEPS}")
# Wrap for python
IF (PARAVIEW_ENABLE_PYTHON)
SET(Kit_PYTHON_EXTRA_SRCS)
SET(KIT_PYTHON_LIBS
vtkPVClientServerCorePythonD
)
# Tell vtkWrapPython.cmake to set VTK_PYTHON_LIBRARIES for us.
SET(VTK_WRAP_PYTHON_FIND_LIBS 1)
SET(VTK_WRAP_INCLUDE_DIRS ${VTK_INCLUDE_DIR})
INCLUDE("${VTK_CMAKE_DIR}/vtkWrapPython.cmake")
INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
SET(KIT_PYTHON_DEPS)
SET(VTK_INSTALL_LIB_DIR "${VTKPythonWrapping_INSTALL_LIB_DIR}")
SET(VTK_INSTALL_BIN_DIR "${VTKPythonWrapping_INSTALL_BIN_DIR}")
SET(VTK_INSTALL_LIB_DIR_CM24 "${VTKPythonWrapping_INSTALL_LIB_DIR}")
SET(VTK_INSTALL_BIN_DIR_CM24 "${VTKPythonWrapping_INSTALL_BIN_DIR}")
# include python wrapping from VTK
INCLUDE(KitCommonPythonWrapBlock)
ENDIF (PARAVIEW_ENABLE_PYTHON)
# Create the library.
VTK_ADD_LIBRARY(vtk${KIT}
${Kit_SRCS}
${KitInstantiator_SRCS}
)
TARGET_LINK_LIBRARIES(vtk${KIT}
vtkPVClientServerCore
vtkPVClientServerCoreCS
${KIT_LIBS}
protobuf
)
add_dependencies(vtk${KIT} protobuf_code_generation)
IF(NOT PV_INSTALL_NO_LIBRARIES)
SET(temp_TO_INSTALL
vtk${KIT})
INSTALL(TARGETS ${temp_TO_INSTALL}
EXPORT ${PV_INSTALL_EXPORT_NAME}
RUNTIME DESTINATION ${PV_INSTALL_BIN_DIR} COMPONENT Runtime
LIBRARY DESTINATION ${PV_INSTALL_LIB_DIR} COMPONENT Runtime
ARCHIVE DESTINATION ${PV_INSTALL_LIB_DIR} COMPONENT Development)
ENDIF(NOT PV_INSTALL_NO_LIBRARIES)
# Resource files
IF(NOT PV_INSTALL_NO_RUNTIME)
INSTALL(
FILES ${resourceFiles}
DESTINATION ${PV_INSTALL_LIB_DIR}/ParaViewCore/ServerImplementation/Resources)
ENDIF(NOT PV_INSTALL_NO_RUNTIME)
# Development files install
IF (NOT PV_INSTALL_NO_DEVELOPMENT)
GLOB_INSTALL_DEVELOPMENT(
${CMAKE_CURRENT_SOURCE_DIR}
${PV_INSTALL_INCLUDE_DIR}
"*.h;*.hxx;*.txx")
INSTALL(
FILES ${dynamicHeaders}
DESTINATION ${PV_INSTALL_INCLUDE_DIR}
COMPONENT Development)
ENDIF (NOT PV_INSTALL_NO_DEVELOPMENT)
IF (BUILD_TESTING)
SUBDIRS(Testing)
ENDIF (BUILD_TESTING)
-------------- next part --------------
cmake_minimum_required(VERSION 2.6)
project(protobuf)
set (PROTOBUF_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set (PROTOBUF_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
IF (NOT PROTOBUF_INSTALL_BIN_DIR)
SET (PROTOBUF_INSTALL_BIN_DIR bin)
ENDIF()
IF (NOT PROTOBUF_INSTALL_LIB_DIR)
SET (PROTOBUF_INSTALL_LIB_DIR lib)
ENDIF()
IF (NOT PROTOBUF_INSTALL_EXPORT_NAME)
SET (PROTOBUF_INSTALL_EXPORT_NAME ProtobufTargets)
ENDIF()
if (NOT WIN32)
OPTION(BUILD_SHARED_LIBS "Build shared protobuf library" ON)
endif()
#disable compiler warnings from the protobuf library
option(PROTOBUF_DISABLE_COMPILER_WARNINGS "Disable compiler warnings" ON)
mark_as_advanced(PROTOBUF_DISABLE_COMPILER_WARNINGS)
if(PROTOBUF_DISABLE_COMPILER_WARNINGS)
if(WIN32)
if (MSVC)
string(REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " "
CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} /w")
string(REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " "
CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /w")
endif(MSVC)
else(WIN32)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w")
set (CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -w")
endif(WIN32)
endif(PROTOBUF_DISABLE_COMPILER_WARNINGS)
# PROTOBUF_USE_DLLS is added on per target basis (see src/CMakeLists.txt). If we
# add this globally, then we get errors when building the static executable
# "protoc".
#if (WIN32 AND BUILD_SHARED_LIBS)
# add_definitions(-DPROTOBUF_USE_DLLS)
#endif (WIN32 AND BUILD_SHARED_LIBS)
# Direct all binary outputs to one directory
if(NOT LIBRARY_OUTPUT_PATH)
set(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/bin CACHE INTERNAL "")
endif(NOT LIBRARY_OUTPUT_PATH)
if(NOT EXECUTABLE_OUTPUT_PATH)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/bin CACHE INTERNAL "")
endif(NOT EXECUTABLE_OUTPUT_PATH)
# Set up protobuf include directories, and the export file
set(PROTOBUF_INCLUDE_DIRS
"${PROTOBUF_SOURCE_DIR}/src"
"${PROTOBUF_BINARY_DIR}/src")
include_directories(${protobuf_INCLUDE_DIRS})
set(PROTOBUF_EXPORTS_FILE "${PROTOBUF_BINARY_DIR}/PROTOBUF_EXPORTS.cmake")
file(REMOVE "${PROTOBUF_EXPORTS_FILE}")
option(protobuf_ENABLE_TESTING "Enable and build protobuf tests" OFF)
INCLUDE (CheckFunctionExists)
INCLUDE (CheckIncludeFile)
INCLUDE (CheckIncludeFileCXX)
INCLUDE (CheckIncludeFiles)
INCLUDE (CheckLibraryExists)
INCLUDE (CheckSymbolExists)
INCLUDE (CheckTypeSize)
find_package(Threads)
set(THREAD_LINK_LIB "")
if (Threads_FOUND)
set(HAVE_PTHREAD 1)
set(THREAD_LINK_LIB ${CMAKE_THREAD_LIBS_INIT})
endif ()
# Enable classes using zlib compression
find_package(ZLIB)
set(ZLIB_LINK_LIB "")
if (ZLIB_FOUND)
set(HAVE_ZLIB 1)
set(ZLIB_LINK_LIB ${ZLIB_LIBRARIES})
endif (ZLIB_FOUND)
if(protobuf_ENABLE_TESTING)
enable_testing()
# A test framework used internally by protobuf
# protobuf test cases use this
add_subdirectory(gtest)
endif()
# Source code for protobuf and its test cases
add_subdirectory(src)
# Create the configure file for protobuf
configure_file("${PROTOBUF_SOURCE_DIR}/protobufConfig.cmake.in"
"${PROTOBUF_BINARY_DIR}/protobufConfig.cmake" @ONLY)
-------------- next part --------------
set(PACKAGE "protobuf")
set(VERSION "2.3.0")
set(PACKAGE_BUGREPORT "protobuf at googlegroups.com")
set(PACKAGE_NAME "Protocal Buffers")
set(PACKAGE_TARNAME "protobuf")
set(PACKAGE_VERSION "2.3.0")
set(PACKAGE_STRING "Protocal Buffers 2.3.0")
#------------------------------------------------------------------------------
# Setup RPATH settings to ensure that the protoc exetuble can be run correctly
# in various build environments (linux/mac).
#------------------------------------------------------------------------------
# use, i.e. don't skip the full RPATH for the build tree
SET(CMAKE_SKIP_BUILD_RPATH FALSE)
# when building, don't use the install RPATH already
# (but later on when installing)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
# add the automatically determined parts of the RPATH
# which point to directories outside the build tree to the install RPATH
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
#--------------------------------------------------------------------------
CHECK_INCLUDE_FILE("dlfcn.h" HAVE_DLFCN_H)
CHECK_INCLUDE_FILE("inttypes.h" HAVE_INTTYPES_H)
CHECK_INCLUDE_FILE("memory.h" HAVE_MEMORY_H)
CHECK_INCLUDE_FILE("stdint.h" HAVE_STDINT_H)
CHECK_INCLUDE_FILE("stdlib.h" HAVE_STDLIB_H)
CHECK_INCLUDE_FILE("strings.h" HAVE_STRINGS_H)
CHECK_INCLUDE_FILE("string.h" HAVE_STRING_H)
CHECK_INCLUDE_FILE("sys/stat.h" HAVE_SYS_STAT_H)
CHECK_INCLUDE_FILE("sys/types.h" HAVE_SYS_TYPES_H)
CHECK_INCLUDE_FILE("unistd.h" HAVE_UNISTD_H)
# Enumerate all known and possible combinations of
# hash_map/hash_set header files location
# hash_map/hash_set namespace name and
# hash_map/hash_set class name
# Break on first successful compile and record names
set(NAMESPACE "")
set(LOCATION_MAP "")
set(CLASSNAME_MAP "")
set(LOCATION_SET "")
set(CLASSNAME_SET "")
foreach(NAMESPACE_I std std::tr1 stdext __gnu_cxx "")
# Try hash_map
foreach(LOCATION_MAP_I hash_map tr1/unordered_map ext/hash_map)
foreach(CLASSNAME_MAP_I unordered_map hash_map)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CMake/hash_map_test.cc.in
${CMAKE_CURRENT_BINARY_DIR}/CMake/hash_map_test.cc
@ONLY)
try_compile(SUCCEED_MAP
${CMAKE_CURRENT_BINARY_DIR}/CMake
${CMAKE_CURRENT_BINARY_DIR}/CMake/hash_map_test.cc)
if (SUCCEED_MAP)
set(CLASSNAME_MAP "${CLASSNAME_MAP_I}")
break()
endif()
endforeach(CLASSNAME_MAP_I)
if (SUCCEED_MAP)
set(LOCATION_MAP "${LOCATION_MAP_I}")
break()
endif()
endforeach(LOCATION_MAP_I)
# Try hash_set
foreach(LOCATION_SET_I hash_set tr1/unordered_set ext/hash_set)
foreach(CLASSNAME_SET_I unordered_set hash_set)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CMake/hash_set_test.cc.in
${CMAKE_CURRENT_BINARY_DIR}/CMake/hash_set_test.cc
@ONLY)
try_compile(SUCCEED_SET
${CMAKE_CURRENT_BINARY_DIR}/CMake
${CMAKE_CURRENT_BINARY_DIR}/CMake/hash_set_test.cc)
if (SUCCEED_SET)
set(CLASSNAME_SET "${CLASSNAME_SET_I}")
break()
endif()
endforeach(CLASSNAME_SET_I)
if (SUCCEED_SET)
set(LOCATION_SET "${LOCATION_SET_I}")
break()
endif()
endforeach(LOCATION_SET_I)
# See if we found a successful compile for both hash_map and hash_set
if (SUCCEED_MAP AND SUCCEED_SET)
# Namespace of hash_map/hash_set
set(HASH_NAMESPACE "${NAMESPACE_I}")
# Define if the compiler has hash_map
set(HAVE_HASH_MAP 1)
# Location of <hash_map> file
set(HASH_MAP_H "${LOCATION_MAP}")
# Class name of the <hash_map>
set(HASH_MAP_CLASS "${CLASSNAME_MAP}")
# Define if the compiler has hash_set
set(HAVE_HASH_SET 1)
# Location of <hash_set> file
set(HASH_SET_H "${LOCATION_SET}")
# Class name of <hash_set>
set(HASH_SET_CLASS "${CLASSNAME_SET}")
break()
endif ()
endforeach(NAMESPACE_I)
# Define to the sub-directory in which libtool stores uninstalled libraries
# LT_OBJDIR
# Define to necessary symbol if this constant
# uses a non-standard name on your system
set(ATTR_NAME "UNKNOWN")
foreach(PTHREAD_TEST PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CMake/pthread_test.cc.in
${CMAKE_CURRENT_BINARY_DIR}/CMake/pthread_test.cc
@ONLY)
try_compile(SUCCEED
${CMAKE_CURRENT_BINARY_DIR}/CMake
${CMAKE_CURRENT_BINARY_DIR}/CMake/pthread_test.cc)
if (SUCCEED)
set(ATTR_NAME "${PTHREAD_TEST}")
break()
endif ()
endforeach(PTHREAD_TEST)
if ("${ATTR_NAME}" STREQUAL "${PTHREAD_CREATE_JOINABLE}")
set(PTHREAD_CREATE_JOINABLE "${ATTR_NAME}")
endif ()
# Define to 1 if you have the ANSI C header files
CHECK_INCLUDE_FILE("stddef.h" HAVE_STDDEF_H)
if (HAVE_STDLIB_H AND HAVE_STDDEF_H)
set(STDC_HEADERS 1)
endif ()
# Config config.h.cmake.in
if (CMAKE_CROSSCOMPILING)
#Don't refuse to compile the runtime just because threads are missing
set(HAVE_PTHREAD 1)
endif (CMAKE_CROSSCOMPILING)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/config.h)
# Include directories for this project
if (ZLIB_FOUND)
include_directories(${ZLIB_INCLUDE_DIRS})
endif ()
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/..)
# Targets ==============================================================
# protobuf library
set(LIBPROTOBUF_SOURCES
google/protobuf/stubs/common.cc
google/protobuf/stubs/once.cc
google/protobuf/stubs/hash.cc
google/protobuf/extension_set.cc
google/protobuf/generated_message_util.cc
google/protobuf/message_lite.cc
google/protobuf/repeated_field.cc
google/protobuf/wire_format_lite.cc
google/protobuf/io/coded_stream.cc
google/protobuf/io/zero_copy_stream.cc
google/protobuf/io/zero_copy_stream_impl_lite.cc
google/protobuf/stubs/strutil.cc
google/protobuf/stubs/substitute.cc
google/protobuf/stubs/structurally_valid.cc
google/protobuf/descriptor.cc
google/protobuf/descriptor.pb.cc
google/protobuf/descriptor_database.cc
google/protobuf/dynamic_message.cc
google/protobuf/extension_set_heavy.cc
google/protobuf/generated_message_reflection.cc
google/protobuf/message.cc
google/protobuf/reflection_ops.cc
google/protobuf/service.cc
google/protobuf/text_format.cc
google/protobuf/unknown_field_set.cc
google/protobuf/wire_format.cc
google/protobuf/io/printer.cc
google/protobuf/io/tokenizer.cc
google/protobuf/io/zero_copy_stream_impl.cc
google/protobuf/compiler/importer.cc
google/protobuf/compiler/parser.cc)
if (ZLIB_FOUND)
# Keeping the ZLIB dependent source file separate makes it possible to build
# protoc executable without any zlib dependecies. Any extra depedencies on
# protoc executable make it complicated to use the executable during build
# steps for projects such as ParaView since they require the environment to
# be set up correctly hence we avoid as such dependencies on protoc at all
# costs!!!
set (LIBPROTOBUF_SOURCES_EXTRA
google/protobuf/io/gzip_stream.cc)
endif()
add_library(protobuf ${LIBPROTOBUF_SOURCES} ${LIBPROTOBUF_SOURCES_EXTRA})
if (WIN32 AND BUILD_SHARED_LIBS)
set_target_properties(protobuf PROPERTIES
COMPILE_DEFINITIONS "LIBPROTOBUF_EXPORTS;PROTOBUF_USE_DLLS")
endif (WIN32 AND BUILD_SHARED_LIBS)
target_link_libraries(protobuf ${THREAD_LINK_LIB} ${ZLIB_LINK_LIB})
# protobuf-lite library
set(PROTOBUF_LITE_SOURCES
google/protobuf/stubs/common.cc
google/protobuf/stubs/once.cc
google/protobuf/stubs/hash.cc
google/protobuf/extension_set.cc
google/protobuf/generated_message_util.cc
google/protobuf/message_lite.cc
google/protobuf/repeated_field.cc
google/protobuf/wire_format_lite.cc
google/protobuf/io/coded_stream.cc
google/protobuf/io/zero_copy_stream.cc
google/protobuf/io/zero_copy_stream_impl_lite.cc)
add_library(protobuf-lite ${PROTOBUF_LITE_SOURCES})
if (WIN32 AND BUILD_SHARED_LIBS)
set_target_properties(protobuf-lite PROPERTIES
COMPILE_DEFINITIONS "LIBPROTOBUF_EXPORTS;PROTOBUF_USE_DLLS")
endif (WIN32 AND BUILD_SHARED_LIBS)
target_link_libraries(protobuf-lite ${THREAD_LINK_LIB})
# protoc library
set(LIBPROTOC_SOURCES
google/protobuf/compiler/code_generator.cc
google/protobuf/compiler/command_line_interface.cc
google/protobuf/compiler/plugin.cc
google/protobuf/compiler/plugin.pb.cc
google/protobuf/compiler/subprocess.cc
google/protobuf/compiler/zip_writer.cc
google/protobuf/compiler/cpp/cpp_enum.cc
google/protobuf/compiler/cpp/cpp_enum_field.cc
google/protobuf/compiler/cpp/cpp_extension.cc
google/protobuf/compiler/cpp/cpp_field.cc
google/protobuf/compiler/cpp/cpp_file.cc
google/protobuf/compiler/cpp/cpp_generator.cc
google/protobuf/compiler/cpp/cpp_helpers.cc
google/protobuf/compiler/cpp/cpp_message.cc
google/protobuf/compiler/cpp/cpp_message_field.cc
google/protobuf/compiler/cpp/cpp_primitive_field.cc
google/protobuf/compiler/cpp/cpp_service.cc
google/protobuf/compiler/cpp/cpp_string_field.cc
google/protobuf/compiler/java/java_enum.cc
google/protobuf/compiler/java/java_enum_field.cc
google/protobuf/compiler/java/java_extension.cc
google/protobuf/compiler/java/java_field.cc
google/protobuf/compiler/java/java_file.cc
google/protobuf/compiler/java/java_generator.cc
google/protobuf/compiler/java/java_helpers.cc
google/protobuf/compiler/java/java_message.cc
google/protobuf/compiler/java/java_message_field.cc
google/protobuf/compiler/java/java_primitive_field.cc
google/protobuf/compiler/java/java_service.cc
google/protobuf/compiler/python/python_generator.cc)
link_directories(${LIBRARY_OUTPUT_PATH})
# protoc executable no longer depends on the protoc library. But other projects
# might depend on it so we leave it untouched.
add_library(protoc ${LIBPROTOC_SOURCES})
if (WIN32 AND BUILD_SHARED_LIBS)
set_target_properties(protoc PROPERTIES
COMPILE_DEFINITIONS "LIBPROTOC_EXPORTS;PROTOBUF_USE_DLLS")
endif (WIN32 AND BUILD_SHARED_LIBS)
target_link_libraries(protoc ${THREAD_LINK_LIB} protobuf)
# protoc executable
link_directories(${LIBRARY_OUTPUT_PATH})
IF(NOT CMAKE_CROSSCOMPILING)
# We build the protoc executable without any dependencies on libraries built
# here viz. protobuf/protoc. This avoids unnecessary build-time
# complications when using protoc to generate headers in projects.
add_executable(protoc_compiler
google/protobuf/compiler/main.cc
${LIBPROTOC_SOURCES}
${LIBPROTOBUF_SOURCES})
set_target_properties(protoc_compiler PROPERTIES
OUTPUT_NAME protoc)
target_link_libraries(protoc_compiler
${THREAD_LINK_LIB})
get_target_property(protoc_compiler_location protoc_compiler LOCATION)
if (EXPORT_EXECUTABLES_FILE)
EXPORT(TARGETS protoc_compiler
FILE ${EXPORT_EXECUTABLES_FILE}
NAMESPACE "${EXPORT_EXECUTABLES_NAMESPACE}"
APPEND)
endif (EXPORT_EXECUTABLES_FILE)
ENDIF(NOT CMAKE_CROSSCOMPILING)
if(protobuf_ENABLE_TESTING)
# Generate test sources
set(PROTOC_INPUTS
google/protobuf/unittest
google/protobuf/unittest_empty
google/protobuf/unittest_import
google/protobuf/unittest_mset
google/protobuf/unittest_optimize_for
google/protobuf/unittest_embed_optimize_for
google/protobuf/unittest_custom_options
google/protobuf/unittest_lite
google/protobuf/unittest_import_lite
google/protobuf/unittest_lite_imports_nonlite
google/protobuf/unittest_no_generic_services
google/protobuf/compiler/cpp/cpp_test_bad_identifiers)
foreach(PROTOBUF_SAMPLE_INPUT ${PROTOC_INPUTS})
add_custom_command(OUTPUT ${PROTOBUF_SAMPLE_INPUT}.pb.cc
${PROTOBUF_SAMPLE_INPUT}.pb.h
COMMAND ${protoc_compiler_location}
ARGS ${CMAKE_CURRENT_SOURCE_DIR}/${PROTOBUF_SAMPLE_INPUT}.proto
--proto_path="${CMAKE_CURRENT_SOURCE_DIR}"
--cpp_out="${CMAKE_BINARY_DIR}/src"
DEPENDS protoc_compiler ${PROTOBUF_SAMPLE_INPUT}.proto)
# I am not quite sure why, buy I have to have this command below to
# make sure it works for Visual Studio
if (WIN32)
add_custom_command(TARGET protoc_compiler
COMMAND ${protoc_compiler_location}
ARGS ${CMAKE_CURRENT_SOURCE_DIR}/${PROTOBUF_SAMPLE_INPUT}.proto
--proto_path="${CMAKE_CURRENT_SOURCE_DIR}"
--cpp_out="${CMAKE_BINARY_DIR}/src")
endif(WIN32)
endforeach()
# Tests ==============================================================
set(PROTOC_LITE_OUTPUTS
google/protobuf/unittest_lite.pb.cc
google/protobuf/unittest_import_lite.pb.cc)
set(PROTOC_OUTPUTS ${PROTOC_LITE_OUTPUTS}
google/protobuf/unittest.pb.cc
google/protobuf/unittest_empty.pb.cc
google/protobuf/unittest_import.pb.cc
google/protobuf/unittest_mset.pb.cc
google/protobuf/unittest_optimize_for.pb.cc
google/protobuf/unittest_embed_optimize_for.pb.cc
google/protobuf/unittest_custom_options.pb.cc
google/protobuf/unittest_lite_imports_nonlite.pb.cc
google/protobuf/unittest_no_generic_services.pb.cc
google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.cc)
set(COMMON_TEST_SOURCES
google/protobuf/test_util.cc
google/protobuf/testing/googletest.cc
google/protobuf/testing/file.cc)
set(PROTOBUF_TEST_SOURCES
google/protobuf/stubs/common_unittest.cc
google/protobuf/stubs/once_unittest.cc
google/protobuf/stubs/strutil_unittest.cc
google/protobuf/stubs/structurally_valid_unittest.cc
google/protobuf/descriptor_database_unittest.cc
google/protobuf/descriptor_unittest.cc
google/protobuf/dynamic_message_unittest.cc
google/protobuf/extension_set_unittest.cc
google/protobuf/generated_message_reflection_unittest.cc
google/protobuf/message_unittest.cc
google/protobuf/reflection_ops_unittest.cc
google/protobuf/repeated_field_unittest.cc
google/protobuf/text_format_unittest.cc
google/protobuf/unknown_field_set_unittest.cc
google/protobuf/wire_format_unittest.cc
google/protobuf/io/coded_stream_unittest.cc
google/protobuf/io/printer_unittest.cc
google/protobuf/io/tokenizer_unittest.cc
google/protobuf/io/zero_copy_stream_unittest.cc
google/protobuf/compiler/command_line_interface_unittest.cc
google/protobuf/compiler/importer_unittest.cc
google/protobuf/compiler/mock_code_generator.cc
google/protobuf/compiler/parser_unittest.cc
google/protobuf/compiler/cpp/cpp_bootstrap_unittest.cc
google/protobuf/compiler/cpp/cpp_unittest.cc
google/protobuf/compiler/cpp/cpp_plugin_unittest.cc
google/protobuf/compiler/java/java_plugin_unittest.cc
google/protobuf/compiler/python/python_plugin_unittest.cc)
include_directories(${CMAKE_SOURCE_DIR}/gtest/include ${CMAKE_BINARY_DIR}/src)
# protobuf-test
add_executable(protobuf_test
${PROTOBUF_TEST_SOURCES}
${COMMON_TEST_SOURCES}
${PROTOC_OUTPUTS})
target_link_libraries(protobuf_test ${THREAD_LINK_LIB}
protobuf
gtest
gtest_main
${ZLIB_LINK_LIB})
add_test(protobuf_test ${EXECUTABLE_OUTPUT_PATH}/protobuf_test)
# protobuf-lazy-descriptor-test
add_executable(protobuf_lazy_descriptor_test
google/protobuf/compiler/cpp/cpp_unittest.cc
${COMMON_TEST_SOURCES}
${PROTOC_OUTPUTS})
set_target_properties(protobuf_lazy_descriptor_test PROPERTIES
COMPILE_DEFINITIONS "PROTOBUF_TEST_NO_DESCRIPTORS")
target_link_libraries(protobuf_lazy_descriptor_test
${THREAD_LINK_LIB}
protobuf
gtest
gtest_main
${ZLIB_LINK_LIB})
add_test(protobuf_lazy_descriptor_test ${EXECUTABLE_OUTPUT_PATH}/protobuf_lazy_descriptor_test)
# lite-unittest
add_executable(lite_unittest
google/protobuf/lite_unittest.cc
google/protobuf/test_util_lite.cc
${PROTOC_LITE_OUTPUTS})
target_link_libraries(lite_unittest
${THREAD_LINK_LIB}
protobuf-lite
${ZLIB_LINK_LIB})
add_test(lite_unittest ${EXECUTABLE_OUTPUT_PATH}/lite_unittest)
# plugins
add_executable(test_plugin
google/protobuf/compiler/mock_code_generator.cc
google/protobuf/testing/file.cc
google/protobuf/compiler/test_plugin.cc)
# ${PROTOC_LITE_OUTPUTS})
set_target_properties(test_plugin PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/src"
RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/src"
RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/src")
target_link_libraries(test_plugin
${THREAD_LINK_LIB}
protobuf
gtest
${ZLIB_LINK_LIB})
# test_plugin by itself is not a valid test program,
# it is used with/called by protobuf_test which is the main
# test program to test plugin facility.
# add_test(test_plugin ${EXECUTABLE_OUTPUT_PATH}/test_plugin)
# zlib
if (ZLIB_FOUND)
set(ZCGZIP_SOURCES google/protobuf/testing/zcgzip.cc)
add_executable(zcgzip ${ZCGZIP_SOURCES})
target_link_libraries(zcgzip ${THREAD_LINK_LIB} protobuf ${ZLIB_LINK_LIB})
set(ZCGUNZIP_SOURCES google/protobuf/testing/zcgunzip.cc)
add_executable(zcgunzip ${ZCGUNZIP_SOURCES})
target_link_libraries(zcgunzip ${THREAD_LINK_LIB} protobuf ${ZLIB_LINK_LIB})
# I went through the original Makefile.am file and cannot find any useage
# of these files. Actually, when I removed these files from the test directory
# all the tests still run pretty well which leads me to assume that they are
# not used.
# I also read the source code for zcgzip which seems to me only
# read from STDIN and outpu to STDOUT. This suggests that you cannot do
# automatical tests with those configurations. Of course, redirection should
# be able to make zcgzip work with files. However, I do not see any
# redirection operation from the make ckeck command line.
# add_test(zcgzip ${EXECUTABLE_OUTPUT_PATH}/zcgzip)
# add_test(zcgunzip ${EXECUTABLE_OUTPUT_PATH}/zcgunzip)
endif ()
# Copy these dest files to position - the test requires them
foreach(EXTRA_DIST_I
${PROTOC_INPUTS}
google/protobuf/descriptor
google/protobuf/compiler/plugin)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${EXTRA_DIST_I}.proto
${CMAKE_BINARY_DIR}/src/${EXTRA_DIST_I}.proto
COPYONLY)
endforeach(EXTRA_DIST_I)
foreach(EXTRA_DIST_I
google/protobuf/descriptor.pb.h
google/protobuf/descriptor.pb.cc
google/protobuf/compiler/plugin.pb.h
google/protobuf/compiler/plugin.pb.cc
solaris/libstdc++.la
google/protobuf/io/gzip_stream.h
google/protobuf/io/gzip_stream_unittest.sh
google/protobuf/testdata/golden_message
google/protobuf/testdata/golden_packed_fields_message
google/protobuf/testdata/text_format_unittest_data.txt
google/protobuf/testdata/text_format_unittest_extensions_data.txt
google/protobuf/package_info.h
google/protobuf/io/package_info.h
google/protobuf/compiler/package_info.h
google/protobuf/compiler/zip_output_unittest.sh
google/protobuf/unittest_enormous_descriptor.proto)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${EXTRA_DIST_I}
${CMAKE_BINARY_DIR}/src/${EXTRA_DIST_I}
COPYONLY)
endforeach(EXTRA_DIST_I)
endif() # End of tests (only compiled when requested now.
IF(NOT CMAKE_CROSSCOMPILING)
export(TARGETS protobuf protobuf-lite protoc protoc_compiler FILE "${PROTOBUF_EXPORTS_FILE}")
ELSE(NOT CMAKE_CROSSCOMPILING)
export(TARGETS protobuf protobuf-lite protoc FILE "${PROTOBUF_EXPORTS_FILE}")
ENDIF(NOT CMAKE_CROSSCOMPILING)
install (TARGETS protobuf protobuf-lite
EXPORT ${PROTOBUF_INSTALL_EXPORT_NAME}
RUNTIME DESTINATION ${PROTOBUF_INSTALL_BIN_DIR} COMPONENT Runtime
LIBRARY DESTINATION ${PROTOBUF_INSTALL_LIB_DIR} COMPONENT Runtime
ARCHIVE DESTINATION ${PROTOBUF_INSTALL_LIB_DIR} COMPONENT Development)
IF(COMPILE_TOOLS_TARGET)
ADD_DEPENDENCIES(${COMPILE_TOOLS_TARGET} protoc_compiler)
ENDIF(COMPILE_TOOLS_TARGET)
More information about the ParaView
mailing list