<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 9, 2018 at 6:57 AM, Franck Houssen <span dir="ltr"><<a href="mailto:franck.houssen@inria.fr" target="_blank">franck.houssen@inria.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div style="font-family:"times new roman","new york",times,serif;font-size:12pt;color:rgb(0,0,0)"><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" target="_blank">https://stackoverflow.com/<wbr>questions/11944060/how-to-<wbr>detect-target-architecture-<wbr>using-cmake/12024211#12024211</a><br></div><div><a href="https://stackoverflow.com/questions/16796629/cmake-create-architecture-aware-makefile" target="_blank">https://stackoverflow.com/<wbr>questions/16796629/cmake-<wbr>create-architecture-aware-<wbr>makefile</a><br></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 ?<span class="gmail-HOEnZb"><font color="#888888"><br></font></span></div><span class="gmail-HOEnZb"><font color="#888888"><div><br></div></font></span></div></div></blockquote><div><br></div><div><a href="https://cmake.org/Wiki/CMake_Useful_Variables">https://cmake.org/Wiki/CMake_Useful_Variables</a></div><div><a href="https://cmake.org/Wiki/CMake_Checking_Platform">https://cmake.org/Wiki/CMake_Checking_Platform</a><br></div><div><br></div><div>if( APPLE ) </div><div>   install( PROGRAMS <a href="http://apple.script.sh">apple.script.sh</a> DESTINATION script.sh )</div><div>elseif( UNIX ) </div><div>   install( PROGRAMS <a href="http://linux.script.sh">linux.script.sh</a> DESTINATION script.sh )</div><div>endif( )</div><div># not sure what the correct tag in endif should be.</div><div><br></div><div>so you can just keep 2 scripts and install approrpiately</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div style="font-family:"times new roman","new york",times,serif;font-size:12pt;color:rgb(0,0,0)"><span class="gmail-HOEnZb"><font color="#888888"><div></div><div>Franck<br></div></font></span></div></div><br>--<br>
<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" rel="noreferrer" target="_blank">http://www.cmake.org/Wiki/<wbr>CMake_FAQ</a><br>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/<wbr>support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/<wbr>consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/<wbr>training.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://cmake.org/mailman/listinfo/cmake" rel="noreferrer" target="_blank">https://cmake.org/mailman/<wbr>listinfo/cmake</a><br>
<br></blockquote></div><br></div></div>