Commit a0d391c9 authored by Mark Olesen's avatar Mark Olesen

COMP: provide fallback value for WM_OSTYPE for cmake (issue #5)

- split off boilerplate OpenFOAM settings as CMakeLists-OpenFOAM.txt

DOC: lowercase names for email addresses (request !2)
parent 9b856995
...@@ -84,8 +84,8 @@ The cmake configuration possibilities are functional, but still very ...@@ -84,8 +84,8 @@ The cmake configuration possibilities are functional, but still very
## Authors ## Authors
- Mark Olesen | <Mark.Olesen@esi-group.com> | (ESI-OpenCFD) - Mark Olesen | <mark.olesen@esi-group.com> | (ESI-OpenCFD)
- Simone Bna | <Simone.Bna@cineca.it> | (CINECA) - Simone Bna | <simone.bna@cineca.it> | (CINECA)
## License ## License
......
include(${PARAVIEW_USE_FILE}) include(${PARAVIEW_USE_FILE})
include_directories( # ----------------------------------------------------------------------
$ENV{WM_PROJECT_DIR}/src/OpenFOAM/lnInclude # Test some characteristics
$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
$ENV{WM_PROJECT_DIR}/src/overset/lnInclude
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
)
link_directories(
$ENV{FOAM_LIBBIN}
$ENV{FOAM_LIBBIN}/dummy
)
add_definitions(
-DWM_$ENV{WM_PRECISION_OPTION} -DWM_LABEL_SIZE=$ENV{WM_LABEL_SIZE}
-DNoRepository
)
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
"-O3 -std=c++11 -Wall -Wextra -Wno-unused-parameter -Wnon-virtual-dtor -Wno-overloaded-virtual"
)
# Some characteristics
set(test_file ${CMAKE_CURRENT_BINARY_DIR}/check_initialize.cxx) set(test_file ${CMAKE_CURRENT_BINARY_DIR}/check_initialize.cxx)
file(WRITE ${test_file} file(WRITE ${test_file}
"#include <vtkCPProcessor.h>\n" "#include <vtkCPProcessor.h>\n"
...@@ -55,6 +23,29 @@ else() ...@@ -55,6 +23,29 @@ else()
message(WARNING "==== CAUTION: ParaView Catalyst without chdir capability ====") message(WARNING "==== CAUTION: ParaView Catalyst without chdir capability ====")
endif() endif()
# ----------------------------------------------------------------------
include_directories(
${LIB_SRC}/OpenFOAM/lnInclude
${LIB_SRC}/OSspecific/${WM_OSTYPE}/lnInclude
${LIB_SRC}/finiteArea/lnInclude
${LIB_SRC}/finiteVolume/lnInclude
${LIB_SRC}/fileFormats/lnInclude
${LIB_SRC}/conversion/lnInclude
${LIB_SRC}/meshTools/lnInclude
${LIB_SRC}/lagrangian/basic/lnInclude
${LIB_SRC}/overset/lnInclude
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
)
link_directories(
$ENV{FOAM_LIBBIN}
$ENV{FOAM_LIBBIN}/dummy
)
set(CMAKE_BUILD_TYPE Release)
set(LIBRARY_OUTPUT_PATH ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} set(LIBRARY_OUTPUT_PATH ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
CACHE INTERNAL CACHE INTERNAL
......
# 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
)
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
"-O3 -std=c++11 -Wall -Wextra -Wno-unused-parameter -Wnon-virtual-dtor -Wno-overloaded-virtual"
)
#-----------------------------------------------------------------------------
...@@ -14,13 +14,11 @@ project(catalyst) ...@@ -14,13 +14,11 @@ project(catalyst)
cmake_policy(SET CMP0002 OLD) cmake_policy(SET CMP0002 OLD)
include(CMakeLists-OpenFOAM.txt)
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# Simple sanity checks # Simple sanity checks
if (NOT EXISTS "$ENV{WM_PROJECT_DIR}")
message(FATAL_ERROR "WM_PROJECT_DIR not set")
endif()
if (EXISTS "$ENV{ParaView_DIR}") if (EXISTS "$ENV{ParaView_DIR}")
find_package(ParaView REQUIRED COMPONENTS vtkPVPythonCatalyst) find_package(ParaView REQUIRED COMPONENTS vtkPVPythonCatalyst)
else() else()
...@@ -53,6 +51,6 @@ message("================") ...@@ -53,6 +51,6 @@ message("================")
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
include(CMakeLists-Common.txt) include(CMakeLists-Catalyst.txt)
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
Markdown is supported
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