# Get the current list of definitions
get_directory_property(COMPILE_DEFINITIONS_LIST COMPILE_DEFINITIONS)
- foreach(DEFINITION ${COMPILE_DEFINITIONS_LIST})
+ foreach(DEFINITION IN LISTS COMPILE_DEFINITIONS_LIST)
if (${DEFINITION} MATCHES "^\\$<\\$<CONFIG:([^>]+)>:([^>]+)>$")
# The entries that contain generator expressions must have the -D inside of the
# expression. So we transform e.g. $<$<CONFIG:Debug>:_DEBUG> to $<$<CONFIG:Debug>:-D_DEBUG>
# Build a list of include directories by putting -I in front of each include dir.
function(get_include_directories IncludeDirectories)
get_directory_property(dirs INCLUDE_DIRECTORIES)
- foreach(dir ${dirs})
+ foreach(dir IN LISTS dirs)
set(INC_DIRECTORIES ${INC_DIRECTORIES} -I${dir})
endforeach()
set(${IncludeDirectories} ${INC_DIRECTORIES} PARENT_SCOPE)
# The parameters after the RetSources are the input files.
function(convert_to_absolute_path RetSources)
set(Sources ${ARGN})
- foreach(Source ${Sources})
+ foreach(Source IN LISTS Sources)
set(AbsolutePathSources ${AbsolutePathSources} ${CMAKE_CURRENT_SOURCE_DIR}/${Source})
endforeach()
set(${RetSources} ${AbsolutePathSources} PARENT_SCOPE)
# For multi-configuration toolset (as Visual Studio)
# set the different configuration defines.
# First DEBUG
- foreach (Definition ${CLR_DEFINES_DEBUG_INIT})
+ foreach (Definition IN LISTS CLR_DEFINES_DEBUG_INIT)
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:DEBUG>:${Definition}>)
endforeach (Definition)
# Then RELEASE
- foreach (Definition ${CLR_DEFINES_RELEASE_INIT})
+ foreach (Definition IN LISTS CLR_DEFINES_RELEASE_INIT)
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:RELEASE>:${Definition}>)
endforeach (Definition)
# And then RELWITHDEBINFO
- foreach (Definition ${CLR_DEFINES_RELWITHDEBINFO_INIT})
+ foreach (Definition IN LISTS CLR_DEFINES_RELWITHDEBINFO_INIT)
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:RELWITHDEBINFO>:${Definition}>)
endforeach (Definition)
# Run custom midl command over each idl file
FIND_PROGRAM( MIDL midl.exe )
-foreach(GENERATE_IDL ${CORGUIDS_IDL_SOURCES})
+foreach(GENERATE_IDL IN LISTS CORGUIDS_IDL_SOURCES)
get_filename_component(IDLNAME ${GENERATE_IDL} NAME_WE)
set(OUT_NAME ${CMAKE_CURRENT_BINARY_DIR}/idls_out/${IDLNAME}_i.c)
set(CORGUIDS_SOURCES ${CORGUIDS_SOURCES} ${OUT_NAME})
else()
#The MIDL tool exists for Windows only, so for other systems, we have the prebuilt xxx_i.c files checked in
-foreach(IDL_SOURCE ${CORGUIDS_IDL_SOURCES})
+foreach(IDL_SOURCE IN LISTS CORGUIDS_IDL_SOURCES)
get_filename_component(IDLNAME ${IDL_SOURCE} NAME_WE)
set(C_SOURCE ../pal/prebuilt/idl/${IDLNAME}_i.c)
set(CORGUIDS_SOURCES ${CORGUIDS_SOURCES} ${C_SOURCE})
# Extract the definitions for the ASM code. Since there is a bug in the cmake that prevents us from
# using the generator expressions, we split the definitions into lists based on the configuration.
-foreach(DEFINITION ${COMPILE_DEFINITIONS_LIST})
+foreach(DEFINITION IN LISTS COMPILE_DEFINITIONS_LIST)
if (${DEFINITION} MATCHES "^\\$<\\$<CONFIG:([^>]+)>:([^>]+)>$")
# The entry contains generator expression, so insert the definition into a definitions list
# corresponding to the config
# Add defines for the ASM. Unfortunately setting it on the target is ignored for asm by the cmake, so we have
# to set it on the sources.
set_property(SOURCE ${VM_SOURCES_WKS_AMD64_ASM} PROPERTY COMPILE_DEFINITIONS ${ASM_DEFINITIONS})
-foreach(CONFIG ${CMAKE_CONFIGURATION_TYPES})
+foreach(CONFIG IN LISTS CMAKE_CONFIGURATION_TYPES)
string(TOUPPER ${CONFIG} CONFIG)
set_property(SOURCE ${VM_SOURCES_WKS_AMD64_ASM} PROPERTY COMPILE_DEFINITIONS_${CONFIG} ${ASM_DEFINITIONS_${CONFIG}})
endforeach()