Skip to content
Snippets Groups Projects
Commit b51c3334 authored by Manuel Grizonnet's avatar Manuel Grizonnet
Browse files

ENH: use OTB module macros

parent d50575d9
No related branches found
No related tags found
No related merge requests found
project(ExternalTemplate)
set(ExternalTemplate_LIBRARIES ExternalTemplate)
itk_module_impl()
otb_module_impl()
# the top-level README is used for describing this module, just
# re-used it for documentation here
get_filename_component( MY_CURENT_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
file( READ "${MY_CURENT_DIR}/README" DOCUMENTATION )
# ITK version 4.5 changed it from EXCLUDE_FROM_ALL to EXCLUDE_FROM_DEFAULT
set( _EXCLUDE "EXCLUDE_FROM_ALL" )
if (NOT "${ITK_VERSION_MAJOR}.${ITK_VERSION_MINOR}.${ITK_VERSION_MINOR_PATCH}" VERSION_LESS "4.5")
set( _EXCLUDE "EXCLUDE_FROM_DEFAULT" )
endif()
set(DOCUMENTATION "OTB module template.")
# itk_module() defines the module dependencies in ExternalTemplate
# ExternalTemplate depends on ITKCommon
......@@ -18,13 +8,12 @@ endif()
# ITK.
# define the dependencies of the include module and the tests
itk_module(ExternalTemplate
otb_module(ExternalTemplate
DEPENDS
ITKCommon
OTBCommon
TEST_DEPENDS
ITKTestKernel
ITKMetaIO
OTBTestKernel
OTBImageIO
DESCRIPTION
"${DOCUMENTATION}"
${_EXCLUDE}
)
#${itk-module} will be the name of this module and will not need to be
#${otb-module} will be the name of this module and will not need to be
#changed when this module is renamed.
set(${itk-module}_SRC
itkSomeFile.cxx
set(${otb-module}_SRC
otbSomeFile.cxx
)
add_library(${itk-module} ${${itk-module}_SRC})
target_link_libraries(${itk-module} ${${itk-module}_LIBRARIES})
itk_module_target(${itk-module})
message (status "${otb-module} " ${otb-module})
message (status "${otb-module}_SRC " ${${otb-module}_SRC})
add_library(${otb-module} ${${otb-module}_SRC})
target_link_libraries(${otb-module} ${${otb-module}_LIBRARIES})
otb_module_target(${otb-module})
File moved
itk_module_test()
otb_module_test()
#${itk-module} will be the name of this module and will not need to be
#${otb-module} will be the name of this module and will not need to be
#changed when this module is renamed.
set(${itk-module}Tests
itkEmptyTest.cxx
set(${otb-module}Tests
otbEmptyTestDriver.cxx
otbEmptyTest.cxx
)
CreateTestDriver(${itk-module} "${${itk-module}-Test_LIBRARIES}" "${${itk-module}Tests}")
add_executable(otbEmptyTestDriver ${${otb-module}Tests})
target_link_libraries(otbEmptyTestDriver ${${otb-module}-Test_LIBRARIES})
otb_module_target_label(otbEmptyTestDriver)
itk_add_test(NAME itkDeleteMeEmptyTest
COMMAND ${itk-module}TestDriver itkEmptyTest "argument1" "..." )
otb_add_test(NAME otbDeleteMeEmptyTest
COMMAND ${otb-module}TestDriver itkEmptyTest "argument1" "..." )
File moved
#include "otbTestMain.h"
void RegisterTests()
{
REGISTER_TEST(otbEmptyTest);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment