[CMake] try_compile, again

Alain Miniussi alain.miniussi at oca.eu
Mon Dec 14 05:03:23 EST 2015


Hi,

I tried using try_compile, and, as usual, fail to understand how it's supposed to work (2.8.12).

The documentation says:
  Some extra flags that can be included are,  INCLUDE_DIRECTORIES, LINK_DIRECTORIES, and LINK_LIBRARIES.
but does not mention where they can be included (none of the two mentioned form indicate those flags).
I tried putting "INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIRS}" just after the CMAKE_FLAGS., but it is just ignored.
  
Also:
  COMPILE_DEFINITIONS are -Ddefinition that will be passed to the compile line.
but that seems incorrect (which is good) as I can use them to pass "-std=c++11" which is not a -D option (and I don't know how I could pass that option otherwise).

Thanks

-- 
---
Alain


More information about the CMake mailing list