Commit 1bc574d5 authored by Julien Malik's avatar Julien Malik

COMP: use cmake_parse_arguments instead of custom hack OTB_PARSE_ARGUMENTS (available since 2.8.3)

parent 2033216e
# When used externally, OTBParseArguments is included explicitely in UseOTB.cmake
# Otherwise, let's include it here
if (NOT COMMAND OTB_PARSE_ARGUMENTS)
include(OTBParseArguments)
endif()
macro(OTB_CREATE_APPLICATION)
OTB_PARSE_ARGUMENTS(
APPLICATION
"NAME;SOURCES;INCLUDE_DIRS;LINK_LIBRARIES;BUILD_PATH;INSTALL_PATH"
""
${ARGN})
cmake_parse_arguments(APPLICATION "" "NAME;BUILD_PATH;INSTALL_PATH" "SOURCES;INCLUDE_DIRS;LINK_LIBRARIES" ${ARGN} )
set( APPLICATION_TARGET_NAME otbapp_${APPLICATION_NAME} )
......@@ -121,11 +110,7 @@ endmacro(OTB_CREATE_APPLICATION)
macro(OTB_TEST_APPLICATION)
OTB_PARSE_ARGUMENTS(
TESTAPPLICATION
"NAME;APP;OPTIONS;TESTENVOPTIONS;VALID"
""
${ARGN})
cmake_parse_arguments(TESTAPPLICATION "TESTENVOPTIONS" "NAME;APP" "OPTIONS;TESTENVOPTIONS" ${ARGN} )
if (NOT TESTAPPLICATION_TESTENVOPTIONS)
add_test(NAME ${TESTAPPLICATION_NAME}
......
......@@ -233,7 +233,6 @@ IF(OTB_USE_MAPNIK)
ENDIF(OTB_USE_MAPNIK)
INCLUDE(${OTB_LIBRARY_DIRS}/OTBParseArguments.cmake)
INCLUDE(${OTB_LIBRARY_DIRS}/OTBWrapperMacros.cmake)
SET(CMAKE_MODULE_PATH ${BACKUP_CMAKE_MODULE_PATH})
......@@ -357,8 +357,6 @@ CONFIGURE_FILE(${OTB_SOURCE_DIR}/CMake/UseOTB.cmake.in
${OTB_BINARY_DIR}/UseOTB.cmake COPYONLY IMMEDIATE)
# Copy the helper macros to the build tree for use from external projects
CONFIGURE_FILE(${OTB_SOURCE_DIR}/CMake/OTBParseArguments.cmake
${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/OTBParseArguments.cmake COPYONLY IMMEDIATE)
CONFIGURE_FILE(${OTB_SOURCE_DIR}/CMake/OTBWrapperMacros.cmake
${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/OTBWrapperMacros.cmake COPYONLY IMMEDIATE)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment