<div dir="ltr">I have a project I successfully built under mingw32 and I'm now attempting to build under mingw64.<div><br></div><div>I am cross compiling under Fedora x86_64...</div><div><br></div><div>In order to pull in all the DLLs for CPack I devised the following:</div>
<div><br></div><div><div> # Try to grab all the runtime dlls for the windows installer. </div><div> # This will break if the dll names change!</div><div> foreach(RUNTIME</div><div> libgcc_s_sjlj-1.dll</div>
<div> libgcc_s_seh-1.dll</div><div> libstdc++-6.dll</div><div> libsndfile-1.dll</div></div><div> ....</div><div><div> message(STATUS "Checking for ${RUNTIME}")</div><div> find_library(${RUNTIME}_LIB NAMES ${RUNTIME})</div>
<div> if(${RUNTIME}_LIB-FOUND)</div><div> message(STATUS "runtime found: ${${RUNTIME}_LIB}")</div><div> list(APPEND CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS ${${RUNTIME}_LIB})</div><div> else()</div>
<div> message(STATUS "${RUNTIME} not found. Hope nothing breaks!")</div><div> endif()</div><div> endforeach()</div></div><div><br></div><div>The problem is that two different libgcc_s library variants are used... </div>
<div>libgcc_s_sjlj-1.dll w/ mingw32<br></div><div>libgcc_s_seh-1.dll w/ mingw64<br></div><div><br></div><div>I could take them out of the foreach loop and check for them separately but I was looking for something a bit more elegant which is why I added the NAMES modifier to find_library. </div>
<div><br></div><div>Is there a way to pass both to the find_library macro? I tried making them a list but then foreach iterated over them. I tried putting them in quotes but then it treats them as a string...</div><div><br>
</div><div>Ideas?</div><div><br></div><div>Thanks,</div><div>Richard</div></div>