opencv/cmake
Francesco Petrogalli d29c7e7871
Merge pull request #20392 from fpetrogalli:aarch64-semihosting
AArch64 semihosting

* [ts] Disable filesystem support in the TS module.

Because of this change, all the tests loading data will file, but tat
least the core module can be tested with the following line:

    opencv_test_core --gtest_filter=-"*Core_InputOutput*:*Core_globbing.accuracy*"

* [aarch64] Build OpenCV for AArch64 semihosting.

This patch provide a toolchain file that allows to build the library
for semihosting applications [1]. Minimal changes have been applied to
the code to be able to compile with a baremetal toolchain.

[1] https://developer.arm.com/documentation/100863/latest

The option `CV_SEMIHOSTING` is used to guard the bits in the code that
are specific to the target.

To build the code:

    cmake ../opencv/ \
        -DCMAKE_TOOLCHAIN_FILE=../opencv/platforms/semihosting/aarch64-semihosting.toolchain.cmake \
        -DSEMIHOSTING_TOOLCHAIN_PATH=/path/to/baremetal-toolchain/bin/ \
        -DBUILD_EXAMPLES=ON -GNinja

A barematel toolchain for targeting aarch64 semihosting can be found
at [2], under `aarch64-none-elf`.

[2] https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-a/downloads

The folder `samples/semihosting` provides two example semihosting
applications.

The two binaries can be executed on the host platform with:

    qemu-aarch64 ./bin/example_semihosting_histogram
    qemu-aarch64 ./bin/example_semihosting_norm

Similarly, the test and perf executables of the modules can be run
with:

    qemu-aarch64 ./bin/opecv_[test|perf]_<module>

Notice that filesystem support is disabled by the toolchain file,
hence some of the test that depend on filesystem support will fail.

* [semihosting] Remove blank like at the end of file. [NFC]

The spurious blankline was reported by
https://pullrequest.opencv.org/buildbot/builders/precommit_docs/builds/31158.

* [semihosting] Make the raw pixel file generation OS independent.

Use the facilities provided by Cmake to generate the header file
instead of a shell script, so that the build doesn't fail on systems
that do not have a unix shell.

* [semihosting] Rename variable for semihosting compilation.

* [semihosting] Move the cmake configuration to a variable file.

* [semihosting] Make the guard macro private for the core module.

* [semihosting] Remove space. [NFC]

* [semihosting] Improve comment with information about semihosting. [NFC]

* [semihosting] Update license statement on top of sourvce file. [NFC]

* [semihosting] Replace BM_SUFFIX with SEMIHOSTING_SUFFIX. [NFC]

* [semihosting] Remove double space. [NFC]

* [semihosting] Add some text output to the sample applications.

* [semihosting] Remove duplicate entry in cmake configuration. [NFCI]

* [semihosting] Replace `long` with `int` in sample apps. [NFCI]

* [semihosting] Use `configure_file` to create the random pixels. [NFCI]

* [semihosting][bugfix] Fix name of cmakedefine variable.

* [semihosting][samples] Use CV_8UC1 for grayscale images. [NFCI]

* [semihosting] Add readme file.

* [semihosting] Remove blank like at the end of README. [NFC]

