Skip to content
This repository was archived by the owner on Apr 2, 2025. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions CMake/cotire.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2355,12 +2355,22 @@ function (cotire_generate_target_script _language _configurations _target _targe
CMAKE_${_language}_SOURCE_FILE_EXTENSIONS)
if (DEFINED ${_var})
string (REPLACE "\"" "\\\"" _value "${${_var}}")
set (_contents "${_contents}set (${_var} \"${_value}\")\n")
if (NOT _contentsHasGeneratorExpressions)
if ("${_value}" MATCHES "\\$<.*>")

if ("${_value}" MATCHES "\\$<.*>")
# We have to evaluate generator expressions
if (NOT _contentsHasGeneratorExpressions)
set (_contentsHasGeneratorExpressions TRUE)
endif()

# Expand various generator expressions which can only be evaluated on binary targets manually
foreach(_currentReplacedGeneratorExpression "C_COMPILER_ID" "CXX_COMPILER_ID")
set(_currentReplacement ${CMAKE_${_currentReplacedGeneratorExpression}})

string (REGEX REPLACE "\\$<${_currentReplacedGeneratorExpression}:([a-zA-Z0-9]*)>" "$<STREQUAL:\\\\\"${_currentReplacement}\\\\\",\\\\\"\\1\\\\\">" _value "${_value}")
endforeach(_currentReplacedGeneratorExpression)
endif()

set (_contents "${_contents}set (${_var} \"${_value}\")\n")
endif()
endforeach()
# generate target script file
Expand Down