mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
CONFIG: cmake targets are globally unique
- unify CMakeLists naming and align content
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
#-----------------------------------------------------------------------------
|
||||
project(runTimePostProcessing)
|
||||
|
||||
include(${VTK_USE_FILE})
|
||||
|
||||
@ -28,7 +29,8 @@ link_directories(
|
||||
|
||||
set(CMAKE_BUILD_TYPE Release)
|
||||
|
||||
# Set output library destination to plugin directory
|
||||
# Build intermediate (library) directly into the OpenFOAM libdir
|
||||
# - implies CMAKE_INSTALL_PREFIX is ignored and there is no 'install' phase
|
||||
set(LIBRARY_OUTPUT_PATH $ENV{FOAM_LIBBIN}
|
||||
CACHE INTERNAL
|
||||
""
|
||||
@ -1,9 +1,15 @@
|
||||
#------------------------------------------------------------------------------
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
cmake_policy(SET CMP0002 NEW) # Policy CMP0002 required for for cmake >= 3
|
||||
|
||||
project(runTimePostProcessing)
|
||||
# Fail if not building out-of-source
|
||||
if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR)
|
||||
message(FATAL_ERROR
|
||||
"In-source builds disallowed. Use a separate build directory")
|
||||
endif()
|
||||
|
||||
# Set policy for CMP0002 needed for cmake > 3
|
||||
cmake_policy(SET CMP0002 OLD)
|
||||
#-----------------------------------------------------------------------------
|
||||
# Simple discovery and sanity checks
|
||||
|
||||
if (EXISTS "$ENV{VTK_DIR}")
|
||||
message("Building with VTK from $ENV{VTK_DIR}")
|
||||
@ -11,17 +17,19 @@ if (EXISTS "$ENV{VTK_DIR}")
|
||||
include(${VTK_USE_FILE})
|
||||
elseif (EXISTS "$ENV{ParaView_DIR}")
|
||||
message("Building with Paraview from $ENV{ParaView_DIR}")
|
||||
find_package(ParaView REQUIRED)
|
||||
find_package(ParaView REQUIRED HINTS $ENV{ParaView_DIR})
|
||||
include(${VTK_USE_FILE})
|
||||
set(
|
||||
VTK_VERSION
|
||||
"${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}.${VTK_BUILD_VERSION}"
|
||||
)
|
||||
else()
|
||||
message (FATAL_ERROR "VTK not found using VTK_DIR or ParaView_DIR")
|
||||
message(FATAL_ERROR "VTK not found using VTK_DIR or ParaView_DIR")
|
||||
endif()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
include(CMakeLists-OpenFOAM.txt)
|
||||
include(CMakeLists-Common.txt)
|
||||
include(CMakeLists-Project.txt)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user