Skip to content
Snippets Groups Projects
Commit 2ddf7172 authored by Dominik Thoennes's avatar Dominik Thoennes Committed by Jonas Plewinski
Browse files

fix changes introduced in get_current_module_name

parent 40643e29
Branches
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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
......@@ -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 )
......@@ -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()
......
......@@ -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()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment