Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CMake: Add an external project but exclude from target "all"

Tags:

Is it possible to add an external project in CMake but to exclude it from the all build target?

I've looked at the EXCLUDE_FROM_ALL option which is used with ADD_EXECUTABLE but I don't think this works with an external project.

Alternatively I'd be happy if I could change the default target for CMake, but I I think that's hard-coded to all.

For the project that I'm working on I am generating Unix Makefiles with CMake and right now I'm using CMake version 2.8.10.2.

like image 277
Gabriel Southern Avatar asked Nov 01 '13 22:11

Gabriel Southern


1 Answers

Even if the option EXCLUDE_FROM_ALL is not used upon adding the target by the ExternalProject_add command, the option can be activated retroactively by setting the EXCLUDE_FROM_ALL property of the external project target, i.e.:

ExternalProject_add(MyExternal   URL ... ) set_target_properties(MyExternal PROPERTIES EXCLUDE_FROM_ALL TRUE) 
like image 170
sakra Avatar answered Sep 17 '22 09:09

sakra