[CMake] Adding a target to 'all' that was previously excluded

Andrew White andrew.white at audinate.com
Tue Jul 3 21:33:33 EDT 2018


How do I add an excluded (executable) target to the build.  I know that if I add a library EXCLUDE_FROM_ALL and then create a dependency on that library then that the library will be built anyway.  How do I trigger similar behaviour from an executable target?

Example:

Directory A contains a CMakeLists.txt that builds half a dozen utilities. As part of my project, I want to add a single target from that list.

I can include the build info without auto-adding all targets by going:

	Add_subdirectory(blah EXCLUDE_FROM_ALL)

How do I then add target blah_X to my 'all' build?  Or is there another way to approach this?

Thanks

--
Andrew



More information about the CMake mailing list