Template:ITKCMakeLists: Difference between revisions

From KitwarePublic
Jump to navigationJump to search
(→‎CMakeLists.txt: correct file name)
(Undo revision 41927 by Dzenanz (talk))
Line 3: Line 3:
|
|
cmake_minimum_required(VERSION 2.6)
cmake_minimum_required(VERSION 2.6)
 
project(ImageFilter)
project({{{1}}})
 
find_package(ITK REQUIRED)
find_package(ITK REQUIRED)
include(${ITK_USE_FILE})
include(${ITK_USE_FILE})
 
add_executable(ImageFilter ImageFilterExample.cxx)
add_executable({{{1}}} {{{1}}}.cxx)
 
if( "${ITK_VERSION_MAJOR}" LESS 4 )
if( "${ITK_VERSION_MAJOR}" LESS 4 )
   target_link_libraries(ImageFilter ITKReview ${ITK_LIBRARIES})
   target_link_libraries({{{1}}} ITKReview ${ITK_LIBRARIES})
else( "${ITK_VERSION_MAJOR}" LESS 4 )
else( "${ITK_VERSION_MAJOR}" LESS 4 )
   target_link_libraries(ImageFilter ${ITK_LIBRARIES})
   target_link_libraries({{{1}}} ${ITK_LIBRARIES})
endif( "${ITK_VERSION_MAJOR}" LESS 4 )
endif( "${ITK_VERSION_MAJOR}" LESS 4 )


|lang=cmake}}
|lang=cmake}}

Revision as of 15:25, 1 August 2011

CMakeLists.txt

<syntaxhighlight lang="cmake"> cmake_minimum_required(VERSION 2.6)

project({{{1}}})

find_package(ITK REQUIRED) include(${ITK_USE_FILE})

add_executable({{{1}}} {{{1}}}.cxx)

if( "${ITK_VERSION_MAJOR}" LESS 4 )

 target_link_libraries({{{1}}} ITKReview ${ITK_LIBRARIES})

else( "${ITK_VERSION_MAJOR}" LESS 4 )

 target_link_libraries({{{1}}} ${ITK_LIBRARIES})

endif( "${ITK_VERSION_MAJOR}" LESS 4 )

</syntaxhighlight>