<html><head></head><body><div style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:13px;"><div>Hello,</div><div><br></div><div>I am trying to override CMAKE_STRIP to do this command:</div><div><br></div><div><span>/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip -x mylib.dylib</span><br></div><div><span><br></span></div><div><span>so I tried a basic :</span></div><div><span><br></span></div><div><span>set(CMAKE_STRIP "${CMAKE_STRIP} -x")</span></div><div><span><br></span></div><div><span>and </span></div><div><span><br></span></div><div><span><div>set(CMAKE_STRIP ${CMAKE_STRIP} -x)</div><div><br></div><div>Unfortunately, this overriding does not work and there is the final command that I get in cmake_install.cmake :</div><div><br></div><div><span><div> if(CMAKE_INSTALL_DO_STRIP)</div><div> execute_process(COMMAND "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip -x" "$ENV{DESTDIR}/Users/user/mylib.dylib")</div><div> endif()</div><div><br></div><div>or</div><div><br></div></span></div><div><span><div> if(CMAKE_INSTALL_DO_STRIP)</div><div> execute_process(COMMAND "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip;-x" "$ENV{DESTDIR}/Users/user/mylib.dylib")</div><div> endif()</div><div><br></div><div>This does not work and the final command must be :</div><div><br></div><div><span><div> execute_process(COMMAND "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip" "-x" "$ENV{DESTDIR}/Users/user/mylib.dylib")</div><div><br></div><div><br></div><div>What is the best way to override this ?</div><div><br></div><div>I found a really dirty trick that I can add for each target but I don't want to do that:</div><div><br></div><div><span>add_custom_command(TARGET myTarget POST_BUILD COMMAND $<$<CONFIG:Release>:${CMAKE_STRIP}> $<$<CONFIG:Release>:-x> $<$<CONFIG:Release>:$<TARGET_FILE:</span>myTarget>>)</div><div><br></div><div>Thank you for your help.</div></span></div></span></div></span></div><div style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:13px;"></div></div></body></html>