diff --git a/CMakeLists.txt b/CMakeLists.txt index ab93125..426e4be 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,11 +26,11 @@ set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) -# Setup Raven Project -PROJECT(${SKBUILD_PROJECT_NAME} LANGUAGES CXX VERSION ${SKBUILD_PROJECT_VERSION}) - -# Set the RavenHydroFramework source code directory -SET(raven_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/RavenHydroFramework") +# Set default build type in CMake if skbuild is set +IF(FORCE_BUILD_TYPE) + SET(CMAKE_BUILD_TYPE "${FORCE_BUILD_TYPE_VALUE}" CACHE STRING "Overwrite build type" FORCE) + message(STATUS "Force modified CMAKE_BUILD_TYPE to '${FORCE_BUILD_TYPE_VALUE}'") +ENDIF() # Remove deprecation warnings for GCC IF(CMAKE_COMPILER_IS_GNUCXX) @@ -38,6 +38,12 @@ IF(CMAKE_COMPILER_IS_GNUCXX) message(STATUS "Modified compile flags with '-Wno-deprecated'") ENDIF(CMAKE_COMPILER_IS_GNUCXX) +# Setup Raven Project +PROJECT(${SKBUILD_PROJECT_NAME} LANGUAGES CXX VERSION ${SKBUILD_PROJECT_VERSION}) + +# Set the RavenHydroFramework source code directory +SET(raven_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/RavenHydroFramework") + IF(NOT EXISTS ${raven_SOURCE_DIR} OR ${ALWAYS_DOWNLOAD}) IF(NOT EXISTS ${raven_SOURCE_DIR}) message(STATUS "Sources ${raven_SOURCE_DIR} not found: fetching Raven source files from remote") diff --git a/pyproject.toml b/pyproject.toml index 807668c..8977db0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -71,6 +71,9 @@ ALWAYS_DOWNLOAD = false COMPILE_EXE = true # trigger the library building block in the CMakeLists.txt (NOT YET IMPLEMENTED) COMPILE_LIB = false +# force build type +FORCE_BUILD_TYPE = true +FORCE_BUILD_TYPE_VALUE = "Debug" # trigger the python library building block in the CMakeLists.txt PYTHON = true # the folder where the netcdf finding script is located