CMakeLists-Catalyst.txt 2.54 KB
Newer Older
1
#------------------------------------------------------------------------------
2
project(catalyst)
3

4 5
include(${PARAVIEW_USE_FILE})

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

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

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)

52

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

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

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

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

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

86 87 88 89 90 91 92

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

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

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

105 106
install(TARGETS catalystFoam DESTINATION lib)

107
#-----------------------------------------------------------------------------