CMakeLists.txt 1.76 KB
Newer Older
1
#------------------------------------------------------------------------------
2 3
cmake_minimum_required(VERSION 2.8)

4 5 6 7 8 9 10
# Fail immediately if not using an out-of-source build
if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR)
    message(FATAL_ERROR
        "In-source builds are not supported.  Please create a build directory "
        "separate from the source directory")
endif()

11 12 13 14 15
project(catalyst)

# Set policy for CMP0002 needed for cmake > 3
cmake_policy(SET CMP0002 OLD)

16

17 18
include(CMakeLists-OpenFOAM.txt)

19 20 21
#------------------------------------------------------------------------------
# Simple sanity checks

22 23
if (EXISTS "$ENV{ParaView_DIR}")
    find_package(ParaView REQUIRED COMPONENTS vtkPVPythonCatalyst)
24
else()
25
    message(FATAL_ERROR "ParaView_DIR not set")
26
endif()
27 28


29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
#------------------------------------------------------------------------------
# Installation locations (not much)
# - default install into FOAM_LIBBIN

if ((NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY) OR
    ("${CMAKE_LIBRARY_OUTPUT_DIRECTORY}" STREQUAL "default"))
    set(CMAKE_LIBRARY_OUTPUT_DIRECTORY $ENV{FOAM_LIBBIN})
endif()


#-----------------------------------------------------------------------------
# All messages

message("================")
message("Using OpenFOAM = $ENV{WM_PROJECT_DIR}")
message("Using ParaView = $ENV{ParaView_DIR}")
if (NOT PARAVIEW_USE_MPI)
    message(WARNING "==== Recommended to build using ParaView Catalyst with MPI ====")
endif()
message("install libdir = ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
49
message("install installdir = ${CMAKE_INSTALL_PREFIX}")
50 51 52 53 54
message("================")


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

55
include(CMakeLists-Catalyst.txt)
56 57

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