CMakeLists-Common.txt 1.85 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
include(${VTK_USE_FILE})

if(VTK_LIBRARIES)
    message("Found VTK LIBRARIES: " ${VTK_USE_FILE})
endif()

if(${VTK_VERSION} VERSION_GREATER "6")
    message("VTK version: " ${VTK_VERSION})
else()
    message(FATAL_ERROR " VTK6 required")
endif()

include_directories(
    $ENV{WM_PROJECT_DIR}/src/OpenFOAM/lnInclude
    $ENV{WM_PROJECT_DIR}/src/OSspecific/$ENV{WM_OSTYPE}/lnInclude
    $ENV{WM_PROJECT_DIR}/src/triSurface/lnInclude
    $ENV{WM_PROJECT_DIR}/src/finiteVolume/lnInclude
    ${CMAKE_CURRENT_SOURCE_DIR}
    ${CMAKE_CURRENT_BINARY_DIR}
)

link_directories(
    $ENV{FOAM_LIBBIN}
    $ENV{FOAM_EXT_LIBBIN}
)

add_definitions(
    -DWM_$ENV{WM_PRECISION_OPTION} -DNoRepository
    -DWM_LABEL_SIZE=$ENV{WM_LABEL_SIZE}
)

set(CMAKE_BUILD_TYPE Release)

set(CMAKE_CXX_FLAGS_DEBUG
35
    "-g -O0 -std=c++0x -Wall -Wextra -Wno-unused-parameter -Wnon-virtual-dtor -Wno-overloaded-virtual"
36
)
37
set(CMAKE_C_FLAGS_DEBUG "-g -O0 -std=c++0x")
38 39

set(CMAKE_CXX_FLAGS_RELEASE
40 41
    "-O3 -std=c++0x -Wall -Wextra -Wno-unused-parameter -Wnon-virtual-dtor -Wno-overloaded-virtual")
set(CMAKE_C_FLAGS_RELEASE "-O3 -std=c++0x")
42 43 44 45 46 47 48 49 50

# Set output library destination to plugin directory
set(LIBRARY_OUTPUT_PATH $ENV{FOAM_LIBBIN}
    CACHE INTERNAL
    ""
)

file(GLOB SOURCE_FILES
    fieldVisualisationBase.C
51
    functionObjectBase.C
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
    functionObjectCloud.C
    functionObjectLine.C
    functionObjectSurface.C
    geometryBase.C
    geometrySurface.C
    pathline.C
    pointData.C
    runTimePostProcessing.C
    runTimePostProcessingFunctionObject.C
    scene.C
    surface.C
    text.C
)

set(OPENFOAM_LIBRARIES
    OpenFOAM
    triSurface
    finiteVolume
)

add_library(
    runTimePostProcessing
    SHARED
    ${SOURCE_FILES}
)

target_link_libraries(
    runTimePostProcessing
    ${VTK_LIBRARIES}
    ${OPENFOAM_LIBRARIES}
)


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