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
included are, INCLUDE_DIRECTORIES, LINK_DIRECTORIES, and
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>)
  include_directories(${INCLUDE_DIRECTORIES})
  link_directories(${LINK_DIRECTORIES})
  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 www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake