CMakeLists-Catalyst.txt 2.52 KB
Newer Older
1 2
#------------------------------------------------------------------------------

3 4
include(${PARAVIEW_USE_FILE})

5 6
# ----------------------------------------------------------------------
# Test some characteristics
7 8
set(test_file ${CMAKE_CURRENT_BINARY_DIR}/check_initialize.cxx)
file(WRITE ${test_file}
9 10 11 12 13 14 15 16
    "#include <vtkCPProcessor.h>\n"
    "int main() {\n"
    "  vtkCPProcessor* p = vtkCPProcessor::New();\n"
    "  p->Initialize(\"AAA\");\n"
    "  p->Delete();\n"
    "  return 0;\n"
    "}"
)
17
try_compile(CATALYST_HAS_WORKING_DIRECTORY
18
    ${CMAKE_CURRENT_BINARY_DIR} ${test_file}
19
    LINK_LIBRARIES vtkPVPythonCatalyst
20 21
    CMAKE_FLAGS "-DINCLUDE_DIRECTORIES=${PARAVIEW_INCLUDE_DIRS}"
)
22
if (CATALYST_HAS_WORKING_DIRECTORY)
23
    add_definitions(-DUSE_CATALYST_WORKING_DIRECTORY)
24 25
else()
    message(WARNING "==== CAUTION: ParaView Catalyst without chdir capability ====")
26 27
endif()

28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
# ----------------------------------------------------------------------

include_directories(
    ${LIB_SRC}/OpenFOAM/lnInclude
    ${LIB_SRC}/OSspecific/${WM_OSTYPE}/lnInclude
    ${LIB_SRC}/finiteArea/lnInclude
    ${LIB_SRC}/finiteVolume/lnInclude
    ${LIB_SRC}/fileFormats/lnInclude
    ${LIB_SRC}/conversion/lnInclude
    ${LIB_SRC}/meshTools/lnInclude
    ${LIB_SRC}/lagrangian/basic/lnInclude
    ${LIB_SRC}/overset/lnInclude
    ${CMAKE_CURRENT_SOURCE_DIR}
    ${CMAKE_CURRENT_BINARY_DIR}
)

link_directories(
    $ENV{FOAM_LIBBIN}
    $ENV{FOAM_LIBBIN}/dummy
)

set(CMAKE_BUILD_TYPE Release)

51

52 53
file(GLOB SOURCE_FILES
    catalystCoprocess.C
54 55 56
    catalystTools.C
    catalystInput.C
    catalystFunctionObject.C
57

58 59
    cloud/catalystCloud.C
    cloud/foamVtkCloudAdaptor.C
60

61 62 63 64
    areaMesh/catalystFaMesh.C
    areaMesh/foamVtkFaMeshAdaptor.C
    areaMesh/foamVtkFaMeshAdaptorGeom.C
    areaMesh/foamVtkFaMeshAdaptorFields.C
65

66 67 68 69 70
    volMesh/catalystFvMesh.C
    volMesh/foamVtkFvMeshAdaptor.C
    volMesh/foamVtkFvMeshAdaptorGeom.C
    volMesh/foamVtkFvMeshAdaptorGeomVtu.C
    volMesh/foamVtkFvMeshAdaptorFields.C
71 72 73 74
)

set(OPENFOAM_LIBRARIES
    OpenFOAM
75
    Pstream
76 77 78 79
    finiteArea
    finiteVolume
    fileFormats
    meshTools
80
    conversion
81
    lagrangian
82
    overset
83 84
)

85 86 87 88 89 90 91

if (PARAVIEW_USE_MPI)
    set(LINK_LIBRARIES vtkPVPythonCatalyst vtkParallelMPI)
else()
    set(LINK_LIBRARIES vtkPVPythonCatalyst)
endif()

92 93 94 95 96 97 98 99
add_library(
    catalystFoam
    SHARED
    ${SOURCE_FILES}
)

target_link_libraries(
    catalystFoam
100
    ${LINK_LIBRARIES}
101 102 103
    ${OPENFOAM_LIBRARIES}
)

104 105
install(TARGETS catalystFoam DESTINATION lib)

106
#-----------------------------------------------------------------------------