CMakeLists-Common.txt 2.87 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11
include(${PARAVIEW_USE_FILE})

include_directories(
    $ENV{WM_PROJECT_DIR}/src/OpenFOAM/lnInclude
    $ENV{WM_PROJECT_DIR}/src/OSspecific/$ENV{WM_OSTYPE}/lnInclude
    $ENV{WM_PROJECT_DIR}/src/finiteArea/lnInclude
    $ENV{WM_PROJECT_DIR}/src/finiteVolume/lnInclude
    $ENV{WM_PROJECT_DIR}/src/fileFormats/lnInclude
    $ENV{WM_PROJECT_DIR}/src/conversion/lnInclude
    $ENV{WM_PROJECT_DIR}/src/meshTools/lnInclude
    $ENV{WM_PROJECT_DIR}/src/lagrangian/basic/lnInclude
12
    $ENV{WM_PROJECT_DIR}/src/overset/lnInclude
13 14 15 16 17 18 19 20 21 22
    ${CMAKE_CURRENT_SOURCE_DIR}
    ${CMAKE_CURRENT_BINARY_DIR}
)

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

add_definitions(
23 24
    -DWM_$ENV{WM_PRECISION_OPTION} -DWM_LABEL_SIZE=$ENV{WM_LABEL_SIZE}
    -DNoRepository
25 26 27 28 29 30 31 32
)

set(CMAKE_BUILD_TYPE Release)

set(CMAKE_CXX_FLAGS_DEBUG
    "-g -O0 -std=c++11 -Wall -Wextra -Wno-unused-parameter -Wnon-virtual-dtor -Wno-overloaded-virtual"
)
set(CMAKE_CXX_FLAGS_RELEASE
33 34
    "-O3 -std=c++11 -Wall -Wextra -Wno-unused-parameter -Wnon-virtual-dtor -Wno-overloaded-virtual"
)
35

36 37 38
# Some characteristics
set(test_file ${CMAKE_CURRENT_BINARY_DIR}/check_initialize.cxx)
file(WRITE ${test_file}
39 40 41 42 43 44 45 46
    "#include <vtkCPProcessor.h>\n"
    "int main() {\n"
    "  vtkCPProcessor* p = vtkCPProcessor::New();\n"
    "  p->Initialize(\"AAA\");\n"
    "  p->Delete();\n"
    "  return 0;\n"
    "}"
)
47
try_compile(CATALYST_HAS_WORKING_DIRECTORY
48
    ${CMAKE_CURRENT_BINARY_DIR} ${test_file}
49
    LINK_LIBRARIES vtkPVPythonCatalyst
50 51
    CMAKE_FLAGS "-DINCLUDE_DIRECTORIES=${PARAVIEW_INCLUDE_DIRS}"
)
52
if (CATALYST_HAS_WORKING_DIRECTORY)
53
    add_definitions(-DUSE_CATALYST_WORKING_DIRECTORY)
54 55
else()
    message(WARNING "==== CAUTION: ParaView Catalyst without chdir capability ====")
56 57 58
endif()


59 60 61 62 63 64 65 66
# Set output library destination to OpenFOAM library directory
set(LIBRARY_OUTPUT_PATH $ENV{FOAM_LIBBIN}
    CACHE INTERNAL
    ""
)

file(GLOB SOURCE_FILES
    catalystCoprocess.C
67 68 69
    catalystTools.C
    catalystInput.C
    catalystFunctionObject.C
70

71 72
    cloud/catalystCloud.C
    cloud/foamVtkCloudAdaptor.C
73

74 75 76 77
    areaMesh/catalystFaMesh.C
    areaMesh/foamVtkFaMeshAdaptor.C
    areaMesh/foamVtkFaMeshAdaptorGeom.C
    areaMesh/foamVtkFaMeshAdaptorFields.C
78

79 80 81 82 83
    volMesh/catalystFvMesh.C
    volMesh/foamVtkFvMeshAdaptor.C
    volMesh/foamVtkFvMeshAdaptorGeom.C
    volMesh/foamVtkFvMeshAdaptorGeomVtu.C
    volMesh/foamVtkFvMeshAdaptorFields.C
84 85 86 87 88 89 90 91 92 93 94
)

set(OPENFOAM_LIBRARIES
    OpenFOAM
    finiteArea
    finiteVolume
    fileFormats
    conversion
    Pstream
    meshTools
    lagrangian
95
    overset
96 97
)

98 99 100 101 102 103 104

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

105 106 107 108 109 110 111 112
add_library(
    catalystFoam
    SHARED
    ${SOURCE_FILES}
)

target_link_libraries(
    catalystFoam
113
    ${LINK_LIBRARIES}
114 115 116 117
    ${OPENFOAM_LIBRARIES}
)

#-----------------------------------------------------------------------------