Skip to content

Commit

Permalink
workaround to force a build type regardless of existing CMAKE_ARGS
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeitsperre committed Mar 8, 2024
1 parent 2d382cc commit 4695c64
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
16 changes: 11 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,24 @@ 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)
add_compile_options(-Wno-deprecated)
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")
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4695c64

Please sign in to comment.