[CMake] how to detect architecture ?

Franck Houssen franck.houssen at inria.fr
Tue Jan 9 09:57:45 EST 2018


Is there a way to detect architecture ? 

Seems there is nothing simple since these old threads : 
https://stackoverflow.com/questions/11944060/how-to-detect-target-architecture-using-cmake/12024211#12024211 
https://stackoverflow.com/questions/16796629/cmake-create-architecture-aware-makefile 

Is there a solution now ? 

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. so " on linux (debian, ...) OR "./exe /path/to/lib. dylib " on osx. To replace correctly so/dylib in the bash script I need to know the architecture. Any idea how to do this ? 

Franck 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20180109/77cb8b83/attachment.html>


More information about the CMake mailing list