diff --git a/CMakeLists.txt b/CMakeLists.txt index 95da5806..33a7d9b4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,6 +40,13 @@ string(TIMESTAMP YEAR "%Y") # Set the CMake module path list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") +#------------------------------------------------------------------------------ +# Static or dynamic CCPP, default is dynamic; standalone build can only be dynamic +option(STATIC "Build a static CCPP" OFF) +if (PROJECT STREQUAL "Unknown" AND STATIC) + message(FATAL_ERROR "ccpp-framework standalone build can only be dynamic") +endif(PROJECT STREQUAL "Unknown" AND STATIC) + #------------------------------------------------------------------------------ # Set OpenMP flags for C/C++/Fortran if (OPENMP) diff --git a/schemes/check/ccpp_prebuild_config.py b/schemes/check/ccpp_prebuild_config.py index 1129ccf4..a994686a 100755 --- a/schemes/check/ccpp_prebuild_config.py +++ b/schemes/check/ccpp_prebuild_config.py @@ -28,6 +28,10 @@ '../../../../../schemes/check/check_test.f90' : [ 'test' ], } +# Default build dir, relative to current working directory, +# if not specified as command-line argument +DEFAULT_BUILD_DIR = '.' + # Auto-generated makefile/cmakefile snippets that contain all schemes SCHEMES_MAKEFILE = '/dev/null' SCHEMES_CMAKEFILE = '/dev/null' @@ -84,9 +88,5 @@ # Template code to generate include files # ############################################################################### -# Name of the CCPP data structure in the host model cap; -# in the case of FV3, this is a 2-dimensional array with -# the number of blocks as the first and the number of -# OpenMP threads as the second dimension; nb is the loop -# index for the current block, nt for the current thread +# Name of the CCPP data structure in the host model cap CCPP_DATA_STRUCTURE = 'cdata' diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2bef8b4e..2ca7447f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -123,9 +123,11 @@ set(${PACKAGE}_LIB_DIRS #------------------------------------------------------------------------------ # Add the tests (designed for DYNAMIC build only) -if(!STATIC) -add_subdirectory(tests) -endif(!STATIC) +if(STATIC) + message(STATUS "Skipping tests, defined for dynamic build only") +else(STATIC) + add_subdirectory(tests) +endif(STATIC) #------------------------------------------------------------------------------ # Define the executable and what to link