set(CMAKE_BUILD_MODULE_SYSTEM_INDEPENDENT ON CACHE STRING "build the module INDEPENDENT of the module system, so the build in the build tree works even after a module purge")
#-D CMAKE_BUILD_MODULE_SYSTEM_INDEPENDENT=ON
option(CMAKE_BUILD_MODULE_SYSTEM_INDEPENDENT
"build the module INDEPENDENT of the module system, so the build in the build tree works even after a module purge"
# or after executing CMake editing the CMakeCache.txt, preferably with a corresponding cmake editor i.e ccmake
set(CMAKE_BUILD_MODULE_SYSTEM_INDEPENDENT OFF CACHE STRING "build the module INDEPENDENT of the module system, so the build in the build tree works even after a module purge")
message(STATUS "build INDEPENDENT of module system ${CMAKE_BUILD_MODULE_SYSTEM_INDEPENDENT}")
# set specific place where to search for the netCDF directory
set(CMAKE_NETCDF_DIR " " CACHE STRING "set set specific place where to search for the netCDF directory")
message(STATUS "search in additional directory ${CMAKE_NETCDF_DIR} for netCDF")
# The variable "CMAKE_WITH_MPI" can be set before executing cmake via a cache command:
# $cmake -DCMAKE_WITH_MPI:STRING=ON ..
# or in a cache file:
# $cmake -C ../CMakeCacheFiles/example
# or after executing CMake editing the CMakeCache.txt, preferably with a corresponding cmake editor i.e. ccmake
set(CMAKE_WITH_MPI OFF CACHE STRING "build the module with MPI, so it can be executed using mpirun")
# same with OpenMP
set(CMAKE_WITH_OpenMP OFF CACHE STRING "build the module with OpenMP parallelization")
# same with lapack
set(CMAKE_WITH_LAPACK OFF CACHE STRING "build the module with lapack library")
# same with coverage
set(CMAKE_WITH_COVERAGE OFF CACHE STRING "build the module with gcov coverage support")
# additional cmake-modules created for the purpose of finding netCDF or other libraries ly in the source_directory in
# a folder named cmake-modules. This command tells cmake to search there for Find<module>.cmake files
# or after executing CMake editing the CMakeCache.txt, preferably with a corresponding cmake editor i.e ccmake
option(CMAKE_BUILD_MODULE_SYSTEM_INDEPENDENT "build the module INDEPENDENT of the module system, so the build in the build tree works even after a module purge")
message(STATUS "build INDEPENDENT of module system ${CMAKE_BUILD_MODULE_SYSTEM_INDEPENDENT}")
# set specific place where to search for the netCDF directory
set(CMAKE_NETCDF_DIR "" CACHE PATH "set set specific place where to search for the netCDF directory")
message(STATUS "search in additional directory '${CMAKE_NETCDF_DIR}' for netCDF")
# The variable "CMAKE_WITH_MPI" can be set before executing cmake via a cache command:
# $cmake -DCMAKE_WITH_MPI=ON ..
# or in a cache file:
# $cmake -C ../CMakeCacheFiles/example
# or after executing CMake editing the CMakeCache.txt,
# preferably with a corresponding cmake editor i.e. ccmake
# same with OpenMP, lapack, coverage (all OFF by default)
option(CMAKE_WITH_MPI "build the module with MPI, so it can be executed using mpirun")
option(CMAKE_WITH_OpenMP "build the module with OpenMP parallelization")
option(CMAKE_WITH_LAPACK "build the module with lapack library")
option(CMAKE_WITH_COVERAGE "build the module with gcov coverage support")
# if cmake provides a findLIBRARY module, this gets invoked via find_package(LIBRARY)
if(CMAKE_WITH_MPI)
# find if there is an MPI setup on the system and if so, set corresponding variables