[Insight-users] Need tutorial tu use Itk with VS2005
Michael Jackson
mike.jackson at bluequartz.net
Tue Oct 13 09:58:18 EDT 2009
On Oct 13, 2009, at 8:16 AM, Daanen Vincent wrote:
>>
>> 4) The best way to proceed is to CMake-ify your application,
>> in this way, you entire project will be:
>>
>> a) Configured with consistent options
>> b) Setup for easy migration from one computer to another
>> c) On Big step closer to becoming multi-platform.
>>
>
> One thing I do not know how to do is to specifiy different include/
> link
> directories for debug/release and also different libraires (we use a
> decorated name for debug library: eg Toto.lib for release an
> TotoD.lib for
> debug ....) but i will find (i hope so :) )
Here is a quick macro that I use in my own projects to create
"decorated" names.
macro(StaticLibraryProperties targetName )
if (WIN32 AND NOT MINGW)
SET (DEBUG_EXTENSION "_d")
else()
SET (DEBUG_EXTENSION "_debug")
endif()
IF (WIN32 AND NOT MINGW)
SET(LIBRARY_RELEASE_NAME "lib${targetName}" CACHE INTERNAL ""
FORCE)
SET(LIBRARY_DEBUG_NAME "lib${targetName}${DEBUG_EXTENSION}"
CACHE INTERNAL "" FORCE)
ELSE (WIN32 AND NOT MINGW)
SET(LIBRARY_RELEASE_NAME "${targetName}" CACHE INTERNAL ""
FORCE)
SET(LIBRARY_DEBUG_NAME "${targetName}${DEBUG_EXTENSION}"
CACHE INTERNAL "" FORCE)
ENDIF(WIN32 AND NOT MINGW)
#-- Set the Debug and Release names for the libraries
SET_TARGET_PROPERTIES( ${targetName}
PROPERTIES
DEBUG_OUTPUT_NAME ${LIBRARY_DEBUG_NAME}
RELEASE_OUTPUT_NAME ${LIBRARY_RELEASE_NAME}
)
endmacro(StaticLibraryProperties)
And I call it like this:
add_library(MXALib STATIC ${MXALib_SRCS} )
target_link_libraries(MXALib )
StaticLibraryProperties( MXALib )
Hope that helps.
_________________________________________________________
Mike Jackson mike.jackson at bluequartz.net
BlueQuartz Software www.bluequartz.net
Principal Software Engineer Dayton, Ohio
More information about the Insight-users
mailing list