mirror of
https://github.com/eclipse/upm.git
synced 2025-03-15 04:57:30 +03:00
cmake: Make sure utilities directory gets added to cmake
If directories are specified with -DMODULE_LIST=blah, it's possible to skip adding the utilities directory which is needed by *most* sensor library targets in UPM. Added a check for this when using -DMODULE_LIST. Signed-off-by: Noel Eck <noel.eck@intel.com>
This commit is contained in:
parent
cdc33ceb9f
commit
72e8629d72
@ -547,12 +547,23 @@ elseif (BUILDSWIGPYTHON)
|
||||
file (WRITE ${CMAKE_CURRENT_BINARY_DIR}/pyupm_doxy2swig.i "// Empty doxy2swig stub")
|
||||
endif (BUILDDOC AND BUILDSWIGPYTHON)
|
||||
|
||||
# Add subdirectories from MODULE_LIST if defined
|
||||
# Example -DMODULE_LIST="dfrph;rotaryencoder"
|
||||
if (MODULE_LIST)
|
||||
set(SUBDIRS ${MODULE_LIST})
|
||||
set(SUBDIRS ${SUBDIRS} upm)
|
||||
else()
|
||||
# Otherwise, add all subdirectories
|
||||
subdirlist(SUBDIRS ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
endif()
|
||||
|
||||
# If the SUBDIRS list does NOT include the utilities directory, add it since
|
||||
# most sensor library targets depend on utilities
|
||||
if (NOT "${SUBDIRS}" MATCHES utilities)
|
||||
add_subdirectory(${CMAKE_SOURCE_DIR}/src/utilities)
|
||||
endif()
|
||||
|
||||
# Iterate over each directory in SUBDIRS
|
||||
foreach(subdir ${SUBDIRS})
|
||||
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${subdir}/CMakeLists.txt)
|
||||
add_subdirectory(${subdir})
|
||||
|
Loading…
x
Reference in New Issue
Block a user