[cmake-developers] non-default executables (was: akademy summary)

Alexander Neundorf neundorf at kde.org
Mon Oct 2 11:26:36 EDT 2006


On Monday 02 October 2006 17:21, you wrote:
> Alexander Neundorf wrote:
> > There were also some wishes:
>
> [snip]
>
> > 3) provide a target to build the tests, and don't build the test binaries
> > by default without having to adjust a cmake option
> >
> > I'll have a look whether this is possible with the current feature set of
> > CMake, I already talked with Bill about it.
>
> If the executables are test-specific then they should be created in
> tests driven by ctest --build-and-test.  However if there is a whole set
> of tests that use one target you could consider making them first-class
> targets that are not built by default.
>
> I've added a NOT_IN_ALL option for ADD_LIBRARY and ADD_EXECUTABLE.  This
> should let you do it:
>
> ADD_EXECUTABLE(myTestExe NOT_IN_ALL ...)
> ADD_CUSTOM_TARGET(test_executables)
> ADD_DEPENDENCIES(test_executables myTestExe)

How about naming it "EXCLUDE_FROM_ALL" instead of "NOT_IN_ALL", since 
"EXCLUDE_FROM_ALL" already exists for ADD_SUBDIRECTORY ?

Alex
-- 
Work: alexander.neundorf AT jenoptik.com - http://www.jenoptik-los.de
Home: neundorf AT kde.org                - http://www.kde.org
      alex AT neundorf.net               - http://www.neundorf.net


More information about the cmake-developers mailing list