mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-12-01 13:29:08 -06:00
16 lines
333 B
CMake
16 lines
333 B
CMake
# - Remove a directory if and only if it contains no files
|
|
#
|
|
# Pass the name of the directory as the DIR variable
|
|
|
|
if (DIR)
|
|
# check if empty
|
|
file (GLOB_RECURSE files "${DIR}/*")
|
|
|
|
# remove only if
|
|
if (NOT files)
|
|
execute_process (COMMAND
|
|
${CMAKE_COMMAND} -E remove_directory "${DIR}"
|
|
)
|
|
endif (NOT files)
|
|
endif (DIR)
|