diff --git a/CMake/OTBSetStandardCompilerFlags.cmake b/CMake/OTBSetStandardCompilerFlags.cmake index 6a7cad037a8930553b177ba94e29e87a9079cc1d..a9f4e19d67ed6fff03aefd4015f2ec3ada4dd976 100644 --- a/CMake/OTBSetStandardCompilerFlags.cmake +++ b/CMake/OTBSetStandardCompilerFlags.cmake @@ -57,6 +57,8 @@ function(check_c_compiler_warning_flags c_flag_var) set(local_c_flags "") set(flag_list "${ARGN}") foreach(flag IN LISTS flag_list) +# This could be replaced by a simple check_c_compiler_flag(<flag> <var>) +# https://cmake.org/cmake/help/v3.10/module/CheckCCompilerFlag.html?highlight=flags OTB_CHECK_C_COMPILER_FLAG(${flag} C_HAS_WARNING${flag}) if(${C_HAS_WARNING${flag}}) set(local_c_flags "${local_c_flags} ${flag}") @@ -70,6 +72,8 @@ function(check_cxx_compiler_warning_flags cxx_flag_var) set(local_cxx_flags "") set(flag_list "${ARGN}") foreach(flag IN LISTS flag_list) +# This could be replaced by a simple check_cxx_compiler_flag(<flag> <var>) +# https://cmake.org/cmake/help/v3.10/module/CheckCXXCompilerFlag.html?highlight=checkcxxcompilerflag OTB_CHECK_CXX_COMPILER_FLAG(${flag} CXX_HAS_WARNING${flag}) if(${CXX_HAS_WARNING${flag}}) set(local_cxx_flags "${local_cxx_flags} ${flag}") @@ -215,6 +219,8 @@ macro(check_compiler_platform_flags) # BUILD_SHARED_LIBS works as it would on other systems if(NOT CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS) if(BUILD_SHARED_LIBS) + # TODO: + # OTB_LIBRARY_BUILD_TYPE is never used! set(OTB_LIBRARY_BUILD_TYPE "SHARED") else() set(OTB_LIBRARY_BUILD_TYPE "STATIC") @@ -295,6 +301,8 @@ macro(check_compiler_platform_flags) if(OTB_USE_SSE_FLAGS) message(STATUS "SIMD extensions requested with OTB_USE_SSE_FLAGS=${OTB_USE_SSE_FLAGS}") include(OTBCheckSSEFeatures) +# This should be deleted as it can be done with cmake_host_system_information +# https://cmake.org/cmake/help/v3.10/command/cmake_host_system_information.html?highlight=sse check_sse_features(OTB_SSE_FLAGS) if(OTB_SSE_FLAGS) message(STATUS "Adding '${OTB_SSE_FLAGS}' to OTB_REQUIRED_CXX_FLAGS") diff --git a/CMake/OTB_CheckCCompilerFlag.cmake b/CMake/OTB_CheckCCompilerFlag.cmake index 3cb206423609e77b802e4bd442126295a4541f2f..246cbcf258f3df2c99367f9dcfd53d2f6ff2d3c6 100644 --- a/CMake/OTB_CheckCCompilerFlag.cmake +++ b/CMake/OTB_CheckCCompilerFlag.cmake @@ -22,6 +22,8 @@ include(CheckCSourceCompiles) +# This could be replaced by a simple check_c_compiler_flag(<flag> <var>) +# https://cmake.org/cmake/help/v3.10/module/CheckCCompilerFlag.html?highlight=flags macro (OTB_CHECK_C_COMPILER_FLAG _FLAG _RESULT) set(SAFE_CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS}") set(CMAKE_REQUIRED_DEFINITIONS "${_FLAG}") diff --git a/CMake/OTB_CheckCXXCompilerFlag.cmake b/CMake/OTB_CheckCXXCompilerFlag.cmake index d7eb1260a11357f31f93ecd5c917a2c64748e9ce..26114bd0f2add75b77e3714f7129add67a842ec4 100644 --- a/CMake/OTB_CheckCXXCompilerFlag.cmake +++ b/CMake/OTB_CheckCXXCompilerFlag.cmake @@ -42,6 +42,8 @@ include(CheckCXXSourceCompiles) +# This could be replaced by a simple check_cxx_compiler_flag(<flag> <var>) +# https://cmake.org/cmake/help/v3.10/module/CheckCXXCompilerFlag.html?highlight=checkcxxcompilerflag macro (OTB_CHECK_CXX_COMPILER_FLAG _FLAG _RESULT) set(SAFE_CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS}") set(CMAKE_REQUIRED_DEFINITIONS "${_FLAG}")