<html><body><div style="font-family: times new roman, new york, times, serif; font-size: 12pt; color: #000000"><div>Is there a way to detect architecture ?<br></div><div><br></div><div>Seems there is nothing simple since these old threads :<br></div><div><a href="https://stackoverflow.com/questions/11944060/how-to-detect-target-architecture-using-cmake/12024211#12024211">https://stackoverflow.com/questions/11944060/how-to-detect-target-architecture-using-cmake/12024211#12024211</a><br data-mce-bogus="1"></div><div><a href="https://stackoverflow.com/questions/16796629/cmake-create-architecture-aware-makefile">https://stackoverflow.com/questions/16796629/cmake-create-architecture-aware-makefile</a><br data-mce-bogus="1"></div><div><br></div><div>Is there a solution now ?<br></div><div><br></div><div>My need is quite simple: I have an executable who needs dlopen. To test it, I planned to write a bash script that would have done "./exe /path/to/lib.<strong>so</strong>" on linux (debian, ...) OR "./exe /path/to/lib.<strong>dylib</strong>" on osx. To replace correctly so/dylib in the bash script I need to know the architecture. Any idea how to do this ?<br></div><div><br></div><div>Franck<br></div></div></body></html>