This fixes the failure at
https://pullrequest.opencv.org/buildbot/builders/precommit_docs/builds/31272.
2021-07-21 18:46:05 +03:00
..
android Make Kotlin plugin version compatible with the Gradle version 2021-06-08 22:51:07 +09:00
checks Update RISC-V back-end to RVV 0.10 2021-06-18 15:44:38 +08:00
FindCUDA
platforms cmake(js): update js targets 2020-12-03 14:18:54 +00:00
templates highgui: win32ui plugin 2021-06-19 13:15:46 +00:00
vars Merge pull request #20392 from fpetrogalli:aarch64-semihosting 2021-07-21 18:46:05 +03:00
cl2cpp.cmake
copy_files.cmake
FindCUDA.cmake
FindCUDNN.cmake Merge pull request #19452 from ctuu:patch-1 2021-02-10 19:38:34 +00:00
FindFlake8.cmake cmake: fix pylint/flake8 detection, update flake8 exclude 2021-01-29 17:06:54 +00:00
FindONNX.cmake Added small cmake fix 2020-11-19 21:22:19 +03:00
FindOpenVX.cmake
FindPylint.cmake cmake: update Python linters handling 2021-03-05 12:54:51 +00:00
FindVulkan.cmake
OpenCVCompilerDefenses.cmake
OpenCVCompilerOptimizations.cmake Added cmake toolchain for RISC-V with clang. 2020-08-03 20:18:56 +08:00
OpenCVCompilerOptions.cmake Merge pull request #19985 from fpetrogalli:disable_threads 2021-07-08 20:21:21 +00:00
OpenCVCRTLinkage.cmake
OpenCVDetectApacheAnt.cmake
OpenCVDetectCUDA.cmake Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-10-11 17:19:22 +00:00
OpenCVDetectCXXCompiler.cmake Added initial version of cmake toolchain for RISC-V architecture. 2020-04-27 12:42:38 +03:00
OpenCVDetectDirectX.cmake
OpenCVDetectHalide.cmake cmake: update Halide detection 2021-07-04 13:20:52 +03:00
OpenCVDetectInferenceEngine.cmake Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2021-07-03 00:30:58 +00:00
OpenCVDetectOpenCL.cmake Fixed and updated OpenCL-VA interoperability 2020-09-25 16:11:50 +03:00
OpenCVDetectPython.cmake fix: minor typo in CMakeCVDetectPython 2020-03-21 11:15:07 +02:00
OpenCVDetectTBB.cmake core(parallel): plugins support 2021-02-15 17:07:36 +00:00
OpenCVDetectTrace.cmake
OpenCVDetectVTK.cmake don't use VTK_USE_FILE for VTK >= 8.90 2020-09-06 15:47:43 -04:00
OpenCVDetectVulkan.cmake
OpenCVDownload.cmake Fix typo: 'DOWNLAOD' to 'DOWNLOAD' 2021-04-26 11:01:13 -04:00
OpenCVExtraTargets.cmake cmake: update generation of 'uninstall' target 2020-04-07 22:03:12 +00:00
OpenCVFindAtlas.cmake
OpenCVFindFrameworks.cmake
OpenCVFindIPP.cmake IPP: use linker workaround for Intel compiler on Linux 2021-04-02 10:44:32 +03:00
OpenCVFindIPPIW.cmake Merge pull request #16769 from mshabunin:fix-ipp-install 2020-04-17 14:28:42 +00:00
OpenCVFindLAPACK.cmake cmake: workaround oneAPI problem with -DMKL_WITH_TBB=ON 2021-02-03 19:41:54 +00:00
OpenCVFindLATEX.cmake
OpenCVFindLibsGrfmt.cmake Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2021-02-21 20:14:09 +00:00
OpenCVFindLibsGUI.cmake highgui: win32ui plugin 2021-06-19 13:15:46 +00:00
OpenCVFindLibsPerf.cmake IPP: use linker workaround for Intel compiler on Linux 2021-04-02 10:44:32 +03:00
OpenCVFindLibsVideo.cmake Fixed and updated OpenCL-VA interoperability 2020-09-25 16:11:50 +03:00
OpenCVFindMKL.cmake cmake: workaround oneAPI problem with -DMKL_WITH_TBB=ON 2021-02-03 19:41:54 +00:00
OpenCVFindOpenBLAS.cmake Fix typo in OpenCVFindOpenBLAS.cmake file. 2020-11-08 14:42:47 +01:00
OpenCVFindOpenEXR.cmake Merge pull request #19970 from antonio-rojas:master 2021-04-26 22:13:59 +00:00
OpenCVFindProtobuf.cmake cmake: fix protobuf handling 2020-04-27 02:11:19 +00:00
OpenCVFindTengine.cmake
OpenCVFindVA.cmake core(libva): use dynamic loader 2021-02-19 10:32:59 +00:00
OpenCVFindWebP.cmake
OpenCVFindXimea.cmake
OpenCVGenABI.cmake
OpenCVGenAndroidMK.cmake
OpenCVGenConfig.cmake Merge pull request #17165 from komakai:objc-binding 2020-06-08 18:32:53 +00:00
OpenCVGenHeaders.cmake
OpenCVGenInfoPlist.cmake Merge pull request #18826 from Rightpoint:feature/colejd/build-catalyst-xcframework 2020-11-24 21:54:54 +00:00
OpenCVGenPkgconfig.cmake
OpenCVGenSetupVars.cmake
OpenCVInstallLayout.cmake
OpenCVMinDepVersions.cmake highgui: backends and plugins 2021-05-24 16:12:02 +00:00
OpenCVModule.cmake highgui: backends and plugins 2021-05-24 16:12:02 +00:00
OpenCVPackaging.cmake Merge pull request #18073 from vpisarev:apache2_license 2020-08-17 11:49:11 +00:00
OpenCVPCHSupport.cmake
OpenCVPluginStandalone.cmake plugins: add suffix to default OUTPUT_NAME 2021-02-25 18:00:29 +03:00
OpenCVPylint.cmake cmake: update Python linters handling 2021-03-05 12:54:51 +00:00
OpenCVUtils.cmake cmake: use relative path for mode vars 2021-07-13 09:15:03 +00:00
OpenCVVersion.cmake