using a target with try_run

Alexander Neundorf neundorf at kde.org
Wed Mar 11 23:13:59 CET 2009


On Wednesday 11 March 2009, Ian Monroe wrote:
> On Wed, Mar 11, 2009 at 2:39 PM, Alexander Neundorf <neundorf at kde.org> 
wrote:
> > On Wednesday 11 March 2009, Ian Monroe wrote:
> >> Seems to be impossible to use try_run in any sort of portable way
> >> since you can't use target_link_libraries and include_directories with
> >> it. Right now I have it rigged up, but I actually give it direct GCC
> >> commands.
> >>
> >> So is it possible to use a target with try_run? Or is try_run pretty
> >> much just useless?
> >
> > TRY_RUN() and TRY_COMPILE() are relatively low-level, "normal" users
> > shouldn't use them.
> > There are cmake modules like CheckCSourceRuns.cmake which wrap it, they
> > are intended for "end users".
> > Is there something you want to do what you can't do with
> > check_c_source_runs() or check_cxx_source_runs() ?
> >
> > Alex
>
> Well I didn't know that it existed. :)
>
> The documentation for check_cxx_source_runs() says "macro which checks
> if the source code compiles". It says the same thing for
> CHECK_CXX_SOURCE_COMPILES so I'm guessing the docs are just wrong?

Fixed in cmake cvs HEAD.

Alex



More information about the Kde-buildsystem mailing list