[CMake] Converting Autoconf-based tests that compile/run a program and check its exit code

Alessandro Menti alessandro.menti at hotmail.it
Thu Sep 29 03:13:37 EDT 2016


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)?
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


More information about the CMake mailing list