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 FIx misc. source and comment typos 2019-08-15 13:09:52 +03:00
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 cmake: don't add include <module>/src directory to avoid conflicts 2018-03-19 11:14:15 +03:00
copy_files.cmake cmake: fix android examples dependencies 2018-03-15 14:17:02 +03:00
FindCUDA.cmake Misc. typos 2018-07-31 18:44:23 +03:00
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 Updated OpenVX detector and wrappers to handle Reference attribute names change 2017-03-22 16:50:38 +03:00
FindPylint.cmake cmake: update Python linters handling 2021-03-05 12:54:51 +00:00
FindVulkan.cmake Merge pull request #12703 from wzw-intel:vkcom 2018-10-29 17:51:26 +03:00
OpenCVCompilerDefenses.cmake Added support for Clang build hardening (including Apple) 2019-05-07 13:00:43 +03:00
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 cmake: update handling of MSVC /MP flag 2020-02-11 21:05:44 +00:00
OpenCVDetectApacheAnt.cmake FIx misc. source and comment typos 2019-08-15 13:09:52 +03:00
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 Merge pull request #14294 from alalek:issue_14286 2019-04-11 17:50:15 +03:00
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 trace: initial support for code trace 2017-06-26 17:07:13 +03:00
OpenCVDetectVTK.cmake don't use VTK_USE_FILE for VTK >= 8.90 2020-09-06 15:47:43 -04:00
OpenCVDetectVulkan.cmake Merge pull request #12703 from wzw-intel:vkcom 2018-10-29 17:51:26 +03:00
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 moved BLAS/LAPACK detection scripts from opencv_contrib/dnn to the main repository (#7918) 2016-12-22 22:57:44 +03:00
OpenCVFindFrameworks.cmake Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-11-02 05:33:35 +00:00
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 Merge pull request #16832 from liqi-c:3.4-tengine-android 2020-03-20 10:10:39 +00:00
OpenCVFindVA.cmake core(libva): use dynamic loader 2021-02-19 10:32:59 +00:00
OpenCVFindWebP.cmake update CMakeList.txt 2018-02-05 16:23:52 +03:00
OpenCVFindXimea.cmake Merge pull request #13422 from mshabunin:split-videoio-cmake 2018-12-26 15:50:20 +03:00
OpenCVGenABI.cmake cmake: support OPENCV_ABI_SKIP_MODULES_LIST 2020-01-27 14:40:48 +03:00
OpenCVGenAndroidMK.cmake next(android): java3 -> java4 2018-04-10 18:09:54 +03:00
OpenCVGenConfig.cmake Merge pull request #17165 from komakai:objc-binding 2020-06-08 18:32:53 +00:00
OpenCVGenHeaders.cmake cmake: support multiple CPU targets 2017-02-13 19:52:59 +03:00
OpenCVGenInfoPlist.cmake Merge pull request #18826 from Rightpoint:feature/colejd/build-catalyst-xcframework 2020-11-24 21:54:54 +00:00
OpenCVGenPkgconfig.cmake cmake: update install paths (Linux) 2018-09-19 15:43:52 +03:00
OpenCVGenSetupVars.cmake Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-12-18 19:07:43 +00:00
OpenCVInstallLayout.cmake Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-09-20 21:11:49 +00:00
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 Fix pch generation when linker flags used with GCC 2019-12-10 14:55:56 +00:00
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 cmake: hide 'junk' dir from the root of build directory 2018-12-07 05:14:08 +00:00