[CMake] setting different include_directories, link_directories, etc for different targets

Alexander Neundorf a.neundorf-work at gmx.net
Thu Mar 26 16:42:10 EDT 2009


On Thursday 26 March 2009, Jakub Bican wrote:
> Thanks.
>
> Your proposal is very near where I am actually. The problem is here:
>
> if ( ${ActivePlatform} STREQUAL "WinCE")
>  set_target_properties( roj1_${ActivePlatform} ... ....)
> elseif( ${ActivePlatform} STREQUAL "Win32")
>  set_target_properties( roj1_${ActivePlatform} ... ....)
> endif()
>
> You can't simply set the LINK_DIRECTORIES and INCLUDE_DIRECTORIES for
> each of those targets separately.
>
> Just to illustrate: My platforms are WIN32, various PharLap ETS
> versions, various RTX versions, UNIX/LINUX platforms. At the time, it
> is supposed to compile UNIX plaforms on the target machines, but all
> other are compiled undex Windows and should be developed/compiled
> simultaneously.
>
> If such use of CMake is not preferred - could anyone recommend a
> better solution/tool?

Try to get used to having multiple build tree for the same source tree. Then 
it's really straightforward and you won't get strange effects.

Alex


More information about the CMake mailing list