Skip to content
Snippets Groups Projects
Commit 56dd71ab authored by Mark OLESEN's avatar Mark OLESEN
Browse files

CONFIG: cmake targets are globally unique

- unify CMakeLists naming and align content
parent 96b65a78
Branches
Tags
No related merge requests found
Showing
with 220 additions and 183 deletions
#-----------------------------------------------------------------------------
# Standard definitions when using OpenFOAM
if (NOT EXISTS "$ENV{WM_PROJECT_DIR}")
message(FATAL_ERROR "WM_PROJECT_DIR not set - no OpenFOAM??")
endif()
# WM_OSTYPE env variable is optional (only POSIX anyhow)
if (EXISTS "$ENV{WM_OSTYPE}")
set(WM_OSTYPE "$ENV{WM_OSTYPE}")
else()
set(WM_OSTYPE "POSIX")
endif()
# Convenience name, as per wmake internals
set(LIB_SRC "$ENV{WM_PROJECT_DIR}/src")
# Needed for internal label-size, scalar-size, templates
add_definitions(
-DWM_$ENV{WM_PRECISION_OPTION}
-DWM_LABEL_SIZE=$ENV{WM_LABEL_SIZE}
-DNoRepository
-std=c++11
)
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# OpenFOAM reader plugin for ParaView GUI
link_directories(
$ENV{FOAM_LIBBIN}
)
include_directories(
${LIB_SRC}/OpenFOAM/lnInclude
${LIB_SRC}/OSspecific/${WM_OSTYPE}/lnInclude
${LIB_SRC}/conversion/lnInclude
${LIB_SRC}/finiteArea/lnInclude
${LIB_SRC}/finiteVolume/lnInclude
${PROJECT_SOURCE_DIR}/../foamPv
${PROJECT_SOURCE_DIR}/../vtkPVFoam
)
set(OPENFOAM_LIBRARIES
OpenFOAM
finiteVolume
finiteArea
conversion
)
# Set output library destination to plugin directory
set(
LIBRARY_OUTPUT_PATH $ENV{PV_PLUGIN_PATH}
CACHE INTERNAL
"Single output directory for building all libraries."
)
if (PARAVIEW_QT_VERSION VERSION_GREATER "4")
qt5_wrap_cpp(MOC_SRCS pqFoamReaderControls.h)
else()
qt4_wrap_cpp(MOC_SRCS pqFoamReaderControls.h)
endif()
add_paraview_property_group_widget(IFACES0 IFACES0_SRCS
TYPE "openfoam_reader_general_controls"
CLASS_NAME pqFoamReaderControls
)
add_paraview_plugin(
PVFoamReader_SM "1.0"
SERVER_MANAGER_XML PVFoamReader_SM.xml
SERVER_MANAGER_SOURCES vtkPVFoamReader.cxx
GUI_INTERFACES
${IFACES0}
SOURCES
${IFACES0_SRCS}
${MOC_SRCS}
pqFoamReaderControls.cxx
)
target_link_libraries(
PVFoamReader_SM
LINK_PUBLIC
vtkPVFoam-pv${PARAVIEW_VERSION_MAJOR}.${PARAVIEW_VERSION_MINOR}
foamPv-pv${PARAVIEW_VERSION_MAJOR}.${PARAVIEW_VERSION_MINOR}
${OPENFOAM_LIBRARIES}
)
#-----------------------------------------------------------------------------
# Create a plugin to add a reader to the ParaView GUI
cmake_minimum_required(VERSION 2.8)
find_package(ParaView REQUIRED)
include(${PARAVIEW_USE_FILE})
#-----------------------------------------------------------------------------
# Standard definitions when using OpenFOAM
if (NOT EXISTS "$ENV{WM_PROJECT_DIR}")
message(FATAL_ERROR "WM_PROJECT_DIR not set - no OpenFOAM??")
endif()
cmake_minimum_required(VERSION 2.8)
cmake_policy(SET CMP0002 NEW) # Policy CMP0002 required for for cmake >= 3
# WM_OSTYPE env variable is optional (only POSIX anyhow)
if (EXISTS "$ENV{WM_OSTYPE}")
set(WM_OSTYPE "$ENV{WM_OSTYPE}")
else()
set(WM_OSTYPE "POSIX")
# 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()
# Convenience name, as per wmake internals
set(LIB_SRC "$ENV{WM_PROJECT_DIR}/src")
# Needed for internal label-size, scalar-size, templates
add_definitions(
-DWM_$ENV{WM_PRECISION_OPTION}
-DWM_LABEL_SIZE=$ENV{WM_LABEL_SIZE}
-DNoRepository
-std=c++11
)
#-----------------------------------------------------------------------------
# Simple discovery and sanity checks
link_directories(
$ENV{FOAM_LIBBIN}
)
include_directories(
${LIB_SRC}/OpenFOAM/lnInclude
${LIB_SRC}/OSspecific/${WM_OSTYPE}/lnInclude
${LIB_SRC}/conversion/lnInclude
${LIB_SRC}/finiteArea/lnInclude
${LIB_SRC}/finiteVolume/lnInclude
${PROJECT_SOURCE_DIR}/../foamPv
${PROJECT_SOURCE_DIR}/../vtkPVFoam
)
set(OPENFOAM_LIBRARIES
OpenFOAM
finiteVolume
finiteArea
conversion
)
# Set output library destination to plugin directory
set(
LIBRARY_OUTPUT_PATH $ENV{PV_PLUGIN_PATH}
CACHE INTERNAL
"Single output directory for building all libraries."
)
if (PARAVIEW_QT_VERSION VERSION_GREATER "4")
qt5_wrap_cpp(MOC_SRCS
pqFoamReaderControls.h
)
else()
qt4_wrap_cpp(MOC_SRCS
pqFoamReaderControls.h
)
endif()
add_paraview_property_group_widget(IFACES0 IFACES0_SRCS
TYPE "openfoam_reader_general_controls"
CLASS_NAME pqFoamReaderControls
)
add_paraview_plugin(
PVFoamReader_SM "1.0"
SERVER_MANAGER_XML PVFoamReader_SM.xml
SERVER_MANAGER_SOURCES vtkPVFoamReader.cxx
GUI_INTERFACES
${IFACES0}
SOURCES
${IFACES0_SRCS}
${MOC_SRCS}
pqFoamReaderControls.cxx
)
find_package(ParaView REQUIRED)
include(${PARAVIEW_USE_FILE})
#-----------------------------------------------------------------------------
target_link_libraries(
PVFoamReader_SM
LINK_PUBLIC
vtkPVFoam-pv${PARAVIEW_VERSION_MAJOR}.${PARAVIEW_VERSION_MINOR}
foamPv-pv${PARAVIEW_VERSION_MAJOR}.${PARAVIEW_VERSION_MINOR}
${OPENFOAM_LIBRARIES}
)
include(CMakeLists-OpenFOAM.txt)
include(CMakeLists-Project.txt)
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# Standard definitions when using OpenFOAM
if (NOT EXISTS "$ENV{WM_PROJECT_DIR}")
message(FATAL_ERROR "WM_PROJECT_DIR not set - no OpenFOAM??")
endif()
# WM_OSTYPE env variable is optional (only POSIX anyhow)
if (EXISTS "$ENV{WM_OSTYPE}")
set(WM_OSTYPE "$ENV{WM_OSTYPE}")
else()
set(WM_OSTYPE "POSIX")
endif()
# Convenience name, as per wmake internals
set(LIB_SRC "$ENV{WM_PROJECT_DIR}/src")
# Needed for internal label-size, scalar-size, templates
add_definitions(
-DWM_$ENV{WM_PRECISION_OPTION}
-DWM_LABEL_SIZE=$ENV{WM_LABEL_SIZE}
-DNoRepository
-std=c++11
)
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# OpenFOAM blockMeshDict reader plugin for ParaView GUI
link_directories(
$ENV{FOAM_LIBBIN}
)
include_directories(
${LIB_SRC}/OpenFOAM/lnInclude
${LIB_SRC}/OSspecific/${WM_OSTYPE}/lnInclude
${LIB_SRC}/meshing/blockMesh/lnInclude
${PROJECT_SOURCE_DIR}/../foamPv
${PROJECT_SOURCE_DIR}/../vtkPVblockMesh
)
set(OPENFOAM_LIBRARIES
OpenFOAM
blockMesh
)
# Set output library destination to plugin directory
set(
LIBRARY_OUTPUT_PATH $ENV{PV_PLUGIN_PATH}
CACHE INTERNAL
"Single output directory for building all libraries."
)
if (PARAVIEW_QT_VERSION VERSION_GREATER "4")
qt5_wrap_cpp(MOC_SRCS pqFoamBlockMeshControls.h)
else()
qt4_wrap_cpp(MOC_SRCS pqFoamBlockMeshControls.h)
endif()
add_paraview_property_group_widget(IFACES0 IFACES0_SRCS
TYPE "openfoam_blockMesh_general_controls"
CLASS_NAME pqFoamBlockMeshControls
)
add_paraview_plugin(
PVblockMeshReader_SM "1.0"
SERVER_MANAGER_XML PVblockMeshReader_SM.xml
SERVER_MANAGER_SOURCES vtkPVblockMeshReader.cxx
GUI_INTERFACES
${IFACES0}
SOURCES
${IFACES0_SRCS}
${MOC_SRCS}
pqFoamBlockMeshControls.cxx
)
target_link_libraries(
PVblockMeshReader_SM
LINK_PUBLIC
vtkPVblockMesh-pv${PARAVIEW_VERSION_MAJOR}.${PARAVIEW_VERSION_MINOR}
foamPv-pv${PARAVIEW_VERSION_MAJOR}.${PARAVIEW_VERSION_MINOR}
${OPENFOAM_LIBRARIES}
)
#-----------------------------------------------------------------------------
# Create a plugin to add a reader to the ParaView GUI
cmake_minimum_required(VERSION 2.6)
find_package(ParaView REQUIRED)
include(${PARAVIEW_USE_FILE})
link_directories(
$ENV{FOAM_LIBBIN}
)
#-----------------------------------------------------------------------------
# Standard definitions when using OpenFOAM
if (NOT EXISTS "$ENV{WM_PROJECT_DIR}")
message(FATAL_ERROR "WM_PROJECT_DIR not set - no OpenFOAM??")
endif()
cmake_minimum_required(VERSION 2.8)
cmake_policy(SET CMP0002 NEW) # Policy CMP0002 required for for cmake >= 3
# WM_OSTYPE env variable is optional (only POSIX anyhow)
if (EXISTS "$ENV{WM_OSTYPE}")
set(WM_OSTYPE "$ENV{WM_OSTYPE}")
else()
set(WM_OSTYPE "POSIX")
# 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()
# Convenience name, as per wmake internals
set(LIB_SRC "$ENV{WM_PROJECT_DIR}/src")
# Needed for internal label-size, scalar-size, templates
add_definitions(
-DWM_$ENV{WM_PRECISION_OPTION}
-DWM_LABEL_SIZE=$ENV{WM_LABEL_SIZE}
-DNoRepository
-std=c++11
)
#-----------------------------------------------------------------------------
include_directories(
${LIB_SRC}/OpenFOAM/lnInclude
${LIB_SRC}/OSspecific/${WM_OSTYPE}/lnInclude
${LIB_SRC}/meshing/blockMesh/lnInclude
${PROJECT_SOURCE_DIR}/../foamPv
${PROJECT_SOURCE_DIR}/../vtkPVblockMesh
)
# Simple discovery and sanity checks
set(OPENFOAM_LIBRARIES
OpenFOAM
blockMesh
)
# Set output library destination to plugin directory
set(
LIBRARY_OUTPUT_PATH $ENV{PV_PLUGIN_PATH}
CACHE INTERNAL
"Single output directory for building all libraries."
)
if (PARAVIEW_QT_VERSION VERSION_GREATER "4")
qt5_wrap_cpp(MOC_SRCS
pqFoamBlockMeshControls.h
)
else()
qt4_wrap_cpp(MOC_SRCS
pqFoamBlockMeshControls.h
)
endif()
add_paraview_property_group_widget(IFACES0 IFACES0_SRCS
TYPE "openfoam_blockMesh_general_controls"
CLASS_NAME pqFoamBlockMeshControls
)
add_paraview_plugin(
PVblockMeshReader_SM "1.0"
SERVER_MANAGER_XML PVblockMeshReader_SM.xml
SERVER_MANAGER_SOURCES vtkPVblockMeshReader.cxx
GUI_INTERFACES
${IFACES0}
SOURCES
${IFACES0_SRCS}
${MOC_SRCS}
pqFoamBlockMeshControls.cxx
)
find_package(ParaView REQUIRED)
include(${PARAVIEW_USE_FILE})
#-----------------------------------------------------------------------------
target_link_libraries(
PVblockMeshReader_SM
LINK_PUBLIC
vtkPVblockMesh-pv${PARAVIEW_VERSION_MAJOR}.${PARAVIEW_VERSION_MINOR}
foamPv-pv${PARAVIEW_VERSION_MAJOR}.${PARAVIEW_VERSION_MINOR}
${OPENFOAM_LIBRARIES}
)
include(CMakeLists-OpenFOAM.txt)
include(CMakeLists-Project.txt)
#-----------------------------------------------------------------------------
Subproject commit d97babec3581bad413fd602e17fcd4bc1e312d26
Subproject commit 2ac2c5ec6e3bec25b3e4b641781adcd78d8dd20b
#-----------------------------------------------------------------------------
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
""
......
#------------------------------------------------------------------------------
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)
#-----------------------------------------------------------------------------
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment