[Insight-developers] ITKModular Regression: Changing locations for libraries

Brad King brad.king at kitware.com
Mon Mar 21 13:48:22 EDT 2011


On 3/21/2011 12:58 PM, Bill Lorensen wrote:
> Prior to modularization, this cmake snippet from
> Modules/Core/Common/test/CMakeLists.txt:
>   set(LIBRARY_OUTPUT_PATH "${ITKTesting_BINARY_DIR}/Temporary")
> 
> now I need:
>
>   set_property(TARGET FactoryTestLib PROPERTY LIBRARY_OUTPUT_DIRECTORY
> ${ITK_BINARY_DIR}/Testing/Temporary)
>   set_property(TARGET FactoryTestLib PROPERTY RUNTIME_OUTPUT_DIRECTORY
> ${ITK_BINARY_DIR}/Testing/Temporary)
>   set_property(TARGET FactoryTestLib PROPERTY ARCHIVE_OUTPUT_DIRECTORY 
> ${ITK_BINARY_DIR}/Testing/Temporary)

Correct.  The new modular build system uses modern CMake conventions.
The use of LIBRARY_OUTPUT_PATH has been superseded by the
(RUNTIME|ARCHIVE|LIBRARY)_OUTPUT_DIRECTORY properties which allow each
type of file to be located separately.  Since we set all three for
targets at the top then all three need to be changed for a specific
target if all .lib, .a, .dll, and .so files are to be affected.

However, for a plugin CMake prefers the use of MODULE rather than SHARED
libraries.  Then only LIBRARY_OUTPUT_DIRECTORY would need to be set.  I
don't remember why ITK uses SHARED rather than MODULE for its plugins.

-Brad


More information about the Insight-developers mailing list