File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -100,7 +100,25 @@ function(_pkgconfig_parse_variables variables)
100100 endif ()
101101
102102 list (APPEND result_variables ${var} )
103- list (APPEND result_values "${value} " )
103+
104+ # The result_values are for the install(CODE) and generator expression
105+ # $<INSTALL_PREFIX> works since CMake 3.27, for earlier versions the escaped
106+ # variable CMAKE_INSTALL_PREFIX can be used.
107+ if (
108+ CMAKE_VERSION VERSION_LESS 3.27
109+ AND value MATCHES [[.*\$<INSTALL_PREFIX>.*]]
110+ )
111+ string (
112+ REPLACE
113+ "$<INSTALL_PREFIX>"
114+ "\$ {CMAKE_INSTALL_PREFIX}"
115+ replaced_value
116+ "${value} "
117+ )
118+ list (APPEND result_values "${replaced_value} " )
119+ else ()
120+ list (APPEND result_values "${value} " )
121+ endif ()
104122
105123 # Replace possible INSTALL_PREFIX in value for usage in add_custom_command,
106124 # in the result_values above the intact genex is left for enabling the
You can’t perform that action at this time.
0 commit comments