Skip to content

Commit 20f8b18

Browse files
committed
Update Pull #443, allow multiple config files
The "include()" cmake function only read the first file when passed a list. Adding a foreach loop supports allowing a list of files which is useful for adding and override/addendum file to a base config.
1 parent a12baba commit 20f8b18

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ include("${OSAL_SOURCE_DIR}/default_config.cmake")
5454

5555
# The user-specified file is optional, but in case the value is defined but the
5656
# file does not exist, this should be treated as an error.
57-
if (DEFINED OSAL_CONFIGURATION_FILE)
58-
include(${OSAL_CONFIGURATION_FILE})
59-
endif (DEFINED OSAL_CONFIGURATION_FILE)
57+
foreach(CONFIG ${OSAL_CONFIGURATION_FILE})
58+
include(${CONFIG})
59+
endforeach(CONFIG OSAL_CONFIGURATION_FILE)
6060

6161
# Use the supplied configuration to generate the osconfig.h file
6262
# which can be referenced by the code. This will be stored in the top level

0 commit comments

Comments
 (0)