fixed older CMake versions using PATH instead of DIRECTORY in get_filename_component()
This commit is contained in:
parent
5bef5d8f53
commit
af5eab238d
@ -212,9 +212,14 @@ endmacro()
|
||||
|
||||
function(subdirs VAR DIRPATH)
|
||||
|
||||
if(${CMAKE_VERSION} VERSION_LESS 2.12 )
|
||||
set(COMP_VAR PATH)
|
||||
else()
|
||||
set(COMP_VAR DIRECTORY)
|
||||
endif()
|
||||
file(GLOB_RECURSE SDIR ${DIRPATH}/*)
|
||||
foreach(LOOP ${SDIR})
|
||||
get_filename_component(LOOP ${LOOP} DIRECTORY)
|
||||
get_filename_component(LOOP ${LOOP} ${COMP_VAR})
|
||||
list(APPEND ALLDIRS ${LOOP})
|
||||
endforeach()
|
||||
list(REMOVE_DUPLICATES ALLDIRS)
|
||||
|
Loading…
x
Reference in New Issue
Block a user