Relative Content

Tag Archive for cmake

CMake Custom Target Configuration Allow Differing Outputs Without Rebuild

I have a custom target for my CMake file that is configurable in the number of output files it produces. If the caller passes a particular argument to my script, I want to generate more output files. The issue that I am struggling to resolve is that if the user doesn’t pass in the argument to generate more files, and the inputs haven’t changed, I want the target to be skipped.

Limiting the Scope of Variables in CMake to specific Projects/Subdirectories

I would like to set a variable that is available for modification in a third-party library which I have included as a subdirectory (add_subdirectory(.../third_party/libA)). The library allows me to enable/disable certain portions of the build process such as to including testing targets, for example: set(BUILD_TESTS OFF).