Commit 567eec59 authored by Julien Malik's avatar Julien Malik

ENH: use lowercase CMake commands

(follow http://public.kitware.com/Bug/view.php?id=11175)
parent fc280e88
# ensure WIN32 definition
IF(WIN32)
ADD_DEFINITIONS(-DWIN32)
ENDIF(WIN32)
if(WIN32)
add_definitions(-DWIN32)
endif(WIN32)
# On Visual Studio 8 MS deprecated C. This removes all 1.276E1265 security
# warnings
IF(WIN32)
IF(NOT CYGWIN)
IF(NOT MINGW)
ADD_DEFINITIONS(
if(WIN32)
if(NOT CYGWIN)
if(NOT MINGW)
add_definitions(
-D_CRT_FAR_MAPPINGS_NO_DEPRECATE
-D_CRT_IS_WCTYPE_NO_DEPRECATE
-D_CRT_MANAGED_FP_NO_DEPRECATE
......@@ -23,11 +23,11 @@ IF(WIN32)
-D_SCL_SECURE_NO_DEPRECATE
)
IF (MSVC)
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
ADD_DEFINITIONS(-D_CRT_NONSTDC_NO_WARNING)
ENDIF(MSVC)
if(MSVC)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
add_definitions(-D_CRT_NONSTDC_NO_WARNING)
endif(MSVC)
ENDIF(NOT MINGW)
ENDIF(NOT CYGWIN)
ENDIF(WIN32)
\ No newline at end of file
endif(NOT MINGW)
endif(NOT CYGWIN)
endif(WIN32)
# Source : http://www.itk.org/Wiki/CMakeMacroParseArguments
MACRO(PARSE_ARGUMENTS prefix arg_names option_names)
SET(DEFAULT_ARGS)
FOREACH(arg_name ${arg_names})
SET(${prefix}_${arg_name})
ENDFOREACH(arg_name)
FOREACH(option ${option_names})
SET(${prefix}_${option} FALSE)
ENDFOREACH(option)
macro(PARSE_ARGUMENTS prefix arg_names option_names)
set(DEFAULT_ARGS)
foreach(arg_name ${arg_names})
set(${prefix}_${arg_name})
endforeach(arg_name)
foreach(option ${option_names})
set(${prefix}_${option} FALSE)
endforeach(option)
SET(current_arg_name DEFAULT_ARGS)
SET(current_arg_list)
FOREACH(arg ${ARGN})
SET(larg_names ${arg_names})
LIST(FIND larg_names "${arg}" is_arg_name)
IF (is_arg_name GREATER -1)
SET(${prefix}_${current_arg_name} ${current_arg_list})
SET(current_arg_name ${arg})
SET(current_arg_list)
ELSE (is_arg_name GREATER -1)
SET(loption_names ${option_names})
LIST(FIND loption_names "${arg}" is_option)
IF (is_option GREATER -1)
SET(${prefix}_${arg} TRUE)
ELSE (is_option GREATER -1)
SET(current_arg_list ${current_arg_list} ${arg})
ENDIF (is_option GREATER -1)
ENDIF (is_arg_name GREATER -1)
ENDFOREACH(arg)
SET(${prefix}_${current_arg_name} ${current_arg_list})
ENDMACRO(PARSE_ARGUMENTS)
\ No newline at end of file
set(current_arg_name DEFAULT_ARGS)
set(current_arg_list)
foreach(arg ${ARGN})
set(larg_names ${arg_names})
list(FIND larg_names "${arg}" is_arg_name)
if(is_arg_name GREATER -1)
set(${prefix}_${current_arg_name} ${current_arg_list})
set(current_arg_name ${arg})
set(current_arg_list)
else(is_arg_name GREATER -1)
set(loption_names ${option_names})
list(FIND loption_names "${arg}" is_option)
if(is_option GREATER -1)
set(${prefix}_${arg} TRUE)
else(is_option GREATER -1)
set(current_arg_list ${current_arg_list} ${arg})
endif(is_option GREATER -1)
endif(is_arg_name GREATER -1)
endforeach(arg)
set(${prefix}_${current_arg_name} ${current_arg_list})
endmacro(PARSE_ARGUMENTS)
This diff is collapsed.
PROJECT(OTB-Wrapper)
project(OTB-Wrapper)
cmake_minimum_required(VERSION 2.6)
IF(COMMAND CMAKE_POLICY)
CMAKE_POLICY(SET CMP0003 NEW)
ENDIF(COMMAND CMAKE_POLICY)
if(COMMAND CMAKE_POLICY)
cmake_policy(SET CMP0003 NEW)
endif(COMMAND CMAKE_POLICY)
# Path to additional CMake modules
SET(CMAKE_MODULE_PATH
set(CMAKE_MODULE_PATH
${CMAKE_SOURCE_DIR}/CMake
${CMAKE_MODULE_PATH})
include(Definitions)
# Link to the Orfeo ToolBox
FIND_PACKAGE(OTB REQUIRED PATHS /usr/lib/otb )
INCLUDE(${OTB_USE_FILE})
find_package(OTB REQUIRED PATHS /usr/lib/otb )
include(${OTB_USE_FILE})
SET(BUILD_SHARED_LIBS ${OTB_BUILD_SHARED_LIBS})
set(BUILD_SHARED_LIBS ${OTB_BUILD_SHARED_LIBS})
ADD_SUBDIRECTORY(Code)
ADD_SUBDIRECTORY(Example)
add_subdirectory(Code)
add_subdirectory(Example)
# Enable / Disable testing
OPTION(BUILD_TESTING "Build testing." OFF)
INCLUDE(${CMAKE_ROOT}/Modules/Dart.cmake)
MARK_AS_ADVANCED(TCL_TCLSH DART_ROOT)
IF(BUILD_TESTING)
ENABLE_TESTING()
# configure the test driver
FIND_PROGRAM(OTB_TEST_DRIVER otbTestDriver PATHS ${OTB_DIR}/bin ${OTB_DIR}/../../bin DOC "Path to the otbTestDriver executable from OTB")
FIND_PATH(OTB_DATA_ROOT README-OTB-Data PATHS $ENV{OTB_DATA_ROOT} ${OTB_SOURCE_DIR}/../OTB-Data)
MARK_AS_ADVANCED(OTB_DATA_ROOT)
SET(BUILDNAME "${BUILDNAME}" CACHE STRING "Name of build on the dashboard")
MARK_AS_ADVANCED(BUILDNAME)
ADD_SUBDIRECTORY(Testing)
ENDIF(BUILD_TESTING)
option(BUILD_TESTING "Build testing." OFF)
include(${CMAKE_ROOT}/Modules/Dart.cmake)
mark_as_advanced(TCL_TCLSH DART_ROOT)
if(BUILD_TESTING)
enable_testing()
find_program(OTB_TEST_DRIVER otbTestDriver PATHS ${OTB_DIR}/bin ${OTB_DIR}/../../bin DOC "Path to the otbTestDriver executable from OTB")
find_path(OTB_DATA_ROOT README-OTB-Data PATHS $ENV{OTB_DATA_ROOT} ${OTB_SOURCE_DIR}/../OTB-Data)
mark_as_advanced(OTB_DATA_ROOT)
set(BUILDNAME "${BUILDNAME}" CACHE STRING "Name of build on the dashboard")
mark_as_advanced(BUILDNAME)
add_subdirectory(Testing)
endif(BUILD_TESTING)
......@@ -2,8 +2,8 @@
## Then modify the CMakeLists.txt file in the root directory of your
## project to incorporate the testing dashboard.
## # The following are required to uses Dart and the Cdash dashboard
## ENABLE_TESTING()
## INCLUDE(Dart)
## enable_testing()
## include(Dart)
set(CTEST_PROJECT_NAME "OTB-Wrapper")
set(CTEST_NIGHTLY_START_TIME "20:00:00 CEST")
......
ADD_SUBDIRECTORY(Core)
ADD_SUBDIRECTORY(Wrappers)
add_subdirectory(Core)
add_subdirectory(Wrappers)
FILE(GLOB srcs "*.cxx")
file(GLOB srcs "*.cxx")
ADD_LIBRARY(OTBWrapperCore ${srcs})
TARGET_LINK_LIBRARIES(OTBWrapperCore OTBCommon OTBIO)
add_library(OTBWrapperCore ${srcs})
target_link_libraries(OTBWrapperCore OTBCommon OTBIO)
INCLUDE_DIRECTORIES(${QT_INCLUDE_DIRS})
INCLUDE_DIRECTORIES(../QtWidget)
include_directories(${QT_INCLUDE_DIRS})
include_directories(../QtWidget)
SET( SRCS
set( SRCS
otbApplicationLauncherQt.cxx )
ADD_EXECUTABLE(otbApplicationLauncherQt ${SRCS})
add_executable(otbApplicationLauncherQt ${SRCS})
TARGET_LINK_LIBRARIES(otbApplicationLauncherQt
target_link_libraries(otbApplicationLauncherQt
OTBWrapperQtWidget
OTBWrapperCore
${QT_LIBRARIES})
INCLUDE_DIRECTORIES(../Core)
include_directories(../Core)
# Generate Qt based GUI
option ( WRAP_QT "Enable Qt wrappers" OFF )
if ( WRAP_QT )
FIND_PACKAGE(Qt4 REQUIRED)
SET(QT_USE_QTXML 1)
INCLUDE(${QT_USE_FILE})
find_package(Qt4 REQUIRED)
set(QT_USE_QTXML 1)
include(${QT_USE_FILE})
add_subdirectory(ApplicationLauncherQt)
add_subdirectory(QtWidget)
......@@ -16,4 +16,4 @@ endif( WRAP_QT )
option ( WRAP_SWIG "Enable SWIG wrappers" OFF )
if ( WRAP_SWIG )
add_subdirectory(SWIG)
endif( WRAP_SWIG )
\ No newline at end of file
endif( WRAP_SWIG )
FILE(GLOB INSTALLER_FILES *.py)
SET(INSTALLER_FILES ${INSTALLER_FILES})
file(GLOB INSTALLER_FILES *.py)
set(INSTALLER_FILES ${INSTALLER_FILES})
ADD_CUSTOM_TARGET(otb ALL)
add_custom_target(otb ALL)
INSTALL(FILES ${INSTALLER_FILES} DESTINATION ${QGIS_DATA_DIR}/python/plugins/otb)
install(FILES ${INSTALLER_FILES} DESTINATION ${QGIS_DATA_DIR}/python/plugins/otb)
INCLUDE_DIRECTORIES(${QT_INCLUDE_DIRS})
FILE(GLOB srcs "*.cxx")
include_directories(${QT_INCLUDE_DIRS})
file(GLOB srcs "*.cxx")
SET( WrappersQtWidget_MOC_HDR
set( WrappersQtWidget_MOC_HDR
otbWrapperQtWidgetEmptyParameter.h
otbWrapperQtWidgetFloatParameter.h
otbWrapperQtWidgetIntParameter.h
......@@ -12,11 +12,11 @@ SET( WrappersQtWidget_MOC_HDR
otbWrapperQtWidgetParameterGroup.h
otbWrapperQtWidgetParameterLabel.h
otbWrapperQtWidgetParameterBase.h
otbWrapperQtWidgetModel.h
otbWrapperQtWidgetView.h
otbWrapperQtWidgetModel.h
otbWrapperQtWidgetView.h
)
QT4_WRAP_CPP(WrappersQtWidget_MOC_SRC ${WrappersQtWidget_MOC_HDR})
ADD_LIBRARY(OTBWrapperQtWidget ${srcs} ${WrappersQtWidget_MOC_SRC})
TARGET_LINK_LIBRARIES(OTBWrapperQtWidget OTBCommon OTBIO OTBWrapperCore ${QT_LIBRARIES})
add_library(OTBWrapperQtWidget ${srcs} ${WrappersQtWidget_MOC_SRC})
target_link_libraries(OTBWrapperQtWidget OTBCommon OTBIO OTBWrapperCore ${QT_LIBRARIES})
......@@ -76,7 +76,7 @@ if ( WRAP_LUA OR WRAP_PYTHON OR WRAP_JAVA OR WRAP_CSHARP OR WRAP_TCL OR WRAP_R O
)
set ( SWIG_MODULE_otbApplication_EXTRA_DEPS ${SWIG_HEADERS} )
include_directories ( ${CMAKE_CURRENT_SOURCE_DIR} )
endif()
......
SET(TEMP ${CMAKE_BINARY_DIR}/Testing/Temporary)
FILE(MAKE_DIRECTORY ${TEMP})
set(TEMP ${CMAKE_BINARY_DIR}/Testing/Temporary)
file(MAKE_DIRECTORY ${TEMP})
add_subdirectory(Core)
......
SET(CXX_TEST_PATH ${EXECUTABLE_OUTPUT_PATH})
set(CXX_TEST_PATH ${EXECUTABLE_OUTPUT_PATH})
IF(WIN32)
ADD_DEFINITIONS(-DWIN32)
ENDIF(WIN32)
if(WIN32)
add_definitions(-DWIN32)
endif(WIN32)
SET(OTB_WRAPPER_TESTS ${CXX_TEST_PATH}/otbWrapperTests)
set(OTB_WRAPPER_TESTS ${CXX_TEST_PATH}/otbWrapperTests)
ADD_TEST(owTuParameterNew ${OTB_WRAPPER_TESTS}
add_test(owTuParameterNew ${OTB_WRAPPER_TESTS}
otbWrapperParameterNew
)
ADD_TEST(owTvParameter ${OTB_WRAPPER_TESTS}
add_test(owTvParameter ${OTB_WRAPPER_TESTS}
otbWrapperParameterTest1
"param1"
)
# NumericalParameter class test
ADD_TEST(owTuNumericalParameter ${OTB_WRAPPER_TESTS}
add_test(owTuNumericalParameter ${OTB_WRAPPER_TESTS}
otbWrapperNumericalParameterNew
)
)
# EmptyParameter class test
ADD_TEST(owTuEmptyParameter ${OTB_WRAPPER_TESTS}
add_test(owTuEmptyParameter ${OTB_WRAPPER_TESTS}
otbWrapperEmptyParameterNew
)
# NumericalParameter class test
ADD_TEST(owTuNumericalParameter ${OTB_WRAPPER_TESTS}
add_test(owTuNumericalParameter ${OTB_WRAPPER_TESTS}
otbWrapperNumericalParameterNew
)
ADD_TEST(owTvNumericalParameter ${OTB_WRAPPER_TESTS}
add_test(owTvNumericalParameter ${OTB_WRAPPER_TESTS}
otbWrapperNumericalParameterTest1
42.42
"mykey"
......@@ -40,28 +40,28 @@ ADD_TEST(owTvNumericalParameter ${OTB_WRAPPER_TESTS}
)
# Input Image parameter class test
ADD_TEST(owTuInputImageParameter ${OTB_WRAPPER_TESTS}
add_test(owTuInputImageParameter ${OTB_WRAPPER_TESTS}
otbWrapperInputImageParameterNew
)
# Input VectorData parameter class test
ADD_TEST(owTuInputVectorDataParameter ${OTB_WRAPPER_TESTS}
add_test(owTuInputVectorDataParameter ${OTB_WRAPPER_TESTS}
otbWrapperInputVectorDataParameterNew
)
# Application class test
ADD_TEST(owTuApplication ${OTB_WRAPPER_TESTS}
add_test(owTuApplication ${OTB_WRAPPER_TESTS}
otbWrapperApplicationNew
)
# Application class test
ADD_TEST(owTvApplicationRegistry ${OTB_WRAPPER_TESTS}
add_test(owTvApplicationRegistry ${OTB_WRAPPER_TESTS}
otbWrapperApplicationRegistry
)
# ----------------Source files CXX -----------------------------------
SET(Wrapper_SRCS
set(Wrapper_SRCS
otbWrapperCoreTests.cxx
otbWrapperApplicationTest.cxx
......@@ -76,6 +76,6 @@ otbWrapperParameterTest.cxx
otbWrapperApplicationRegistryTest.cxx
)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/Code/Core)
ADD_EXECUTABLE(otbWrapperTests ${Wrapper_SRCS})
TARGET_LINK_LIBRARIES(otbWrapperTests OTBIO OTBCommon ITKIO ITKCommon OTBTesting OTBWrapperCore)
include_directories(${CMAKE_SOURCE_DIR}/Code/Core)
add_executable(otbWrapperTests ${Wrapper_SRCS})
target_link_libraries(otbWrapperTests OTBIO OTBCommon ITKIO ITKCommon OTBTesting OTBWrapperCore)
include( UseJava )
SET(TEST_DRIVER "${OTB_TEST_DRIVER}"
set(TEST_DRIVER "${OTB_TEST_DRIVER}"
--add-before-env ITK_AUTOLOAD_PATH "${CMAKE_BINARY_DIR}/Example"
)
......
SET(TEST_DRIVER "${OTB_TEST_DRIVER}"
--add-before-env LD_LIBRARY_PATH "${CMAKE_BINARY_DIR}/Code/Wrappers/SWIG"
set(TEST_DRIVER "${OTB_TEST_DRIVER}"
--add-before-env LD_LIBRARY_PATH "${CMAKE_BINARY_DIR}/Code/Wrappers/SWIG"
--add-before-env ITK_AUTOLOAD_PATH "${CMAKE_BINARY_DIR}/Example"
)
ADD_TEST( NAME luTvSmoothing
add_test( NAME luTvSmoothing
COMMAND ${TEST_DRIVER} Execute
${CMAKE_BINARY_DIR}/Code/Wrappers/SWIG/otbApplicationLua
${CMAKE_CURRENT_SOURCE_DIR}/LuaSmoothingTest.lua
......
SET(TEST_DRIVER "${OTB_TEST_DRIVER}"
--add-before-env PYTHONPATH "${CMAKE_BINARY_DIR}/Code/Wrappers/SWIG"
set(TEST_DRIVER "${OTB_TEST_DRIVER}"
--add-before-env PYTHONPATH "${CMAKE_BINARY_DIR}/Code/Wrappers/SWIG"
--add-before-env ITK_AUTOLOAD_PATH "${CMAKE_BINARY_DIR}/Example"
)
ADD_TEST( NAME pyTvSmoothing
add_test( NAME pyTvSmoothing
COMMAND ${TEST_DRIVER} Execute
${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/PythonSmoothingTest.py
${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/PythonSmoothingTest.py
${OTB_DATA_ROOT}/Input/ToulouseExtract_WithGeom.tif
${TEMP}/pyTvSmoothing_ )
FIND_PACKAGE(Qt4 REQUIRED)
SET(QT_USE_QTXML 1)
INCLUDE(${QT_USE_FILE})
find_package(Qt4 REQUIRED)
set(QT_USE_QTXML 1)
include(${QT_USE_FILE})
SET(CXX_TEST_PATH ${EXECUTABLE_OUTPUT_PATH})
set(CXX_TEST_PATH ${EXECUTABLE_OUTPUT_PATH})
SET(OTB_WRAPPER_QTWIDGET_TESTS ${CXX_TEST_PATH}/otbWrapperQtWidgetTests)
set(OTB_WRAPPER_QTWIDGET_TESTS ${CXX_TEST_PATH}/otbWrapperQtWidgetTests)
SET(WrapperQtWidget_SRCS
set(WrapperQtWidget_SRCS
otbWrapperQtWidgetTests.cxx
otbWrapperQtWidgetParameterFactory.cxx)
INCLUDE_DIRECTORIES(${QT_INCLUDE_DIRS})
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/Code/Core)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/Code/Wrappers/QtWidget)
include_directories(${QT_INCLUDE_DIRS})
include_directories(${CMAKE_SOURCE_DIR}/Code/Core)
include_directories(${CMAKE_SOURCE_DIR}/Code/Wrappers/QtWidget)
ADD_EXECUTABLE(otbWrapperQtWidgetTests ${WrapperQtWidget_SRCS})
TARGET_LINK_LIBRARIES(otbWrapperQtWidgetTests
add_executable(otbWrapperQtWidgetTests ${WrapperQtWidget_SRCS})
target_link_libraries(otbWrapperQtWidgetTests
OTBIO
OTBCommon
OTBTesting
OTBWrapperCore
OTBWrapperQtWidget)
ADD_TEST(owTvQtWidgetParameterFactory ${OTB_WRAPPER_QTWIDGET_TESTS}
add_test(owTvQtWidgetParameterFactory ${OTB_WRAPPER_QTWIDGET_TESTS}
otbWrapperQtWidgetParameterFactory)
ADD_TEST(owTvQtWidgetParameterGroup ${OTB_WRAPPER_QTWIDGET_TESTS}
add_test(owTvQtWidgetParameterGroup ${OTB_WRAPPER_QTWIDGET_TESTS}
otbWrapperQtWidgetParameterGroup)
SET(TEST_DRIVER "${OTB_TEST_DRIVER}"
--add-before-env LD_LIBRARY_PATH "${CMAKE_BINARY_DIR}/Code/Wrappers/SWIG"
set(TEST_DRIVER "${OTB_TEST_DRIVER}"
--add-before-env LD_LIBRARY_PATH "${CMAKE_BINARY_DIR}/Code/Wrappers/SWIG"
--add-before-env ITK_AUTOLOAD_PATH "${CMAKE_BINARY_DIR}/Example"
)
ADD_TEST( NAME rbTvSmoothing
add_test( NAME rbTvSmoothing
COMMAND ${TEST_DRIVER} Execute
${RUBY_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/RubySmoothingTest.rb
${OTB_DATA_ROOT}/Input/ToulouseExtract_WithGeom.tif
......
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