[CMake] Per-target include dirs that work in both 2.8.7 and 2.8.10.2?

Magnus Therning magnus at therning.org
Sat Mar 2 13:35:54 EST 2013


On Thu, Feb 28, 2013 at 03:19:48PM -0500, Jean-Christophe Fillion-Robin wrote:
> Hi Magnus,
> 
> As already mentioned, the target property INCLUDE_DIRECTORIES has been
> introduced in CMake 2.8.8. The following page is useful to find out such
> things. See
> http://www.cmake.org/Wiki/CMake_Version_Compatibility_Matrix/Properties#Properties_on_Targets
> 
> To get around it, as mentioned by Bill, you could probably create on folder
> per target and call include_directories() in each folder.
> 
> An other option could be to create a wrapper around the "add_target"
> command that would create a directory, write a CMakeLists and then
> call add_subdirectory(/path/to/project-build/target target).

I went for the much easier solution: convince my colleague that he
*really* needs a newer version of cmake on his system... the amount of
extra goodness by far outweighs the trouble of upgrading ;)

/M

-- 
Magnus Therning                      OpenPGP: 0xAB4DFBA4 
email: magnus at therning.org   jabber: magnus at therning.org
twitter: magthe               http://therning.org/magnus


More information about the CMake mailing list