try_compile documentation is confusing

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

try_compile documentation is confusing

Joseph Garvin
From the try_compile docs:

"In this version all files in bindir/CMakeFiles/CMakeTmp, will be
cleaned automatically, for debugging a --debug-trycompile can be
passed to cmake to avoid the clean. Some extra flags that can be
LINK_LIBRARIES. COMPILE_DEFINITIONS are -Ddefinition that will be
passed to the compile line. try_compile creates a CMakeList.txt file
on the fly that looks like this:

  add_definitions( <expanded COMPILE_DEFINITIONS from calling cmake>)
  add_executable(cmTryCompileExec sources)
  target_link_libraries(cmTryCompileExec ${LINK_LIBRARIES})"

It's unclear to me if I can specify INCLUDE_DIRECTORIES and such in
the parameter list to try_compile, or if they're special variables I
can set that will affect try_compile. From my own testing *neither*
seems to be true, so I have no idea what the docs are trying to say,
but maybe I'm doing something else wrong. Can anyone clarify?
Powered by

Visit other Kitware open-source projects at

Please keep messages on-topic and check the CMake FAQ at:

Follow this link to subscribe/unsubscribe: