try_compile()

try_compile

Try building some code.

Try Compiling Whole Projects

try_compile(RESULT_VAR <bindir> <srcdir>
            <projectName> [<targetName>] [CMAKE_FLAGS <flags>...]
            [OUTPUT_VARIABLE <var>])

Try building a project. The success or failure of the try_compile, i.e. TRUE or FALSE respectively, is returned in RESULT_VAR.

In this form, <srcdir> should contain a complete CMake