diff --git a/.github/workflows/macos-ustk.yml b/.github/workflows/macos-ustk.yml index beabcfc71f..eeee203e77 100644 --- a/.github/workflows/macos-ustk.yml +++ b/.github/workflows/macos-ustk.yml @@ -42,7 +42,7 @@ jobs: # https://remarkablemark.org/blog/2022/09/25/check-git-branch-exists-in-remote-repository/ run: | git clone --depth 1 https://github.com/lagadic/visp-images ${HOME}/visp-images - echo "VISP_INPUT_IMAGE_PATH=$HOME" >> $GITHUB_ENV + echo "VISP_INPUT_IMAGE_PATH=$HOME/visp-images" >> $GITHUB_ENV echo ${VISP_INPUT_IMAGE_PATH} - name: Clone ustk-dataset diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index da6a0f65ba..24978a0467 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -49,7 +49,7 @@ jobs: # https://remarkablemark.org/blog/2022/09/25/check-git-branch-exists-in-remote-repository/ run: | git clone --depth 1 https://github.com/lagadic/visp-images ${HOME}/visp-images - echo "VISP_INPUT_IMAGE_PATH=$HOME" >> $GITHUB_ENV + echo "VISP_INPUT_IMAGE_PATH=$HOME/visp-images" >> $GITHUB_ENV echo ${VISP_INPUT_IMAGE_PATH} - name: Clone visp_sample @@ -76,7 +76,7 @@ jobs: - name: Run unit tests working-directory: build - run: ctest -j$(sysctl -n hw.logicalcpu) --output-on-failure + run: ctest -j$(sysctl -n hw.logicalcpu) --output-on-failure -V - name: ViSP as 3rdparty with cmake run: | diff --git a/.github/workflows/other-arch.yml b/.github/workflows/other-arch.yml index 11478403c1..e45cab8a58 100644 --- a/.github/workflows/other-arch.yml +++ b/.github/workflows/other-arch.yml @@ -64,7 +64,7 @@ jobs: apt-get update && apt-get install -y libssl-dev libusb-1.0-0-dev pkg-config libgtk-3-dev libglfw3-dev libgl1-mesa-dev libglu1-mesa-dev git clone --depth 1 https://github.com/lagadic/visp-images ${HOME}/visp-images - export VISP_INPUT_IMAGE_PATH=$HOME + export VISP_INPUT_IMAGE_PATH=$HOME/visp-images echo ${VISP_INPUT_IMAGE_PATH} pwd diff --git a/.github/workflows/ubuntu-dep-apt.yml b/.github/workflows/ubuntu-dep-apt.yml index 99dffa743b..df6cbce732 100644 --- a/.github/workflows/ubuntu-dep-apt.yml +++ b/.github/workflows/ubuntu-dep-apt.yml @@ -50,7 +50,7 @@ jobs: # https://remarkablemark.org/blog/2022/09/25/check-git-branch-exists-in-remote-repository/ run: | git clone --depth 1 https://github.com/lagadic/visp-images ${HOME}/visp-images - echo "VISP_INPUT_IMAGE_PATH=$HOME" >> $GITHUB_ENV + echo "VISP_INPUT_IMAGE_PATH=$HOME/visp-images" >> $GITHUB_ENV echo ${VISP_INPUT_IMAGE_PATH} - name: Clone visp_sample diff --git a/.github/workflows/ubuntu-dep-src.yml b/.github/workflows/ubuntu-dep-src.yml index 4f0fc97c16..a4f3ce68b8 100644 --- a/.github/workflows/ubuntu-dep-src.yml +++ b/.github/workflows/ubuntu-dep-src.yml @@ -118,7 +118,7 @@ jobs: # https://remarkablemark.org/blog/2022/09/25/check-git-branch-exists-in-remote-repository/ run: | git clone --depth 1 https://github.com/lagadic/visp-images ${HOME}/visp-images - echo "VISP_INPUT_IMAGE_PATH=$HOME" >> $GITHUB_ENV + echo "VISP_INPUT_IMAGE_PATH=$HOME/visp-images" >> $GITHUB_ENV echo ${VISP_INPUT_IMAGE_PATH} - name: Configure CMake diff --git a/.github/workflows/ubuntu-sanitizers.yml b/.github/workflows/ubuntu-sanitizers.yml index fd77b7bd2b..7f823105af 100644 --- a/.github/workflows/ubuntu-sanitizers.yml +++ b/.github/workflows/ubuntu-sanitizers.yml @@ -47,7 +47,7 @@ jobs: # https://remarkablemark.org/blog/2022/09/25/check-git-branch-exists-in-remote-repository/ run: | git clone --depth 1 https://github.com/lagadic/visp-images ${HOME}/visp-images - echo "VISP_INPUT_IMAGE_PATH=$HOME" >> $GITHUB_ENV + echo "VISP_INPUT_IMAGE_PATH=$HOME/visp-images" >> $GITHUB_ENV echo ${VISP_INPUT_IMAGE_PATH} - name: Configure CMake diff --git a/.github/workflows/ubuntu-ustk.yml b/.github/workflows/ubuntu-ustk.yml index ff25b9f3a9..58f892f24f 100644 --- a/.github/workflows/ubuntu-ustk.yml +++ b/.github/workflows/ubuntu-ustk.yml @@ -48,7 +48,7 @@ jobs: # https://remarkablemark.org/blog/2022/09/25/check-git-branch-exists-in-remote-repository/ run: | git clone --depth 1 https://github.com/lagadic/visp-images ${HOME}/visp-images - echo "VISP_INPUT_IMAGE_PATH=$HOME" >> $GITHUB_ENV + echo "VISP_INPUT_IMAGE_PATH=$HOME/visp-images" >> $GITHUB_ENV echo ${VISP_INPUT_IMAGE_PATH} - name: Clone ustk-dataset diff --git a/.github/workflows/valgrind.yml b/.github/workflows/valgrind.yml index b93a729297..493dee0990 100644 --- a/.github/workflows/valgrind.yml +++ b/.github/workflows/valgrind.yml @@ -36,7 +36,7 @@ jobs: # https://remarkablemark.org/blog/2022/09/25/check-git-branch-exists-in-remote-repository/ run: | git clone --depth 1 https://github.com/lagadic/visp-images ${HOME}/visp-images - echo "VISP_INPUT_IMAGE_PATH=$HOME" >> $GITHUB_ENV + echo "VISP_INPUT_IMAGE_PATH=$HOME/visp-images" >> $GITHUB_ENV echo ${VISP_INPUT_IMAGE_PATH} - name: Configure CMake diff --git a/.github/workflows/windows-clang.yaml b/.github/workflows/windows-clang.yaml new file mode 100644 index 0000000000..7868044bf9 --- /dev/null +++ b/.github/workflows/windows-clang.yaml @@ -0,0 +1,82 @@ +name: Windows - clang +on: + pull_request: + push: + +jobs: + build: + runs-on: ${{ matrix.os }} + defaults: + run: + shell: cmd + strategy: + fail-fast: false + matrix: + name: [windows-latest-clang] + + include: + - name: windows-latest-clang + os: windows-2022 + compiler: clang-cl + + steps: + # https://github.com/marketplace/actions/cancel-workflow-action + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.9.1 + with: + access_token: ${{ github.token }} + + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Display the workspace path + working-directory: ${{ github.workspace }} + run: pwd + + - name: Clone visp-images + shell: bash + # https://remarkablemark.org/blog/2022/09/25/check-git-branch-exists-in-remote-repository/ + run: | + git clone --depth 1 https://github.com/lagadic/visp-images ${HOME}/visp-images + echo "VISP_INPUT_IMAGE_PATH=$HOME/visp-images" >> $GITHUB_ENV + echo "VISP_INPUT_IMAGE_PATH: ${{ env.VISP_INPUT_IMAGE_PATH }}" + + - name: Configure ViSP + working-directory: ${{ github.workspace }} + run: | + set VISP_INPUT_IMAGE_PATH=${{ env.VISP_INPUT_IMAGE_PATH }} + echo "VISP_INPUT_IMAGE_PATH: " + echo %VISP_INPUT_IMAGE_PATH% + mkdir build + cd build + cmake .. -G "Visual Studio 17 2022" -T "ClangCl" -A "x64" + type ViSP-third-party.txt + + - name: Build ViSP + working-directory: build + run: | + cmake --build . --config Release + + - name: Install ViSP + working-directory: build + run: | + cmake --build . --config Release --target install + + - name: Check installation folder + working-directory: build + run: | + dir ${{ github.workspace }}\build\install\ + dir ${{ github.workspace }}\build\install\x64\ + dir ${{ github.workspace }}\build\install\x64\vc17\ + dir ${{ github.workspace }}\build\install\x64\vc17\bin + + - name: Test ViSP + working-directory: build + run: | + set VISP_INPUT_IMAGE_PATH=${{ env.VISP_INPUT_IMAGE_PATH }} + echo "VISP_INPUT_IMAGE_PATH: " + echo %VISP_INPUT_IMAGE_PATH% + set PATH=%PATH%;${{ github.workspace }}\build\install\x64\vc17\bin + echo "PATH: " + echo %PATH% + ctest --output-on-failure -C Release -V diff --git a/.github/workflows/windows.yaml b/.github/workflows/windows-msvc.yaml similarity index 80% rename from .github/workflows/windows.yaml rename to .github/workflows/windows-msvc.yaml index 99d091fa02..4a3b846ce3 100644 --- a/.github/workflows/windows.yaml +++ b/.github/workflows/windows-msvc.yaml @@ -37,14 +37,17 @@ jobs: # https://remarkablemark.org/blog/2022/09/25/check-git-branch-exists-in-remote-repository/ run: | git clone --depth 1 https://github.com/lagadic/visp-images ${HOME}/visp-images - echo "VISP_INPUT_IMAGE_PATH=$HOME" >> $GITHUB_ENV + echo "VISP_INPUT_IMAGE_PATH=$HOME/visp-images" >> $GITHUB_ENV - name: Configure ViSP working-directory: ${{ github.workspace }} run: | + set VISP_INPUT_IMAGE_PATH=${{ env.VISP_INPUT_IMAGE_PATH }} + echo "VISP_INPUT_IMAGE_PATH: " + echo %VISP_INPUT_IMAGE_PATH% mkdir build cd build - cmake .. -G "Visual Studio 16 2019" -A "x64" -DCMAKE_GENERATOR_PLATFORM=x64 + cmake .. -G "Visual Studio 16 2019" -A "x64" type ViSP-third-party.txt - name: Build ViSP @@ -65,7 +68,9 @@ jobs: - name: Test ViSP working-directory: build run: | - echo "VISP_INPUT_IMAGE_PATH: ${{ env.VISP_INPUT_IMAGE_PATH }}" + set VISP_INPUT_IMAGE_PATH=${{ env.VISP_INPUT_IMAGE_PATH }} + echo "VISP_INPUT_IMAGE_PATH: " + echo %VISP_INPUT_IMAGE_PATH% set PATH=%PATH%;${{ github.workspace }}\build\install\x64\vc16\bin echo "PATH: " echo %PATH% diff --git a/3rdparty/clapack/CMakeLists.txt b/3rdparty/clapack/CMakeLists.txt index b8f4699e88..21e86557a7 100644 --- a/3rdparty/clapack/CMakeLists.txt +++ b/3rdparty/clapack/CMakeLists.txt @@ -37,7 +37,7 @@ if(NOT BUILD_SHARED_LIBS) vp_install_target(${LAPACK_LIBRARY} EXPORT VISPModules ARCHIVE DESTINATION ${VISP_3P_LIB_INSTALL_PATH} COMPONENT dev) endif() -if(MSVC) +if(MSVC AND NOT ((CMAKE_CXX_COMPILER MATCHES "clang") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))) # Disable Visual C++ warnings foreach(f ${lib_srcs}) vp_set_source_file_compile_flag(${f} /wd4244 /wd4267 /wd4273 /wd4554 /wd4723 /wd4996) diff --git a/3rdparty/simdlib/CMakeLists.txt b/3rdparty/simdlib/CMakeLists.txt index 6260825803..b3a56b4f80 100644 --- a/3rdparty/simdlib/CMakeLists.txt +++ b/3rdparty/simdlib/CMakeLists.txt @@ -25,7 +25,7 @@ if(X86 OR X86_64) set(AVX_FLAG "") set(AVX2_FLAG "") - if(MSVC) + if(MSVC AND NOT ((CMAKE_CXX_COMPILER MATCHES "clang") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))) if(NOT MSVC64) vp_check_compiler_flag(CXX "/arch:SSE2" HAVE_SSE2_FLAG "${VISP_SOURCE_DIR}/cmake/checks/cpu_sse2.cpp") endif() @@ -136,6 +136,11 @@ if(X86 OR X86_64) if(HAVE_NO_MISSING_FIELD_FLAG) set(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} -Wno-missing-field-initializers") endif() + + if(MSVC AND ((CMAKE_CXX_COMPILER MATCHES "clang") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))) + # Clang under windows needs AVX flags + set(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} ${AVX_FLAG} ${AVX2_FLAG}") + endif() endif() file(GLOB_RECURSE SIMD_BASE_SRC ${CMAKE_CURRENT_SOURCE_DIR}/Simd/SimdBase*.cpp) @@ -148,22 +153,10 @@ if(X86 OR X86_64) set_source_files_properties(${SIMD_SSE41_SRC} PROPERTIES COMPILE_FLAGS "${COMMON_CXX_FLAGS} ${SSE4_2_FLAG}") file(GLOB_RECURSE SIMD_AVX1_SRC ${CMAKE_CURRENT_SOURCE_DIR}/Simd/SimdAvx1*.cpp) - if(MSVC) - set_source_files_properties(${SIMD_AVX1_SRC} PROPERTIES COMPILE_FLAGS "${COMMON_CXX_FLAGS} ${AVX_FLAG}") - elseif((CMAKE_CXX_COMPILER MATCHES "clang") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang")) - set_source_files_properties(${SIMD_AVX1_SRC} PROPERTIES COMPILE_FLAGS "${COMMON_CXX_FLAGS} ${AVX_FLAG}") - else() - set_source_files_properties(${SIMD_AVX1_SRC} PROPERTIES COMPILE_FLAGS "${COMMON_CXX_FLAGS} ${AVX_FLAG}") - endif() + set_source_files_properties(${SIMD_AVX1_SRC} PROPERTIES COMPILE_FLAGS "${COMMON_CXX_FLAGS} ${AVX_FLAG}") file(GLOB_RECURSE SIMD_AVX2_SRC ${CMAKE_CURRENT_SOURCE_DIR}/Simd/SimdAvx2*.cpp) - if(MSVC) - set_source_files_properties(${SIMD_AVX2_SRC} PROPERTIES COMPILE_FLAGS "${COMMON_CXX_FLAGS} ${AVX2_FLAG}") - elseif((CMAKE_CXX_COMPILER MATCHES "clang") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang")) - set_source_files_properties(${SIMD_AVX2_SRC} PROPERTIES COMPILE_FLAGS "${COMMON_CXX_FLAGS} ${AVX2_FLAG}") - else() - set_source_files_properties(${SIMD_AVX2_SRC} PROPERTIES COMPILE_FLAGS "${COMMON_CXX_FLAGS} ${AVX2_FLAG}") - endif() + set_source_files_properties(${SIMD_AVX2_SRC} PROPERTIES COMPILE_FLAGS "${COMMON_CXX_FLAGS} ${AVX2_FLAG}") set(SIMD_LIB_FLAGS "${COMMON_CXX_FLAGS} ${AVX2_FLAG}") set(SIMD_ALG_SRC ${SIMD_BASE_SRC} ${SIMD_SSE2_SRC} ${SIMD_SSE41_SRC} ${SIMD_AVX1_SRC} ${SIMD_AVX2_SRC}) diff --git a/cmake/AddExtraCompilationFlags.cmake b/cmake/AddExtraCompilationFlags.cmake index b6cfa7b8ee..7f761ede09 100644 --- a/cmake/AddExtraCompilationFlags.cmake +++ b/cmake/AddExtraCompilationFlags.cmake @@ -42,14 +42,14 @@ macro(add_extra_compiler_option option) if(CMAKE_BUILD_TYPE) set(CMAKE_TRY_COMPILE_CONFIGURATION ${CMAKE_BUILD_TYPE}) endif() - vp_check_flag_support(CXX "${option}" _varname "") + vp_check_flag_support(CXX "${option}" _varname "${VISP_EXTRA_CXX_FLAGS} ${ARGN}") if(_varname) - list(APPEND VISP_EXTRA_CXX_FLAGS ${option}) + set(VISP_EXTRA_CXX_FLAGS "${VISP_EXTRA_CXX_FLAGS} ${option}") endif() - vp_check_flag_support(C "${option}" _varname "") + vp_check_flag_support(C "${option}" _varname "${VISP_EXTRA_C_FLAGS} ${ARGN}") if(_varname) - list(APPEND VISP_EXTRA_C_FLAGS ${option}) + set(VISP_EXTRA_C_FLAGS "${VISP_EXTRA_C_FLAGS} ${option}") endif() endmacro() @@ -126,7 +126,9 @@ if(BUILD_COVERAGE) endif() if(CMAKE_COMPILER_IS_GNUCXX) - add_extra_compiler_option(-fvisibility=hidden) + #if(NOT (WIN32 AND ((CMAKE_CXX_COMPILER MATCHES "clang") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang")))) + add_extra_compiler_option(-fvisibility=hidden) + #endif() if(ENABLE_AVX AND X86_64) add_extra_compiler_option(-mavx) @@ -178,6 +180,59 @@ if(MSVC) # Avoid build error C1128 list(APPEND VISP_EXTRA_CXX_FLAGS "/bigobj") endif() + #if((CMAKE_CXX_COMPILER MATCHES "clang") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang")) + # add_extra_compiler_option("-Wno-c++98-compat") # turn off warning due to json + # add_extra_compiler_option("-Wno-c++98-compat-pedantic") + # add_extra_compiler_option("-Wno-c11-extensions") + # add_extra_compiler_option("-Wno-covered-switch-default") + # add_extra_compiler_option("-Wno-unused-template") # turn off warning due to eigen + # add_extra_compiler_option("-Wno-deprecated-copy-with-dtor") + # add_extra_compiler_option("-Wno-anon-enum-enum-conversion") # turn off warning due to opencv + # add_extra_compiler_option("-Wno-cast-align") + # add_extra_compiler_option("-Wno-cast-qual") + # add_extra_compiler_option("-Wno-covered-switch-default") + # add_extra_compiler_option("-Wno-deprecated-copy-with-user-provided-dtor") + # add_extra_compiler_option("-Wno-documentation") + # add_extra_compiler_option("-Wno-documentation-deprecated-sync") + # add_extra_compiler_option("-Wno-documentation-unknown-command") + # add_extra_compiler_option("-Wno-double-promotion") + # add_extra_compiler_option("-Wno-enum-enum-conversion") + # add_extra_compiler_option("-Wno-exit-time-destructors") + # add_extra_compiler_option("-Wno-extra-semi") + # add_extra_compiler_option("-Wno-extra-semi-stmt") + # add_extra_compiler_option("-Wno-float-equal") + # add_extra_compiler_option("-Wno-implicit-int-float-conversion") + # add_extra_compiler_option("-Wno-implicit-float-conversion") + # add_extra_compiler_option("-Wno-inconsistent-missing-destructor-override") + # add_extra_compiler_option("-Wno-language-extension-token") + # add_extra_compiler_option("-Wno-microsoft-enum-value") + # add_extra_compiler_option("-Wno-newline-eof") + # add_extra_compiler_option("-Wno-old-style-cast") + # add_extra_compiler_option("-Wno-reserved-identifier") + # add_extra_compiler_option("-Wno-shift-sign-overflow") + # add_extra_compiler_option("-Wno-sign-conversion") + # add_extra_compiler_option("-Wno-undefined-reinterpret-cast") + # add_extra_compiler_option("-Wno-zero-as-null-pointer-constant") + # add_extra_compiler_option("-Wno-cast-function-type") # ViSP + # add_extra_compiler_option("-Wno-comma") + # add_extra_compiler_option("-Wno-deprecated-copy-dtor") + # add_extra_compiler_option("-Wno-deprecated-dynamic-exception-spec") + # add_extra_compiler_option("-Wno-format-nonliteral") + # add_extra_compiler_option("-Wno-global-constructors") + # add_extra_compiler_option("-Wno-implicit-int-conversion") + # add_extra_compiler_option("-Wno-implicit-fallthrough") + # add_extra_compiler_option("-Wno-missing-noreturn") + # add_extra_compiler_option("-Wno-missing-variable-declarations") + # add_extra_compiler_option("-Wno-missing-prototypes") + # add_extra_compiler_option("-Wno-nonportable-system-include-path") + # add_extra_compiler_option("-Wno-shadow") + # add_extra_compiler_option("-Wno-suggest-destructor-override") + # add_extra_compiler_option("-Wno-suggest-override") + # add_extra_compiler_option("-Wno-switch-enum") + # add_extra_compiler_option("-Wno-unreachable-code") + # add_extra_compiler_option("-Wno-unused-macros") + # add_extra_compiler_option("-Wno-unused-member-function") + #endif() endif() # adjust -Wl,-rpath-link diff --git a/cmake/VISPDetectPlatform.cmake b/cmake/VISPDetectPlatform.cmake index 99ad52ef51..e4f7466bdb 100644 --- a/cmake/VISPDetectPlatform.cmake +++ b/cmake/VISPDetectPlatform.cmake @@ -70,21 +70,9 @@ if(MSVC AND CMAKE_C_COMPILER MATCHES "icc|icl") set(CV_ICC __INTEL_COMPILER_FOR_WINDOWS) endif() -if(CMAKE_COMPILER_IS_GNUCXX) - if(WIN32) - execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpmachine - OUTPUT_VARIABLE VISP_GCC_TARGET_MACHINE - OUTPUT_STRIP_TRAILING_WHITESPACE) - if(VISP_GCC_TARGET_MACHINE MATCHES "amd64|x86_64|AMD64") - set(MINGW64 1) - endif() - endif() -endif() - -if(MSVC64 OR MINGW64) - set(X86_64 1) -elseif(MINGW OR (MSVC AND NOT CMAKE_CROSSCOMPILING)) - set(X86 1) +message(STATUS "Detected processor: ${CMAKE_SYSTEM_PROCESSOR}") +if(VISP_SKIP_SYSTEM_PROCESSOR_DETECTION) + # custom setup: required variables are passed through cache / CMake's command-line elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "amd64.*|x86_64.*|AMD64.*") set(X86_64 1) elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "i686.*|i386.*|x86.*") @@ -101,13 +89,21 @@ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(mips.*|MIPS.*)") set(MIPS 1) elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(riscv.*|RISCV.*)") set(RISCV 1) +elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(loongarch64.*|LOONGARCH64.*)") + set(LOONGARCH64 1) +else() + if(NOT VISP_SUPPRESS_MESSAGE_UNRECOGNIZED_SYSTEM_PROCESSOR) + message(WARNING "ViSP: unrecognized target processor configuration") + endif() endif() # Workaround for 32-bit operating systems on 64-bit x86_64 processor if(X86_64 AND CMAKE_SIZEOF_VOID_P EQUAL 4 AND NOT FORCE_X86_64) message(STATUS "sizeof(void) = 4 on x86 / x86_64 processor. Assume 32-bit compilation mode (X86=1)") - unset(X86_64) - set(X86 1) + if (X86_64) + unset(X86_64) + set(X86 1) + endif() endif() # Workaround for 32-bit operating systems on aarch64 processor if(CMAKE_SIZEOF_VOID_P EQUAL 4 AND AARCH64 AND NOT FORCE_AARCH64) @@ -165,11 +161,7 @@ elseif(MSVC) elseif(MINGW) set(VISP_RUNTIME mingw) - execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpmachine - OUTPUT_VARIABLE VISP_GCC_TARGET_MACHINE - OUTPUT_STRIP_TRAILING_WHITESPACE) - if(VISP_GCC_TARGET_MACHINE MATCHES "64") - set(MINGW64 1) + if(CMAKE_SYSTEM_PROCESSOR MATCHES "amd64.*|x86_64.*|AMD64.*") set(VISP_ARCH x64) else() set(VISP_ARCH x86) diff --git a/cmake/VISPUtils.cmake b/cmake/VISPUtils.cmake index a027269087..32a8803f1e 100644 --- a/cmake/VISPUtils.cmake +++ b/cmake/VISPUtils.cmake @@ -928,12 +928,34 @@ macro(vp_check_compiler_flag LANG FLAG RESULT) else() set(__msg "") endif() + if(CMAKE_REQUIRED_LIBRARIES) + set(__link_libs LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}) + else() + set(__link_libs) + endif() + set(__cmake_flags "") + if(CMAKE_EXE_LINKER_FLAGS) # CMP0056 do this on new CMake + list(APPEND __cmake_flags "-DCMAKE_EXE_LINKER_FLAGS=${CMAKE_EXE_LINKER_FLAGS}") + endif() + + # CMP0067 do this on new CMake + if(DEFINED CMAKE_CXX_STANDARD) + list(APPEND __cmake_flags "-DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD}") + endif() + if(DEFINED CMAKE_CXX_STANDARD_REQUIRED) + list(APPEND __cmake_flags "-DCMAKE_CXX_STANDARD_REQUIRED=${CMAKE_CXX_STANDARD_REQUIRED}") + endif() + if(DEFINED CMAKE_CXX_EXTENSIONS) + list(APPEND __cmake_flags "-DCMAKE_CXX_EXTENSIONS=${CMAKE_CXX_EXTENSIONS}") + endif() + message(STATUS "Performing Test ${RESULT}${__msg}") try_compile(${RESULT} "${CMAKE_BINARY_DIR}" "${_fname}" - CMAKE_FLAGS "-DCMAKE_EXE_LINKER_FLAGS=${CMAKE_EXE_LINKER_FLAGS}" # CMP0056 do this on new CMake + CMAKE_FLAGS ${__cmake_flags} COMPILE_DEFINITIONS "${FLAG}" + ${__link_libs} OUTPUT_VARIABLE OUTPUT) if(${RESULT}) @@ -993,8 +1015,10 @@ macro(vp_check_flag_support lang flag varname base_options) endif() string(TOUPPER "${flag}" ${varname}) string(REGEX REPLACE "^(/|-)" "HAVE_${_lang}_" ${varname} "${${varname}}") - string(REGEX REPLACE " -|-|=| |\\." "_" ${varname} "${${varname}}") - vp_check_compiler_flag("${_lang}" "${base_options} ${flag}" ${${varname}} ${ARGN}) + string(REGEX REPLACE " -|-|=| |\\.|," "_" ${varname} "${${varname}}") + if(DEFINED CMAKE_${_lang}_COMPILER) + vp_check_compiler_flag("${_lang}" "${base_options} ${flag}" ${${varname}} ${ARGN}) + endif() endmacro() # turns off warnings diff --git a/cmake/templates/VISPConfig.root-WIN32.cmake.in b/cmake/templates/VISPConfig.root-WIN32.cmake.in index 989f80c67d..d038ba76a2 100644 --- a/cmake/templates/VISPConfig.root-WIN32.cmake.in +++ b/cmake/templates/VISPConfig.root-WIN32.cmake.in @@ -102,11 +102,7 @@ elseif(MSVC) elseif(MINGW) set(VISP_RUNTIME mingw) - execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpmachine - OUTPUT_VARIABLE VISP_GCC_TARGET_MACHINE - OUTPUT_STRIP_TRAILING_WHITESPACE) - if(VISP_GCC_TARGET_MACHINE MATCHES "64") - set(MINGW64 1) + if(CMAKE_SYSTEM_PROCESSOR MATCHES "amd64.*|x86_64.*|AMD64.*") set(VISP_ARCH x64) else() set(VISP_ARCH x86) diff --git a/modules/core/include/visp3/core/vpCameraParameters.h b/modules/core/include/visp3/core/vpCameraParameters.h index f196a30817..5bc255eccf 100644 --- a/modules/core/include/visp3/core/vpCameraParameters.h +++ b/modules/core/include/visp3/core/vpCameraParameters.h @@ -40,8 +40,8 @@ */ -#ifndef vpCameraParameters_H -#define vpCameraParameters_H +#ifndef _vpCameraParameters_h_ +#define _vpCameraParameters_h_ #include @@ -483,6 +483,8 @@ inline void to_json(nlohmann::json &j, const vpCameraParameters &cam) j["dist_coeffs"] = cam.m_dist_coefs; break; } + case vpCameraParameters::perspectiveProjWithoutDistortion: + break; default: break; } diff --git a/modules/core/include/visp3/core/vpDebug.h b/modules/core/include/visp3/core/vpDebug.h index 89995a0597..9712030e82 100644 --- a/modules/core/include/visp3/core/vpDebug.h +++ b/modules/core/include/visp3/core/vpDebug.h @@ -149,10 +149,10 @@ class vpTraceOutput public: /*! Constructor. - \param file Should be the name of the file where this constructor was - called. \param line Should be the line in file where this constructor was - called. \param func Should be the name of the function where this - constructor was called. \param error If true, writes to the error stream. + \param file Should be the name of the file where this constructor was called. + \param line Should be the line in file where this constructor was called. + \param func Should be the name of the function where this constructor was called. + \param error If true, writes to the error stream. \param s String to print before any other message (acts like a header). \note Call the constructor with something like vpTraceOutput(__FILE__,__LINE__, __FUNCTION__). diff --git a/modules/core/include/visp3/core/vpForceTwistMatrix.h b/modules/core/include/visp3/core/vpForceTwistMatrix.h index 9e137309d5..0b216e72f7 100644 --- a/modules/core/include/visp3/core/vpForceTwistMatrix.h +++ b/modules/core/include/visp3/core/vpForceTwistMatrix.h @@ -182,7 +182,7 @@ class VISP_EXPORT vpForceTwistMatrix : public vpArray2D /*! Destructor. */ - virtual ~vpForceTwistMatrix(){}; + virtual ~vpForceTwistMatrix(){} vpForceTwistMatrix buildFrom(const vpTranslationVector &t, const vpRotationMatrix &R); vpForceTwistMatrix buildFrom(const vpTranslationVector &t, const vpThetaUVector &thetau); @@ -215,7 +215,7 @@ class VISP_EXPORT vpForceTwistMatrix : public vpArray2D (void)ncols; (void)flagNullify; throw(vpException(vpException::fatalError, "Cannot resize a velocity twist matrix")); - }; + } #if defined(VISP_BUILD_DEPRECATED_FUNCTIONS) /*! @@ -226,7 +226,7 @@ class VISP_EXPORT vpForceTwistMatrix : public vpArray2D \deprecated Provided only for compat with previous releases. This function does nothing. */ - vp_deprecated void init(){}; + vp_deprecated void init(){} /*! \deprecated You should rather use eye(). */ diff --git a/modules/core/include/visp3/core/vpFrameGrabberException.h b/modules/core/include/visp3/core/vpFrameGrabberException.h index 3e8d5f7ebb..3254507e93 100644 --- a/modules/core/include/visp3/core/vpFrameGrabberException.h +++ b/modules/core/include/visp3/core/vpFrameGrabberException.h @@ -84,8 +84,8 @@ class VISP_EXPORT vpFrameGrabberException : public vpException setMessage(format, args); va_end(args); } - vpFrameGrabberException(int id, const std::string &msg) : vpException(id, msg) { ; } - explicit vpFrameGrabberException(int id) : vpException(id) { ; } + vpFrameGrabberException(int id, const std::string &msg) : vpException(id, msg) { } + explicit vpFrameGrabberException(int id) : vpException(id) { } }; #endif /* #ifndef _vpFrameGrabberException_h_ */ diff --git a/modules/core/include/visp3/core/vpImageException.h b/modules/core/include/visp3/core/vpImageException.h index c42c446c37..34f6a0cefb 100644 --- a/modules/core/include/visp3/core/vpImageException.h +++ b/modules/core/include/visp3/core/vpImageException.h @@ -91,8 +91,8 @@ class VISP_EXPORT vpImageException : public vpException setMessage(format, args); va_end(args); } - vpImageException(int id, const std::string &msg) : vpException(id, msg) { ; } - explicit vpImageException(int id) : vpException(id) { ; } + vpImageException(int id, const std::string &msg) : vpException(id, msg) { } + explicit vpImageException(int id) : vpException(id) { } }; #endif diff --git a/modules/core/include/visp3/core/vpImagePoint.h b/modules/core/include/visp3/core/vpImagePoint.h index 748fba9ab9..b308257214 100644 --- a/modules/core/include/visp3/core/vpImagePoint.h +++ b/modules/core/include/visp3/core/vpImagePoint.h @@ -36,8 +36,8 @@ * *****************************************************************************/ -#ifndef vpImagePoint_H -#define vpImagePoint_H +#ifndef _vpImagePoint_h_ +#define _vpImagePoint_h_ /*! \file vpImagePoint.h @@ -221,18 +221,18 @@ class VISP_EXPORT vpImagePoint { const double line_slope = (end.get_i() - start.get_i()) / (end.get_j() - start.get_j()); if (fabs(end.get_j() - this->j) > fabs(end.get_i() - this->i)) { - double j = (end.get_j() > this->j ? this->j + 1 : this->j - 1); + double j_ = (end.get_j() > this->j ? this->j + 1 : this->j - 1); #if (VISP_CXX_STANDARD > VISP_CXX_STANDARD_98) - return {end.get_i() - line_slope * (end.get_j() - j), j}; + return {end.get_i() - line_slope * (end.get_j() - j_), j_}; #else - return vpImagePoint(end.get_i() - line_slope * (end.get_j() - j), j); + return vpImagePoint(end.get_i() - line_slope * (end.get_j() - j_), j_); #endif } else { - double i = (end.get_i() > this->i ? this->i + 1 : this->i - 1); + double i_ = (end.get_i() > this->i ? this->i + 1 : this->i - 1); #if (VISP_CXX_STANDARD > VISP_CXX_STANDARD_98) - return {i, end.get_j() - ((end.get_i() - i) / line_slope)}; + return {i_, end.get_j() - ((end.get_i() - i_) / line_slope)}; #else - return vpImagePoint(i, end.get_j() - ((end.get_i() - i) / line_slope)); + return vpImagePoint(i_, end.get_j() - ((end.get_i() - i_) / line_slope)); #endif } } diff --git a/modules/core/include/visp3/core/vpIoException.h b/modules/core/include/visp3/core/vpIoException.h index ec7ea640fd..2d0c202e70 100644 --- a/modules/core/include/visp3/core/vpIoException.h +++ b/modules/core/include/visp3/core/vpIoException.h @@ -89,8 +89,8 @@ class VISP_EXPORT vpIoException : public vpException setMessage(format, args); va_end(args); } - vpIoException(int id, const std::string &msg) : vpException(id, msg) { ; } - explicit vpIoException(int id) : vpException(id) { ; } + vpIoException(int id, const std::string &msg) : vpException(id, msg) { } + explicit vpIoException(int id) : vpException(id) { } }; #endif diff --git a/modules/core/include/visp3/core/vpMath.h b/modules/core/include/visp3/core/vpMath.h index 10dfd1c4fc..1813357f97 100644 --- a/modules/core/include/visp3/core/vpMath.h +++ b/modules/core/include/visp3/core/vpMath.h @@ -51,8 +51,10 @@ // Define _USE_MATH_DEFINES before including to expose these macro // definitions for common math constants. These are placed under an #ifdef // since these commonly-defined names are not part of the C or C++ standards +#ifndef _USE_MATH_DEFINES #define _USE_MATH_DEFINES #endif +#endif #include #include diff --git a/modules/core/include/visp3/core/vpMatrixException.h b/modules/core/include/visp3/core/vpMatrixException.h index 95e6114b05..bf237a4ada 100644 --- a/modules/core/include/visp3/core/vpMatrixException.h +++ b/modules/core/include/visp3/core/vpMatrixException.h @@ -98,8 +98,8 @@ class VISP_EXPORT vpMatrixException : public vpException setMessage(format, args); va_end(args); } - vpMatrixException(int id, const std::string &msg) : vpException(id, msg) { ; } - explicit vpMatrixException(int id) : vpException(id) { ; } + vpMatrixException(int id, const std::string &msg) : vpException(id, msg) { } + explicit vpMatrixException(int id) : vpException(id) { } // vpMatrixException() : vpException() { ;} }; diff --git a/modules/core/include/visp3/core/vpNetwork.h b/modules/core/include/visp3/core/vpNetwork.h index cc2d39eb19..e1f2427f8f 100644 --- a/modules/core/include/visp3/core/vpNetwork.h +++ b/modules/core/include/visp3/core/vpNetwork.h @@ -291,7 +291,7 @@ template int vpNetwork::receive(T *object, const unsigned int &size } tv.tv_sec = tv_sec; -#if TARGET_OS_IPHONE +#ifdef TARGET_OS_IPHONE tv.tv_usec = (int)tv_usec; #else tv.tv_usec = tv_usec; @@ -375,7 +375,7 @@ int vpNetwork::receiveFrom(T *object, const unsigned int &receptorEmitting, cons } tv.tv_sec = tv_sec; -#if TARGET_OS_IPHONE +#ifdef TARGET_OS_IPHONE tv.tv_usec = (int)tv_usec; #else tv.tv_usec = tv_usec; diff --git a/modules/core/include/visp3/core/vpQuaternionVector.h b/modules/core/include/visp3/core/vpQuaternionVector.h index 75c82895c8..7f8d3393f6 100644 --- a/modules/core/include/visp3/core/vpQuaternionVector.h +++ b/modules/core/include/visp3/core/vpQuaternionVector.h @@ -123,7 +123,7 @@ class VISP_EXPORT vpQuaternionVector : public vpRotationVector explicit vpQuaternionVector(const std::vector &q); //! Destructor. - virtual ~vpQuaternionVector(){}; + virtual ~vpQuaternionVector(){} vpQuaternionVector buildFrom(const double qx, const double qy, const double qz, const double qw); vpQuaternionVector buildFrom(const vpRotationMatrix &R); diff --git a/modules/core/include/visp3/core/vpRotationVector.h b/modules/core/include/visp3/core/vpRotationVector.h index b87770eec6..9b580c47a4 100644 --- a/modules/core/include/visp3/core/vpRotationVector.h +++ b/modules/core/include/visp3/core/vpRotationVector.h @@ -33,8 +33,8 @@ * *****************************************************************************/ -#ifndef vpRotationVECTOR_H -#define vpRotationVECTOR_H +#ifndef _vpRotationVector_h_ +#define _vpRotationVector_h_ /*! \file vpRotationVector.h @@ -112,7 +112,7 @@ class VISP_EXPORT vpRotationVector : public vpArray2D /*! Destructor. */ - virtual ~vpRotationVector(){}; + virtual ~vpRotationVector(){} /** @name Inherited functionalities from vpRotationVector */ //@{ diff --git a/modules/core/include/visp3/core/vpRxyzVector.h b/modules/core/include/visp3/core/vpRxyzVector.h index e99b234e20..c5ecf7a073 100644 --- a/modules/core/include/visp3/core/vpRxyzVector.h +++ b/modules/core/include/visp3/core/vpRxyzVector.h @@ -34,8 +34,8 @@ * *****************************************************************************/ -#ifndef vpRxyzVECTOR_H -#define vpRxyzVECTOR_H +#ifndef _vpRxyzVector_h_ +#define _vpRxyzVector_h_ /*! \file vpRxyzVector.h @@ -192,7 +192,7 @@ class VISP_EXPORT vpRxyzVector : public vpRotationVector explicit vpRxyzVector(const std::vector &rxyz); //! Destructor. - virtual ~vpRxyzVector(){}; + virtual ~vpRxyzVector(){} // convert a rotation matrix into Rxyz vector vpRxyzVector buildFrom(const vpRotationMatrix &R); diff --git a/modules/core/include/visp3/core/vpRzyxVector.h b/modules/core/include/visp3/core/vpRzyxVector.h index 22a7ca33ff..b68f68fab9 100644 --- a/modules/core/include/visp3/core/vpRzyxVector.h +++ b/modules/core/include/visp3/core/vpRzyxVector.h @@ -34,8 +34,8 @@ * *****************************************************************************/ -#ifndef vpRzyxVector_h -#define vpRzyxVector_h +#ifndef _vpRzyxVector_h_ +#define _vpRzyxVector_h_ /*! \file vpRzyxVector.h @@ -194,7 +194,7 @@ class VISP_EXPORT vpRzyxVector : public vpRotationVector explicit vpRzyxVector(const std::vector &rzyx); //! Destructor. - virtual ~vpRzyxVector(){}; + virtual ~vpRzyxVector(){} // convert a rotation matrix into Rzyx vector vpRzyxVector buildFrom(const vpRotationMatrix &R); diff --git a/modules/core/include/visp3/core/vpRzyzVector.h b/modules/core/include/visp3/core/vpRzyzVector.h index 8c695b2136..3c763a78c4 100644 --- a/modules/core/include/visp3/core/vpRzyzVector.h +++ b/modules/core/include/visp3/core/vpRzyzVector.h @@ -34,8 +34,8 @@ * *****************************************************************************/ -#ifndef vpRzyzVector_h -#define vpRzyzVector_h +#ifndef _vpRzyzVector_h_ +#define _vpRzyzVector_h_ /*! \file vpRzyzVector.h @@ -192,7 +192,7 @@ class VISP_EXPORT vpRzyzVector : public vpRotationVector explicit vpRzyzVector(const std::vector &rzyz); //! Destructor. - virtual ~vpRzyzVector(){}; + virtual ~vpRzyzVector(){} // convert a rotation matrix into Rzyz vector vpRzyzVector buildFrom(const vpRotationMatrix &R); diff --git a/modules/core/include/visp3/core/vpThetaUVector.h b/modules/core/include/visp3/core/vpThetaUVector.h index 4e38f7dd86..6487691a0c 100644 --- a/modules/core/include/visp3/core/vpThetaUVector.h +++ b/modules/core/include/visp3/core/vpThetaUVector.h @@ -33,8 +33,8 @@ * *****************************************************************************/ -#ifndef vpTHETAUVECTOR_H -#define vpTHETAUVECTOR_H +#ifndef _vpThetaUVector_h_ +#define _vpThetaUVector_h_ /*! \file vpThetaUVector.h @@ -193,7 +193,7 @@ class VISP_EXPORT vpThetaUVector : public vpRotationVector vpThetaUVector(double tux, double tuy, double tuz); //! Destructor. - virtual ~vpThetaUVector(){}; + virtual ~vpThetaUVector(){} // convert an homogeneous matrix into Theta U vector vpThetaUVector buildFrom(const vpHomogeneousMatrix &M); diff --git a/modules/core/include/visp3/core/vpTrackingException.h b/modules/core/include/visp3/core/vpTrackingException.h index 89ecd16cc1..d2c090b0bf 100644 --- a/modules/core/include/visp3/core/vpTrackingException.h +++ b/modules/core/include/visp3/core/vpTrackingException.h @@ -88,8 +88,8 @@ class VISP_EXPORT vpTrackingException : public vpException setMessage(format, args); va_end(args); } - vpTrackingException(int id, const std::string &msg) : vpException(id, msg) { ; } - explicit vpTrackingException(int id) : vpException(id) { ; } + vpTrackingException(int id, const std::string &msg) : vpException(id, msg) { } + explicit vpTrackingException(int id) : vpException(id) { } }; #endif diff --git a/modules/core/src/image/vpImageTools.cpp b/modules/core/src/image/vpImageTools.cpp index 8cb40834ed..dcf990084d 100644 --- a/modules/core/src/image/vpImageTools.cpp +++ b/modules/core/src/image/vpImageTools.cpp @@ -357,7 +357,7 @@ void vpImageTools::initUndistortMap(const vpCameraParameters &cam, unsigned int float v0 = static_cast(cam.get_v0()); float px = static_cast(cam.get_px()); float py = static_cast(cam.get_py()); - float kud; + float kud = 0; std::vector dist_coefs; if (!is_KannalaBrandt) @@ -381,8 +381,8 @@ void vpImageTools::initUndistortMap(const vpCameraParameters &cam, unsigned int } float invpx, invpy; - float kud_px2 = 0., kud_py2 = 0., deltau_px, deltav_py; - float fr1, fr2; + float kud_px2 = 0., kud_py2 = 0., deltau_px, deltav_py = 0; + float fr1 = 0, fr2; float deltav, deltau; float u_float, v_float; int u_round, v_round; diff --git a/modules/core/src/math/kalman/vpLinearKalmanFilterInstantiation.cpp b/modules/core/src/math/kalman/vpLinearKalmanFilterInstantiation.cpp index f2b0a0c347..fe71a5d43f 100644 --- a/modules/core/src/math/kalman/vpLinearKalmanFilterInstantiation.cpp +++ b/modules/core/src/math/kalman/vpLinearKalmanFilterInstantiation.cpp @@ -806,7 +806,6 @@ void vpLinearKalmanFilterInstantiation::filter(vpColVector &z) case unknown: vpERROR_TRACE("Kalman state model is not set"); throw(vpException(vpException::notInitialized, "Kalman state model is not set")); - break; } iter++; diff --git a/modules/core/src/tools/network/vpNetwork.cpp b/modules/core/src/tools/network/vpNetwork.cpp index e4a90c610c..663181f382 100644 --- a/modules/core/src/tools/network/vpNetwork.cpp +++ b/modules/core/src/tools/network/vpNetwork.cpp @@ -47,7 +47,7 @@ vpNetwork::vpNetwork() tv_sec(0), tv_usec(10), verboseMode(false) { tv.tv_sec = tv_sec; -#if TARGET_OS_IPHONE +#ifdef TARGET_OS_IPHONE tv.tv_usec = (int)tv_usec; #else tv.tv_usec = tv_usec; @@ -656,7 +656,7 @@ int vpNetwork::_receiveRequestOnce() } tv.tv_sec = tv_sec; -#if TARGET_OS_IPHONE +#ifdef TARGET_OS_IPHONE tv.tv_usec = (int)tv_usec; #else tv.tv_usec = tv_usec; @@ -743,7 +743,7 @@ int vpNetwork::_receiveRequestOnceFrom(const unsigned int &receptorEmitting) } tv.tv_sec = tv_sec; -#if TARGET_OS_IPHONE +#ifdef TARGET_OS_IPHONE tv.tv_usec = (int)tv_usec; #else tv.tv_usec = tv_usec; diff --git a/modules/core/src/tools/network/vpServer.cpp b/modules/core/src/tools/network/vpServer.cpp index 7bb0d2e305..c7b92d368c 100644 --- a/modules/core/src/tools/network/vpServer.cpp +++ b/modules/core/src/tools/network/vpServer.cpp @@ -207,7 +207,7 @@ bool vpServer::checkForConnections() } tv.tv_sec = tv_sec; -#if TARGET_OS_IPHONE +#ifdef TARGET_OS_IPHONE tv.tv_usec = (int)tv_usec; #else tv.tv_usec = tv_usec; diff --git a/modules/io/include/visp3/io/vpDiskGrabber.h b/modules/io/include/visp3/io/vpDiskGrabber.h index 0e515d2005..2925f918d8 100644 --- a/modules/io/include/visp3/io/vpDiskGrabber.h +++ b/modules/io/include/visp3/io/vpDiskGrabber.h @@ -138,11 +138,11 @@ class VISP_EXPORT vpDiskGrabber : public vpFrameGrabber /*! Return the current image number. */ - inline long getImageNumber() const { return m_image_number; }; + inline long getImageNumber() const { return m_image_number; } /*! * Return the name of the file in which the last frame was read. */ - inline std::string getImageName() const { return m_image_name; }; + inline std::string getImageName() const { return m_image_name; } void open(vpImage &I); void open(vpImage &I); diff --git a/modules/io/include/visp3/io/vpParallelPortException.h b/modules/io/include/visp3/io/vpParallelPortException.h index 457fff7ef4..33b975a401 100644 --- a/modules/io/include/visp3/io/vpParallelPortException.h +++ b/modules/io/include/visp3/io/vpParallelPortException.h @@ -94,8 +94,8 @@ class VISP_EXPORT vpParallelPortException : public vpException setMessage(format, args); va_end(args); } - vpParallelPortException(int id, const std::string &msg) : vpException(id, msg) { ; } - explicit vpParallelPortException(int id) : vpException(id) { ; } + vpParallelPortException(int id, const std::string &msg) : vpException(id, msg) { } + explicit vpParallelPortException(int id) : vpException(id) { } }; #endif diff --git a/modules/tracker/mbt/src/klt/vpMbKltTracker.cpp b/modules/tracker/mbt/src/klt/vpMbKltTracker.cpp index 2b52d09560..05f0bbce43 100644 --- a/modules/tracker/mbt/src/klt/vpMbKltTracker.cpp +++ b/modules/tracker/mbt/src/klt/vpMbKltTracker.cpp @@ -383,7 +383,7 @@ std::map vpMbKltTracker::getKltImagePointsWithId() const long id; float x_tmp, y_tmp; tracker.getFeature((int)i, id, x_tmp, y_tmp); -#if TARGET_OS_IPHONE +#ifdef TARGET_OS_IPHONE kltPoints[(int)id] = vpImagePoint(y_tmp, x_tmp); #else kltPoints[id] = vpImagePoint(y_tmp, x_tmp); @@ -497,7 +497,7 @@ void vpMbKltTracker::setPose(const vpImage *const I, const vpImag std::map::const_iterator iter = kltpoly->getCurrentPoints().begin(); // nbCur+= (unsigned int)kltpoly->getCurrentPoints().size(); for (; iter != kltpoly->getCurrentPoints().end(); ++iter) { -#if TARGET_OS_IPHONE +#ifdef TARGET_OS_IPHONE if (std::find(init_ids.begin(), init_ids.end(), (long)(kltpoly->getCurrentPointsInd())[(int)iter->first]) != init_ids.end()) #else @@ -517,7 +517,7 @@ void vpMbKltTracker::setPose(const vpImage *const I, const vpImag cv::Point2f p((float)cdp[0], (float)cdp[1]); init_pts.push_back(p); -#if TARGET_OS_IPHONE +#ifdef TARGET_OS_IPHONE init_ids.push_back((size_t)(kltpoly->getCurrentPointsInd())[(int)iter->first]); #else init_ids.push_back((size_t)(kltpoly->getCurrentPointsInd())[(size_t)iter->first]); diff --git a/modules/tracker/mbt/src/klt/vpMbtDistanceKltCylinder.cpp b/modules/tracker/mbt/src/klt/vpMbtDistanceKltCylinder.cpp index 0c90f82799..adc7cd4038 100644 --- a/modules/tracker/mbt/src/klt/vpMbtDistanceKltCylinder.cpp +++ b/modules/tracker/mbt/src/klt/vpMbtDistanceKltCylinder.cpp @@ -148,7 +148,7 @@ void vpMbtDistanceKltCylinder::init(const vpKltOpencv &_tracker, const vpHomogen vpPixelMeterConversion::convertPoint(cam, x_tmp, y_tmp, xm, ym); double Z = computeZ(xm, ym); if (!vpMath::isNaN(Z)) { -#if TARGET_OS_IPHONE +#ifdef TARGET_OS_IPHONE initPoints[(int)id] = vpImagePoint(y_tmp, x_tmp); curPoints[(int)id] = vpImagePoint(y_tmp, x_tmp); curPointsInd[(int)id] = (int)i; @@ -162,7 +162,7 @@ void vpMbtDistanceKltCylinder::init(const vpKltOpencv &_tracker, const vpHomogen vpPoint p; p.setWorldCoordinates(xm * Z, ym * Z, Z); -#if TARGET_OS_IPHONE +#ifdef TARGET_OS_IPHONE initPoints3D[(int)id] = p; #else initPoints3D[id] = p; @@ -201,7 +201,7 @@ unsigned int vpMbtDistanceKltCylinder::computeNbDetectedCurrent(const vpKltOpenc for (unsigned int i = 0; i < static_cast(_tracker.getNbFeatures()); i++) { _tracker.getFeature((int)i, id, x, y); if (isTrackedFeature((int)id)) { -#if TARGET_OS_IPHONE +#ifdef TARGET_OS_IPHONE curPoints[(int)id] = vpImagePoint(static_cast(y), static_cast(x)); curPointsInd[(int)id] = (int)i; #else diff --git a/modules/tracker/mbt/src/klt/vpMbtDistanceKltPoints.cpp b/modules/tracker/mbt/src/klt/vpMbtDistanceKltPoints.cpp index d4990cc7af..56bef81a4e 100644 --- a/modules/tracker/mbt/src/klt/vpMbtDistanceKltPoints.cpp +++ b/modules/tracker/mbt/src/klt/vpMbtDistanceKltPoints.cpp @@ -106,7 +106,7 @@ void vpMbtDistanceKltPoints::init(const vpKltOpencv &_tracker, const vpImage(_tracker.getNbFeatures()); i++) { _tracker.getFeature((int)i, id, x, y); if (isTrackedFeature((int)id) && vpMeTracker::inMask(mask, (unsigned int)y, (unsigned int)x)) { -#if TARGET_OS_IPHONE +#ifdef TARGET_OS_IPHONE curPoints[(int)id] = vpImagePoint(static_cast(y), static_cast(x)); curPointsInd[(int)id] = (int)i; #else diff --git a/modules/vision/include/visp3/vision/vpCalibrationException.h b/modules/vision/include/visp3/vision/vpCalibrationException.h index 786dd3123f..daf94b3abb 100644 --- a/modules/vision/include/visp3/vision/vpCalibrationException.h +++ b/modules/vision/include/visp3/vision/vpCalibrationException.h @@ -96,8 +96,8 @@ class VISP_EXPORT vpCalibrationException : public vpException setMessage(format, args); va_end(args); } - vpCalibrationException(int id, const std::string &msg) : vpException(id, msg) { ; } - explicit vpCalibrationException(int id) : vpException(id) { ; } + vpCalibrationException(int id, const std::string &msg) : vpException(id, msg) { } + explicit vpCalibrationException(int id) : vpException(id) { } }; #endif diff --git a/modules/vision/include/visp3/vision/vpPoseException.h b/modules/vision/include/visp3/vision/vpPoseException.h index c1e76dd573..e626cc3f0b 100644 --- a/modules/vision/include/visp3/vision/vpPoseException.h +++ b/modules/vision/include/visp3/vision/vpPoseException.h @@ -89,8 +89,8 @@ class VISP_EXPORT vpPoseException : public vpException setMessage(format, args); va_end(args); } - vpPoseException(int id, const std::string &msg) : vpException(id, msg) { ; } - explicit vpPoseException(int id) : vpException(id) { ; } + vpPoseException(int id, const std::string &msg) : vpException(id, msg) { } + explicit vpPoseException(int id) : vpException(id) { } // vpPoseException() : vpException() { ;} }; diff --git a/modules/visual_features/include/visp3/visual_features/vpFeatureException.h b/modules/visual_features/include/visp3/visual_features/vpFeatureException.h index b2f4fcabd5..b188973a9f 100644 --- a/modules/visual_features/include/visp3/visual_features/vpFeatureException.h +++ b/modules/visual_features/include/visp3/visual_features/vpFeatureException.h @@ -90,8 +90,8 @@ class VISP_EXPORT vpFeatureException : public vpException setMessage(format, args); va_end(args); } - vpFeatureException(int id, const std::string &msg) : vpException(id, msg) { ; } - explicit vpFeatureException(int id) : vpException(id) { ; } + vpFeatureException(int id, const std::string &msg) : vpException(id, msg) { } + explicit vpFeatureException(int id) : vpException(id) { } }; #endif diff --git a/modules/vs/include/visp3/vs/vpServoException.h b/modules/vs/include/visp3/vs/vpServoException.h index 7b5ca8af89..4aceab9ce6 100644 --- a/modules/vs/include/visp3/vs/vpServoException.h +++ b/modules/vs/include/visp3/vs/vpServoException.h @@ -86,8 +86,8 @@ class VISP_EXPORT vpServoException : public vpException setMessage(format, args); va_end(args); } - vpServoException(int id, const std::string &msg) : vpException(id, msg) { ; } - explicit vpServoException(int id) : vpException(id) { ; } + vpServoException(int id, const std::string &msg) : vpException(id, msg) { } + explicit vpServoException(int id) : vpException(id) { } }; #endif