Skip to content

Commit

Permalink
Merge branch 'thoennes/fix-cmake-dep-changes' into 'master'
Browse files Browse the repository at this point in the history
fix changes introduced in get_current_module_name

See merge request walberla/walberla!668
  • Loading branch information
PLJ27 committed Apr 30, 2024
2 parents 0c51ebc + 2ddf717 commit 941fd0f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
5 changes: 0 additions & 5 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1992,11 +1992,6 @@ benchmark_clang8:

benchmark_ClangBuildAnalyzer:
script:
- apt-get update --fix-missing
- apt-get -y install apt-transport-https ca-certificates gnupg software-properties-common wget
- wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | apt-key add -
- apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic main'
- apt-get -y install cmake ninja-build
- cmake --version
- ccache --version
- mpirun --version
Expand Down
6 changes: 3 additions & 3 deletions cmake/waLBerlaFunctions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function ( waLBerla_add_module )

set( ALL_DEPENDENCIES ${ARG_DEPENDS} ${ARG_OPTIONAL_DEPENDS})
# Module name is the directory relative to WALBERLA_MODULE_DIRS
get_current_module_name ( moduleName )
get_current_module_name ( )
get_module_library_name ( moduleLibraryName ${moduleName} )

# Test if all required libraries are available
Expand Down Expand Up @@ -234,7 +234,7 @@ function ( waLBerla_compile_test )
cmake_parse_arguments( ARG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )

# Module name is the directory relative to WALBERLA_MODULE_DIRS
get_current_module_name ( moduleName )
get_current_module_name ( )

# Filename of first source file is used as name for testcase if no name was given
if( NOT ARG_NAME )
Expand Down Expand Up @@ -365,7 +365,7 @@ function ( waLBerla_execute_test )
if( ARG_NO_MODULE_LABEL )
set_tests_properties ( ${ARG_NAME} PROPERTIES LABELS "${ARG_LABELS}" )
else()
get_current_module_name ( moduleName )
get_current_module_name ( )
set_tests_properties ( ${ARG_NAME} PROPERTIES LABELS "${moduleName} ${ARG_LABELS}" )
endif()

Expand Down
9 changes: 4 additions & 5 deletions cmake/waLBerlaModuleDependencySystem.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,19 @@
# Determine Module name using the current folder
#
# moduleFolder is the current source directory relative to a folder in WALBERLA_MODULE_DIRS
# If more arguments are given, these are prepended to WALBERLA_MODULE_DIR
# The variable moduleName will be set in PARENT_SCOPE and is the first folder in WALBERLA_MODULE_DIRS
# Example:
# If CMAKE_CURRENT_SOURCE_DIR is /src/core/field and /src/ is an element in WALBERLA_MODULE_DIRS,
# then module name is "core/field"
# then moduleName is "core"
#
#######################################################################################################################
function ( get_current_module_name moduleNameOut )
function ( get_current_module_name )

foreach( moduleDir ${ARGN} ${WALBERLA_MODULE_DIRS} )
file( RELATIVE_PATH moduleFolder ${moduleDir} ${CMAKE_CURRENT_SOURCE_DIR} )
if ( NOT ${moduleFolder} MATCHES "\\.\\./.*" )
#append / to make cmake_path also work with one directory only
set( moduleFolder "${moduleFolder}/" )
cmake_path(GET moduleFolder PARENT_PATH moduleNameOut)
string(REGEX REPLACE "(.*)/.*" "\\1" moduleNameOut ${moduleFolder})
set(moduleName ${moduleNameOut} PARENT_SCOPE)
return()
endif()
Expand Down

0 comments on commit 941fd0f

Please sign in to comment.