CMAKE_STRIP arguments?

Is there a way to pass arguments to cmake strip (invoked via ninja install/strip)? Is appending them to CMAKE_STRIP the correct approach? Can’t really find the docs to cmake stripping.

I suspect this is not documented since it is mostly internal. A feature request to document the semantics and whether appending works might be the way to go.


When I set CMAKE_STRIP with arguments it appears as the binary no longer gets stripped at all. The cmake_install.cmake file in the build folder looks correct, but the actual stripping does not take place. Can I see verbose output of cmake strip? I’m invoking it via ninja install/strip.

You can run the install script yourself:

$ cmake --trace-expand -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake