Commit 832ee75c authored by Thomas Feuvrier's avatar Thomas Feuvrier

ENH: Add developpers cmake options (OTB_COMPILE_WITH_FULL_WARNING) activate full warning

parent a75fe627
......@@ -752,6 +752,17 @@ MARK_AS_ADVANCED(OTB_SHOW_ALL_MSG_DEBUG)
# ADD_DEFINITIONS(-DOTB_SHOW_ALL_MSG_DEBUG)
# ENDIF( OTB_SHOW_ALL_MSG_DEBUG )
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 -pedantic -Wuninitialized -Wparentheses -Wsign-compare -Wunknown-pragmas -Wswitch -Wdiv-by-zero" 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)
#-----------------------------------------------------------------------------
# Advanced option to avoid recompiling utilities at each cmake reconfiguration
OPTION(OTB_DISABLE_UTILITIES_COMPILATION "Disable utilities compilation (developpers only - use at you own risk)" OFF)
......
......@@ -22,3 +22,10 @@ ENDIF(OTB_USE_VISU_GUI)
IF(OTB_USE_PQXX)
SUBDIRS(GeospatialAnalysis)
ENDIF(OTB_USE_PQXX)
IF(OTB_COMPILE_WITH_FULL_WARNING)
IF(CMAKE_COMPILER_IS_GNUCXX)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OTB_FULL_WARNING_LIST_PARAMETERS}")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OTB_FULL_WARNING_LIST_PARAMETERS}")
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
ENDIF(OTB_COMPILE_WITH_FULL_WARNING)
......@@ -40,3 +40,10 @@ ELSE(OTB_BINARY_DIR)
MESSAGE("OTB not found. Please set OTB_DIR")
ENDIF(OTB_FOUND)
ENDIF(OTB_BINARY_DIR)
IF(OTB_COMPILE_WITH_FULL_WARNING)
IF(CMAKE_COMPILER_IS_GNUCXX)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OTB_FULL_WARNING_LIST_PARAMETERS}")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OTB_FULL_WARNING_LIST_PARAMETERS}")
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
ENDIF(OTB_COMPILE_WITH_FULL_WARNING)
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