[ITK Community] [Insight-developers] CMake variables and preprocessor directives
Brad King
brad.king at kitware.com
Thu Feb 20 10:15:41 EST 2014
On 02/20/2014 10:04 AM, Bradley Lowekamp wrote:
> add them as command line defines with some add_definition commands?
If the application specifies its own list of components when calling
find_package(ITK) then it already knows what modules it is using.
It is only when using "all" modules that happen to have been built
with ITK that the application may need to get information like this.
The ITKConfig.cmake file already provides it as:
- ITK_MODULES_ENABLED = modules enabled when ITK was built
- ITK_MODULES_REQUESTED = modules requested by app, or all enabled
If an application needs this information at the preprocessor level
it should do its own thing based on its own needs. It could be
as simple as
set_property(DIRECTORY APPEND PROPERTY
COMPILE_DEFINITIONS ${ITK_MODULES_REQUESTED})
but that could make command lines somewhat long. IMO the approach
of using configure_file for specific modules is best.
-Brad K
_______________________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Kitware offers ITK Training Courses, for more information visit:
http://kitware.com/products/protraining.php
Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ
Follow this link to subscribe/unsubscribe:
http://www.itk.org/mailman/listinfo/insight-developers
More information about the Community
mailing list