File tree Expand file tree Collapse file tree 1 file changed +15
-7
lines changed
Expand file tree Collapse file tree 1 file changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -57,16 +57,24 @@ if (NOT TARGET Forge::forge AND
5757endif ()
5858
5959if (TARGET Forge::forge)
60- get_property (config TARGET Forge::forge PROPERTY IMPORTED_CONFIGURATIONS )
61- if (NOT config )
62- set (config "NOCONFIG" )
60+ get_property (configs TARGET Forge::forge PROPERTY IMPORTED_CONFIGURATIONS )
61+ if (NOT configs )
62+ set (configs "NOCONFIG" )
6363 endif ()
64- get_property (loc TARGET Forge::forge PROPERTY IMPORTED_LOCATION_${config} )
64+ foreach (config IN LISTS configs)
65+ get_property (loc TARGET Forge::forge PROPERTY IMPORTED_LOCATION_${config} )
66+
67+ # break if any of the imported configurations exist. All configs write to the same
68+ # location so they are not working as CMake intended. Its fine for single config
69+ # installers like ours.
70+ if (EXISTS ${loc} )
71+ set (Forge_BINARY_EXISTS TRUE )
72+ break ()
73+ endif ()
74+ endforeach ()
6575endif ()
6676
67- if ((TARGET Forge::forge AND EXISTS ${loc} )
68- OR
69- TARGET forge)
77+ if ((TARGET Forge::forge AND Forge_BINARY_EXISTS) OR TARGET forge)
7078 set (Forge_FOUND ON )
7179 if (TARGET forge AND NOT TARGET Forge::forge)
7280 add_library (Forge::forge ALIAS forge)
You can’t perform that action at this time.
0 commit comments