Commit c89f9a38 authored by Julien Malik's avatar Julien Malik

STYLE: switch all CMake files to lower case format

This modification is based according to
the process described in ITK/Utilities/Maintenance/HowToCreateTheCMakeCaseConversion.txt
parent fc0becc1
......@@ -5,7 +5,7 @@ OTB_CREATE_APPLICATION(NAME ComputePolylineFeatureFromImage
OTB_CREATE_APPLICATION(NAME DSFuzzyModelEstimation
SOURCES otbDSFuzzyModelEstimation.cxx
LINK_LIBRARIES OTBIO OTBFeatureExtraction OTBFuzzy)
OTB_CREATE_APPLICATION(NAME VectorDataDSValidation
SOURCES otbVectorDataDSValidation.cxx
LINK_LIBRARIES OTBIO OTBFeatureExtraction OTBFuzzy)
......@@ -25,8 +25,8 @@ OTB_CREATE_APPLICATION(NAME ClassificationMapRegularization
set( TrainImagesClassifier_SRC otbTrainImagesClassifier.cxx otbTrainLibSVM.cxx )
if(OTB_USE_OPENCV)
# Add source files with OpenCV dependency
set( TrainImagesClassifier_SRC ${TrainImagesClassifier_SRC}
otbTrainSVM.cxx otbTrainBoost.cxx
set( TrainImagesClassifier_SRC ${TrainImagesClassifier_SRC}
otbTrainSVM.cxx otbTrainBoost.cxx
otbTrainDecisionTree.cxx otbTrainGradientBoostedTree.cxx
otbTrainNeuralNetwork.cxx otbTrainNormalBayes.cxx
otbTrainRandomForests.cxx otbTrainKNN.cxx )
......@@ -41,4 +41,4 @@ OTB_CREATE_APPLICATION(NAME ImageClassifier
LINK_LIBRARIES OTBIO;OTBCommon;OTBBasicFilters;OTBFeatureExtraction;OTBLearning)
......@@ -2,11 +2,11 @@
OTB_CREATE_APPLICATION(NAME LineSegmentDetection
SOURCES otbLineSegmentDetection.cxx
LINK_LIBRARIES OTBIO;OTBCommon;OTBBasicFilters)
OTB_CREATE_APPLICATION(NAME RadiometricIndices
SOURCES otbRadiometricIndices.cxx
LINK_LIBRARIES OTBIO;OTBRadiometry)
OTB_CREATE_APPLICATION(NAME HaralickTextureExtraction
SOURCES otbHaralickTextureExtraction.cxx
LINK_LIBRARIES OTBIO;OTBCommon;OTBBasicFilters)
......@@ -14,7 +14,7 @@ OTB_CREATE_APPLICATION(NAME HaralickTextureExtraction
OTB_CREATE_APPLICATION(NAME HomologousPointsExtraction
SOURCES otbHomologousPointsExtraction.cxx
LINK_LIBRARIES OTBIO;OTBCommon;OTBBasicFilters;OTBFeatureExtraction)
OTB_CREATE_APPLICATION(NAME SFSTextureExtraction
SOURCES otbSFSTextureExtraction.cxx
LINK_LIBRARIES OTBIO;OTBCommon;OTBBasicFilters)
......@@ -30,7 +30,7 @@ OTB_CREATE_APPLICATION(NAME GrayScaleMorphologicalOperation
OTB_CREATE_APPLICATION(NAME LocalStatisticExtraction
SOURCES otbLocalStatisticExtraction.cxx
LINK_LIBRARIES OTBIO;OTBCommon;OTBBasicFilters;OTBFeatureExtraction)
OTB_CREATE_APPLICATION(NAME EdgeExtraction
SOURCES otbEdgeExtraction.cxx
LINK_LIBRARIES OTBIO;OTBCommon;OTBBasicFilters;OTBFeatureExtraction)
......
......@@ -30,11 +30,11 @@ OTB_CREATE_APPLICATION(NAME ObtainUTMZoneFromGeoPoint
OTB_CREATE_APPLICATION(NAME ConvertSensorToGeoPoint
SOURCES otbConvertSensorToGeoPoint.cxx
LINK_LIBRARIES OTBBasicFilters)
OTB_CREATE_APPLICATION(NAME GridBasedImageResampling
SOURCES otbGridBasedImageResampling.cxx
LINK_LIBRARIES OTBBasicFilters)
OTB_CREATE_APPLICATION(NAME VectorDataReprojection
SOURCES otbVectorDataReprojection.cxx
LINK_LIBRARIES OTBBasicFilters;OTBIO;OTBOGRAdapters;OTBProjections)
......
......@@ -17,12 +17,12 @@
#
#----------------------------------------------------------------------
SET(CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE 1000000)
SET(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS 300)
SET(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS 50)
set(CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE 1000000)
set(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS 300)
set(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS 50)
SET(CTEST_CUSTOM_COVERAGE_EXCLUDE
set(CTEST_CUSTOM_COVERAGE_EXCLUDE
${CTEST_CUSTOM_COVERAGE_EXCLUDE}
# Exclude try_compile sources from coverage results:
......@@ -34,7 +34,7 @@ SET(CTEST_CUSTOM_COVERAGE_EXCLUDE
# Exclude files from the ThirdParty Utilities directories
".*/Testing/Utilities/.*"
".*/Utilities/.*"
# Exclude SWIG wrappers files
".*/Code/Wrappers/SWIG/otbApplicationPYTHON_wrap.*"
".*/Code/Wrappers/SWIG/otbApplicationJAVA_wrap.*"
......@@ -43,7 +43,7 @@ SET(CTEST_CUSTOM_COVERAGE_EXCLUDE
".*moc_.*"
)
SET(CTEST_CUSTOM_WARNING_EXCEPTION
set(CTEST_CUSTOM_WARNING_EXCEPTION
${CTEST_CUSTOM_WARNING_EXCEPTION}
"vcl_deprecated_header"
"backward_warning"
......@@ -64,5 +64,5 @@ SET(CTEST_CUSTOM_WARNING_EXCEPTION
# Ignore clang's summary warning, assuming prior text has matched some
# other warning expression:
"[0-9,]+ warnings? generated."
)
......@@ -6,24 +6,24 @@
# VARIABLE - variable to store the result to
#
MACRO(CHECK_BIG_BITFIELD VARIABLE LOCAL_TEST_DIR)
IF("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$")
MESSAGE(STATUS "Checking to see if this platform supports large bit-fields (>32 bits)")
TRY_RUN(DUMMY ${VARIABLE}
macro(CHECK_BIG_BITFIELD VARIABLE LOCAL_TEST_DIR)
if("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$")
message(STATUS "Checking to see if this platform supports large bit-fields (>32 bits)")
try_run(DUMMY ${VARIABLE}
${CMAKE_BINARY_DIR}
${LOCAL_TEST_DIR}/CheckBigBitfield.c
OUTPUT_VARIABLE OUTPUT)
IF(${VARIABLE})
SET(HAVE_${VARIABLE} TRUE CACHE INTERNAL " ")
MESSAGE(STATUS "Checking to see if this platform supports large bit-fields (>32 bits) - yes")
FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeOutput.log
if(${VARIABLE})
set(HAVE_${VARIABLE} TRUE CACHE INTERNAL " ")
message(STATUS "Checking to see if this platform supports large bit-fields (>32 bits) - yes")
file(APPEND ${CMAKE_BINARY_DIR}/CMakeOutput.log
"Checking to see if this platform supports large bit-fields (>32 bits) passed with "
"the following output:\n${OUTPUT}\n\n")
ELSE(${VARIABLE})
MESSAGE(STATUS "Checking to see if this platform supports large bit-fields (>32 bits) - no")
FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeError.log
else(${VARIABLE})
message(STATUS "Checking to see if this platform supports large bit-fields (>32 bits) - no")
file(APPEND ${CMAKE_BINARY_DIR}/CMakeError.log
"Checking to see if this platform supports large bit-fields (>32 bits) failed with "
"the following output:\n${OUTPUT}\n\n")
ENDIF(${VARIABLE})
ENDIF("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$")
ENDMACRO(CHECK_BIG_BITFIELD)
endif(${VARIABLE})
endif("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$")
endmacro(CHECK_BIG_BITFIELD)
......@@ -4,27 +4,27 @@
# VARIABLE - variable to store the result to
#
MACRO(CHECK_CPP_DIRECTIVE_EXISTS DIRECTIVE VARIABLE)
IF("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$")
MESSAGE(STATUS "Checking to see if this platform has the ${DIRECTIVE} C-Preprocessor directive")
SET(DIRECTIVE ${DIRECTIVE})
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/CMake/CheckCPPDirectiveExists.cxx.in
macro(CHECK_CPP_DIRECTIVE_EXISTS DIRECTIVE VARIABLE)
if("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$")
message(STATUS "Checking to see if this platform has the ${DIRECTIVE} C-Preprocessor directive")
set(DIRECTIVE ${DIRECTIVE})
configure_file(${CMAKE_SOURCE_DIR}/CMake/CheckCPPDirectiveExists.cxx.in
${CMAKE_BINARY_DIR}/CMakeTmp/CheckCPPDirectiveExists.cxx IMMEDIATE)
TRY_COMPILE(${VARIABLE}
try_compile(${VARIABLE}
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}/CMakeTmp/CheckCPPDirectiveExists.cxx
OUTPUT_VARIABLE OUTPUT)
IF(${VARIABLE})
SET(HAVE_${VARIABLE} TRUE CACHE INTERNAL " ")
MESSAGE(STATUS "Checking to see if this platform supports has the ${DIRECTIVE} C-Preprocessor directive - yes")
FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeOutput.log
if(${VARIABLE})
set(HAVE_${VARIABLE} TRUE CACHE INTERNAL " ")
message(STATUS "Checking to see if this platform supports has the ${DIRECTIVE} C-Preprocessor directive - yes")
file(APPEND ${CMAKE_BINARY_DIR}/CMakeOutput.log
"Checking to see if this platform supports has the ${DIRECTIVE} C-Preprocessor directive with "
"the following output:\n${OUTPUT}\n\n")
ELSE(${VARIABLE})
MESSAGE(STATUS "Checking to see if this platform supports has the ${DIRECTIVE} C-Preprocessor directive - no")
FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeError.log
else(${VARIABLE})
message(STATUS "Checking to see if this platform supports has the ${DIRECTIVE} C-Preprocessor directive - no")
file(APPEND ${CMAKE_BINARY_DIR}/CMakeError.log
"Checking to see if this platform supports has the ${DIRECTIVE} C-Preprocessor directive with "
"the following output:\n${OUTPUT}\n\n")
ENDIF(${VARIABLE})
ENDIF("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$")
ENDMACRO(CHECK_CPP_DIRECTIVE_EXISTS)
endif(${VARIABLE})
endif("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$")
endmacro(CHECK_CPP_DIRECTIVE_EXISTS)
......@@ -3,25 +3,25 @@
# - SOURCE_FILE parameter specifies a file name
# - ARGUMENT parameter specifies a runtime argument
MACRO(CHECK_CXX_SOURCE_RUNS_ARGS SOURCE_FILE ARGUMENT VAR)
IF("${VAR}" MATCHES "^${VAR}$")
SET(MACRO_CHECK_FUNCTION_DEFINITIONS
macro(CHECK_CXX_SOURCE_RUNS_ARGS SOURCE_FILE ARGUMENT VAR)
if("${VAR}" MATCHES "^${VAR}$")
set(MACRO_CHECK_FUNCTION_DEFINITIONS
"-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
IF(CMAKE_REQUIRED_LIBRARIES)
SET(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES
if(CMAKE_REQUIRED_LIBRARIES)
set(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES
"-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
ELSE(CMAKE_REQUIRED_LIBRARIES)
SET(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES)
ENDIF(CMAKE_REQUIRED_LIBRARIES)
IF(CMAKE_REQUIRED_INCLUDES)
SET(CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES
else(CMAKE_REQUIRED_LIBRARIES)
set(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES)
endif(CMAKE_REQUIRED_LIBRARIES)
if(CMAKE_REQUIRED_INCLUDES)
set(CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES
"-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
ELSE(CMAKE_REQUIRED_INCLUDES)
SET(CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES)
ENDIF(CMAKE_REQUIRED_INCLUDES)
else(CMAKE_REQUIRED_INCLUDES)
set(CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES)
endif(CMAKE_REQUIRED_INCLUDES)
MESSAGE(STATUS "Performing Test ${VAR}")
TRY_RUN(${VAR}_EXITCODE ${VAR}_COMPILED
message(STATUS "Performing Test ${VAR}")
try_run(${VAR}_EXITCODE ${VAR}_COMPILED
${CMAKE_BINARY_DIR}
${SOURCE_FILE}
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
......@@ -33,33 +33,33 @@ MACRO(CHECK_CXX_SOURCE_RUNS_ARGS SOURCE_FILE ARGUMENT VAR)
ARGS "\"${ARGUMENT}\"")
# if it did not compile make the return value fail code of 1
IF(NOT ${VAR}_COMPILED)
SET(${VAR}_EXITCODE 1)
ENDIF(NOT ${VAR}_COMPILED)
if(NOT ${VAR}_COMPILED)
set(${VAR}_EXITCODE 1)
endif(NOT ${VAR}_COMPILED)
# if the return value was 0 then it worked
IF("${${VAR}_EXITCODE}" EQUAL 0)
SET(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
MESSAGE(STATUS "Performing Test ${VAR} - Success")
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
if("${${VAR}_EXITCODE}" EQUAL 0)
set(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
message(STATUS "Performing Test ${VAR} - Success")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Performing C++ SOURCE FILE Test ${VAR} succeded with the following output:\n"
"${OUTPUT}\n"
"${OUTPUT}\n"
"Return value: ${${VAR}}\n"
"Argument: ${ARGUMENT}\n"
"Source file was: ${SOURCE_FILE}\n\n")
ELSE("${${VAR}_EXITCODE}" EQUAL 0)
IF(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES "FAILED_TO_RUN")
SET(${VAR} "${${VAR}_EXITCODE}")
ELSE(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES "FAILED_TO_RUN")
SET(${VAR} "" CACHE INTERNAL "Test ${VAR}")
ENDIF(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES "FAILED_TO_RUN")
else("${${VAR}_EXITCODE}" EQUAL 0)
if(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES "FAILED_TO_RUN")
set(${VAR} "${${VAR}_EXITCODE}")
else(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES "FAILED_TO_RUN")
set(${VAR} "" CACHE INTERNAL "Test ${VAR}")
endif(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES "FAILED_TO_RUN")
MESSAGE(STATUS "Performing Test ${VAR} - Failed")
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
message(STATUS "Performing Test ${VAR} - Failed")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Performing C++ SOURCE FILE Test ${VAR} failed with the following output:\n"
"${OUTPUT}\n"
"${OUTPUT}\n"
"Return value: ${${VAR}_EXITCODE}\n"
"Argument: ${ARGUMENT}\n"
"Source file was: ${SOURCE_FILE}\n\n")
ENDIF("${${VAR}_EXITCODE}" EQUAL 0)
ENDIF("${VAR}" MATCHES "^${VAR}$")
ENDMACRO(CHECK_CXX_SOURCE_RUNS_ARGS)
endif("${${VAR}_EXITCODE}" EQUAL 0)
endif("${VAR}" MATCHES "^${VAR}$")
endmacro(CHECK_CXX_SOURCE_RUNS_ARGS)
# This file contains the common build definitions and flags used by default when building all targets
IF(WIN32)
if(WIN32)
# do not build shared lib under windows
SET(BUILD_SHARED_LIBS OFF)
MESSAGE(STATUS "Disabling build shared lib option on windows like OS.")
ELSE(WIN32)
set(BUILD_SHARED_LIBS OFF)
message(STATUS "Disabling build shared lib option on windows like OS.")
else(WIN32)
# on other systems, leave the choice to the user
OPTION(BUILD_SHARED_LIBS "Build OTB with shared libraries." ON)
ENDIF(WIN32)
option(BUILD_SHARED_LIBS "Build OTB with shared libraries." ON)
endif(WIN32)
SET(OTB_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})
set(OTB_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})
# On Visual Studio 8 MS deprecated C. This removes all 1.276E1265 security
# warnings
IF(WIN32)
IF(NOT CYGWIN)
IF(NOT MINGW)
IF(NOT ITK_ENABLE_VISUAL_STUDIO_DEPRECATED_C_WARNINGS)
ADD_DEFINITIONS(
if(WIN32)
if(NOT CYGWIN)
if(NOT MINGW)
if(NOT ITK_ENABLE_VISUAL_STUDIO_DEPRECATED_C_WARNINGS)
add_definitions(
-D_CRT_FAR_MAPPINGS_NO_DEPRECATE
-D_CRT_IS_WCTYPE_NO_DEPRECATE
-D_CRT_MANAGED_FP_NO_DEPRECATE
......@@ -29,25 +29,25 @@ IF(WIN32)
-D_CRT_VCCLRIT_NO_DEPRECATE
-D_SCL_SECURE_NO_DEPRECATE
)
ENDIF(NOT ITK_ENABLE_VISUAL_STUDIO_DEPRECATED_C_WARNINGS)
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)
endif(NOT ITK_ENABLE_VISUAL_STUDIO_DEPRECATED_C_WARNINGS)
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)
# __CYGWIN__ must be define for ossim (ex: ossimCommon.h, isnan definition, .. )
#IF(CYGWIN)
# ADD_DEFINITIONS(-D__CYGWIN__)
#ENDIF(CYGWIN)
#if(CYGWIN)
# add_definitions(-D__CYGWIN__)
#endif(CYGWIN)
# Large File Support (> 4Go)
ADD_DEFINITIONS(
add_definitions(
-D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64
-D_LARGEFILE64_SOURCE
......@@ -55,31 +55,31 @@ ADD_DEFINITIONS(
)
# Pedantic mode
SET(OTB_BUILD_PEDANTIC OFF CACHE BOOL
set(OTB_BUILD_PEDANTIC OFF CACHE BOOL
"Choose compilation in pedantic or relaxed mode")
MARK_AS_ADVANCED(OTB_BUILD_PEDANTIC)
mark_as_advanced(OTB_BUILD_PEDANTIC)
IF(OTB_BUILD_PEDANTIC)
IF(WIN32)
IF (MSVC)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
ENDIF(MSVC)
ELSE(WIN32)
IF(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic")
ENDIF(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
ENDIF(WIN32)
ENDIF(OTB_BUILD_PEDANTIC)
if(OTB_BUILD_PEDANTIC)
if(WIN32)
if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
endif(MSVC)
else(WIN32)
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic")
endif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
endif(WIN32)
endif(OTB_BUILD_PEDANTIC)
# Full compilation warning mode
OPTION(OTB_COMPILE_WITH_FULL_WARNING "OTB developers : Compilation with FULL warning (use only for otb developers)." OFF)
MARK_AS_ADVANCED(OTB_COMPILE_WITH_FULL_WARNING)
IF(OTB_COMPILE_WITH_FULL_WARNING)
IF(CMAKE_COMPILER_IS_GNUCXX)
SET(OTB_FULL_WARNING_LIST_PARAMETERS "-Wall -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value -Wunused-variable -Wuninitialized -Wsign-compare -Wparentheses -Wunknown-pragmas -Wswitch" CACHE STRING "List of compilation parameters.")
MARK_AS_ADVANCED(OTB_FULL_WARNING_LIST_PARAMETERS)
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
ENDIF(OTB_COMPILE_WITH_FULL_WARNING)
option(OTB_COMPILE_WITH_FULL_WARNING "OTB developers : Compilation with FULL warning (use only for otb developers)." OFF)
mark_as_advanced(OTB_COMPILE_WITH_FULL_WARNING)
if(OTB_COMPILE_WITH_FULL_WARNING)
if(CMAKE_COMPILER_IS_GNUCXX)
set(OTB_FULL_WARNING_LIST_PARAMETERS "-Wall -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value -Wunused-variable -Wuninitialized -Wsign-compare -Wparentheses -Wunknown-pragmas -Wswitch" CACHE STRING "List of compilation parameters.")
mark_as_advanced(OTB_FULL_WARNING_LIST_PARAMETERS)
endif(CMAKE_COMPILER_IS_GNUCXX)
endif(OTB_COMPILE_WITH_FULL_WARNING)
......@@ -15,59 +15,59 @@
# 1 : a_in > b_in
#
# Written by James Bigler.
MACRO(COMPARE_VERSION_STRINGS a_in b_in result_out)
macro(COMPARE_VERSION_STRINGS a_in b_in result_out)
# Since SEPARATE_ARGUMENTS using ' ' as the separation token,
# replace '.' with ' ' to allow easy tokenization of the string.
STRING(REPLACE "." " " a ${a_in})
STRING(REPLACE "." " " b ${b_in})
SEPARATE_ARGUMENTS(a)
SEPARATE_ARGUMENTS(b)
string(REPLACE "." " " a ${a_in})
string(REPLACE "." " " b ${b_in})
separate_arguments(a)
separate_arguments(b)
# Check the size of each list to see if they are equal.
LIST(LENGTH a a_length)
LIST(LENGTH b b_length)
list(LENGTH a a_length)
list(LENGTH b b_length)
# Pad the shorter list with zeros.
# Note that range needs to be one less than the length as the for
# loop is inclusive (silly CMake).
IF(a_length LESS b_length)
if(a_length LESS b_length)
# a is shorter
SET(shorter a)
MATH(EXPR range "${b_length} - 1")
MATH(EXPR pad_range "${b_length} - ${a_length} - 1")
ELSE(a_length LESS b_length)
set(shorter a)
math(EXPR range "${b_length} - 1")
math(EXPR pad_range "${b_length} - ${a_length} - 1")
else(a_length LESS b_length)
# b is shorter
SET(shorter b)
MATH(EXPR range "${a_length} - 1")
MATH(EXPR pad_range "${a_length} - ${b_length} - 1")
ENDIF(a_length LESS b_length)
set(shorter b)
math(EXPR range "${a_length} - 1")
math(EXPR pad_range "${a_length} - ${b_length} - 1")
endif(a_length LESS b_length)
# PAD out if we need to
IF(NOT pad_range LESS 0)
FOREACH(pad RANGE ${pad_range})
if(NOT pad_range LESS 0)
foreach(pad RANGE ${pad_range})
# Since shorter is an alias for b, we need to get to it by by dereferencing shorter.
LIST(APPEND ${shorter} 0)
ENDFOREACH(pad RANGE ${pad_range})
ENDIF(NOT pad_range LESS 0)
list(APPEND ${shorter} 0)
endforeach(pad RANGE ${pad_range})
endif(NOT pad_range LESS 0)
SET(result 0)
FOREACH(index RANGE ${range})
IF(result EQUAL 0)
set(result 0)
foreach(index RANGE ${range})
if(result EQUAL 0)
# Only continue to compare things as long as they are equal
LIST(GET a ${index} a_version)
LIST(GET b ${index} b_version)
list(GET a ${index} a_version)
list(GET b ${index} b_version)
# LESS
IF(a_version LESS b_version)
SET(result -1)
ENDIF(a_version LESS b_version)
if(a_version LESS b_version)
set(result -1)
endif(a_version LESS b_version)
# GREATER
IF(a_version GREATER b_version)
SET(result 1)
ENDIF(a_version GREATER b_version)
ENDIF(result EQUAL 0)
ENDFOREACH(index)
if(a_version GREATER b_version)
set(result 1)
endif(a_version GREATER b_version)
endif(result EQUAL 0)
endforeach(index)
# Copy out the return result
SET(${result_out} ${result})
ENDMACRO(COMPARE_VERSION_STRINGS)
\ No newline at end of file
set(${result_out} ${result})
endmacro(COMPARE_VERSION_STRINGS)
......@@ -19,20 +19,20 @@
# License text for the above reference.)
# Look for the header file.
FIND_PATH(EXPAT_INCLUDE_DIR NAMES expat.h)
find_path(EXPAT_INCLUDE_DIR NAMES expat.h)
# Look for the library.
FIND_LIBRARY(EXPAT_LIBRARY NAMES expat libexpat)
find_library(EXPAT_LIBRARY NAMES expat libexpat)
# handle the QUIETLY and REQUIRED arguments and set EXPAT_FOUND to TRUE if
# handle the QUIETLY and REQUIRED arguments and set EXPAT_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(EXPAT DEFAULT_MSG EXPAT_LIBRARY EXPAT_INCLUDE_DIR)
# Copy the results to the output variables.
IF(EXPAT_FOUND)
SET(EXPAT_LIBRARIES ${EXPAT_LIBRARY})
SET(EXPAT_INCLUDE_DIRS ${EXPAT_INCLUDE_DIR})
ENDIF(EXPAT_FOUND)
if(EXPAT_FOUND)
set(EXPAT_LIBRARIES ${EXPAT_LIBRARY})
set(EXPAT_INCLUDE_DIRS ${EXPAT_INCLUDE_DIR})
endif(EXPAT_FOUND)
MARK_AS_ADVANCED(EXPAT_INCLUDE_DIR EXPAT_LIBRARY)
mark_as_advanced(EXPAT_INCLUDE_DIR EXPAT_LIBRARY)
This diff is collapsed.
# - Find GNU gettext tools
# This module looks for the GNU gettext tools. This module defines the
# This module looks for the GNU gettext tools. This module defines the
# following values:
# GETTEXT_MSGMERGE_EXECUTABLE: the full path to the msgmerge tool.
# GETTEXT_MSGFMT_EXECUTABLE: the full path to the msgfmt tool.
......@@ -7,8 +7,8 @@
#
# Additionally it provides the following macros:
# GETTEXT_CREATE_TRANSLATIONS ( outputFile [ALL] file1 ... fileN )
# This will create a target "translations" which will convert the
# given input po files into the binary output mo file. If the
# This will create a target "translations" which will convert the
# given input po files into the binary output mo file. If the
# ALL option is used, the translations will also be created when
# building the default target.
......@@ -25,54 +25,54 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
FIND_PROGRAM(GETTEXT_MSGMERGE_EXECUTABLE msgmerge)
find_program(GETTEXT_MSGMERGE_EXECUTABLE msgmerge)
FIND_PROGRAM(GETTEXT_MSGFMT_EXECUTABLE msgfmt)
find_program(GETTEXT_MSGFMT_EXECUTABLE msgfmt)
MACRO(GETTEXT_CREATE_TRANSLATIONS _potFile _firstPoFileArg)
macro(GETTEXT_CREATE_TRANSLATIONS _potFile _firstPoFileArg)
# make it a real variable, so we can modify it here
SET(_firstPoFile "${_firstPoFileArg}")
SET(_gmoFiles)
GET_FILENAME_COMPONENT(_potBasename ${_potFile} NAME_WE)
GET_FILENAME_COMPONENT(_absPotFile ${_potFile} ABSOLUTE)
SET(_addToAll)
IF(${_firstPoFile} STREQUAL "ALL")
SET(_addToAll "ALL")
SET(_firstPoFile)
ENDIF(${_firstPoFile} STREQUAL "ALL")
FOREACH (_currentPoFile ${_firstPoFile} ${ARGN})
GET_FILENAME_COMPONENT(_absFile ${_currentPoFile} ABSOLUTE)
GET_FILENAME_COMPONENT(_abs_PATH ${_absFile} PATH)
GET_FILENAME_COMPONENT(_lang ${_absFile} NAME_WE)
SET(_gmoFile ${CMAKE_CURRENT_BINARY_DIR}/${_lang}.gmo)
ADD_CUSTOM_COMMAND(
OUTPUT ${_gmoFile}
set(_firstPoFile "${_firstPoFileArg}")
set(_gmoFiles)
get_filename_component(_potBasename ${_potFile} NAME_WE)
get_filename_component(_absPotFile ${_potFile} ABSOLUTE)
set(_addToAll)
if(${_firstPoFile} STREQUAL "ALL")
set(_addToAll "ALL")
set(_firstPoFile)
endif(${_firstPoFile} STREQUAL "ALL")
foreach(_currentPoFile ${_firstPoFile} ${ARGN})
get_filename_component(_absFile ${_currentPoFile} ABSOLUTE)