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

Kuba Bican kuba at smyslzivota.cz
Thu Mar 26 07:40:01 EDT 2009


Hello,

I would like to ask for help regarding the topic in subject. First,
let me explain closer my task:

I would like to build the same source tree for different platforms. A
platform means various embedded OSes, WIN32, etc. Compilation for each
platform may differ by includes and libs used as well as some
toolchain and compile options changes. There are some minor platform
changes in the code handled by conditional compilation.

    The aim is to have multiple projects in one solution, each
compiling the same sources, but for different platform.

The first problem I encountered is to set the INCLUDE_DIRECTORIES and
LINK_DIRECTORIES for each target separately. Is this possible in
CMake? I can't find these properties of TARGET. I found them in the
DIRECTORY, but this is not applicable as the source tree is shared
across different platform projects.

I am quite sure that it is possible to setup MSVC project files as
well as write makefiles for such case but i have probles to accoplish
the task using CMake.

One more question: is it possible to have multi-choice option in CMake
... something like combo-box in CMake GUI?

Thanks in advance for the answers.

Regards,

    Jakub Bican


More information about the CMake mailing list