1 # Set the project/library name here. Classes should be declared as
2 # "class VTK_FoamReader_EXPORT vtkFoo", where PVFoamReader is the name of the
6 # Set your list of sources here. Do not change the name of the
7 # PVFoamReader_SRCS variable.
13 # List the kits from VTK that are needed by this project. Do not
14 # change the name of the PVFoamReader_LIBS variable.
19 INCLUDE_DIRECTORIES($ENV{FOAM_SRC}/OpenFOAM/lnInclude $ENV{FOAM_SRC}/finiteVolume/lnInclude)
20 INCLUDE_DIRECTORIES($ENV{ParaView_INST_DIR}/include ../vtkFoam/lnInclude)
21 ADD_DEFINITIONS(-D$ENV{WM_PRECISION_OPTION})
23 #-----------------------------------------------------------------------------
24 # Most users should not need to change anything below this line.
26 # Need to include class headers and the configuration header.
27 INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR})
28 INCLUDE_DIRECTORIES(${PROJECT_BINARY_DIR})
30 # Import ParaView build settings.
31 FIND_PACKAGE(ParaView)
32 IF(NOT ParaView_FOUND)
33 MESSAGE(FATAL_ERROR "ParaView is required. Set ParaView_DIR.")
34 ENDIF(NOT ParaView_FOUND)
35 IF(NOT PARAVIEW_BUILD_SHARED_LIBS)
36 MESSAGE(FATAL_ERROR "ParaView must be built with BUILD_SHARED_LIBS ON.")
37 ENDIF(NOT PARAVIEW_BUILD_SHARED_LIBS)
38 INCLUDE(${PARAVIEW_USE_FILE})
40 # Configure output directories.
41 SET (LIBRARY_OUTPUT_PATH $ENV{FOAM_LIBBIN} CACHE INTERNAL
42 "Single output directory for building all libraries.")
43 SET (EXECUTABLE_OUTPUT_PATH $ENV{FOAM_APPBIN} CACHE INTERNAL
44 "Single output directory for building all executables.")
46 # Create the configuration header.
47 CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/PVFoamReaderConfigure.h.in
48 ${PROJECT_BINARY_DIR}/vtk${PROJECT_NAME}Configure.h
51 # Must be defined before ADD_LIBRARY for cmake version 2.3.4-20060317
52 LINK_DIRECTORIES($ENV{FOAM_LIBBIN})
53 LINK_DIRECTORIES($ENV{FOAM_USER_LIBBIN})
55 # Create vtk client/server wrappers for the classes.
56 VTK_WRAP_ClientServer(${PROJECT_NAME} PVFoamReaderCS_SRCS "${PVFoamReader_SRCS}")
58 # Build the package as a plugin for ParaView.
59 ADD_LIBRARY(${PROJECT_NAME} MODULE ${PVFoamReader_SRCS} ${PVFoamReaderCS_SRCS})
60 LINK_DIRECTORIES($ENV{ParaView_INST_DIR}/lib)
61 TARGET_LINK_LIBRARIES(${PROJECT_NAME} vtkClientServer)
62 FOREACH(c ${PVFoamReader_LIBS})
63 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${c}CS)
66 # Place the package configuration file into the build tree.
67 CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/PVFoamReader.xml.in
68 ${PROJECT_BINARY_DIR}/../${PROJECT_NAME}.xml @ONLY IMMEDIATE)
70 # Place the package configuration file into the build tree.
71 CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/PVFoamReader.pvsm.in
72 ${PROJECT_BINARY_DIR}/../${PROJECT_NAME}.pvsm @ONLY IMMEDIATE)
74 TARGET_LINK_LIBRARIES(${PROJECT_NAME} OpenFOAM finiteVolume vtkFoam)