[CMake] Converting Autoconf-based tests that compile/run a program and check its exit code
Eric Noulard
eric.noulard at gmail.com
Thu Sep 29 03:25:43 EDT 2016
2016-09-29 9:13 GMT+02:00 Alessandro Menti <alessandro.menti at hotmail.it>:
> Hi everyone,
> I'm converting an Autoconf-based library (specifically, gettext [1]) to
> CMake to be able to compile it easily on Windows and to mark it as a
> dependency of another CMake-based project.
>
> I have come across a test [2] that compiles a small program, runs it and
> checks its exit code to determine if some functions work correctly.
>
> 1) Is there a way to perform a similar check in CMake (maybe with a
> custom module)?
>
I guess that you should look at
try_run command:
https://cmake.org/cmake/help/v3.6/command/try_run.html
> 2) If not, what would be the best way to convert it?
>
> Thanks in advance,
> Alessandro Menti
>
> [1] https://www.gnu.org/software/gettext/
> [2]
> http://git.savannah.gnu.org/cgit/gettext.git/tree/gettext-
> runtime/m4/fcntl-o.m4
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at http://www.kitware.com/
> opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
>
--
Eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20160929/8af822f4/attachment.html>
More information about the CMake
mailing list