2011/1/10 John Beuving <[email protected]>:
>
> I have the following software setup where I need to have build variants
> providing different builds for the same (sub)project
>
> - worker ( calls the Qt Processevents function if Qt is enabled for this
> project (#define USE_WORKER_QT)
> - gui app (uses Qt)
> - console app (normal application used for data export)
>
>
> So the gui application uses Qt and needs to use the worker static library
> with the define USE_WORKER_QT set
> and the console application needs a variant build of the worker library
> where USE_WORKER_QT is not set.
>
> How can I achieve this. Is this even possible with cmake ??
You may build your worker lib twice:
# first build USE_WORKER_QT is not set
add_library(worker-noqt STATIC ${WORKER_SRC})
# second build USE_WORKER_QT set
add_library(worker-qt STATIC ${WORKER_SRC})
set_target_properties(worker-qt PROPERTIES COMPILE_FLAGS "-DUSE_WORKER_QT")
#link the apps with the appropriate build of the worker lib
add_executable(gui-app ${GUI_SRC})
target_link_libraries(gui-app worker-qt)
add_executable(console-app ${CONSOLE_SRC})
target_link_libraries(console-app worker-noqt)
--
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org
_______________________________________________
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