diff --git a/cli/pyproject.toml b/cli/pyproject.toml index 75d74a7d6..9e81d9392 100644 --- a/cli/pyproject.toml +++ b/cli/pyproject.toml @@ -6,7 +6,7 @@ [tool.poetry] name = "cloe-launch" -version = "0.20.0" +version = "0.21.0" description = "Launch cloe-engine with Conan profiles." license = "Apache-2.0" authors = [ diff --git a/docs/changelog.rst b/docs/changelog.rst index 26145ce51..a07298652 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -58,6 +58,97 @@ readable perspective on new releases. Note that the most recent release is at the *top* of the document. + +0.21.0 (2024-02-02) +------------------- + +This is the fourth public minor release of the Cloe packages. +Read all about it :doc:`here `. + +**CLI:** + +- cli: Provide better error message when cloe-engine not found `[df14c510] `_ +- cli: Use VirtualRunEnv generator `[89703717] `_ +- cli: Fix incorrect prompt setting for Zsh `[56254fb7] `_ + +**Engine:** + +- engine: Add loop event `[9a288f7c] `_ +- engine: Use C++17 standard for compilation `[63368f7e] `_ + +**Core Libraries:** + +- fable: Add version.hpp `[e70e0361] `_ +- fable: Fix critical error using FromConfable as prototype schema `[808ead90] `_ +- fable: Instantiate missing Number `[475edfc3] `_ +- fable: Fix Conan not finding library in editable mode `[7ec17cc3] `_ +- fable: Fix compatibility issues with nlohmann_json 3.11 `[52b22257] `_ + +- models: Fix use of uninitialized mount_pose `[38647931] `_ + +- oak: Replace Boost shared_mutex, filesystem::path with std classes `[1c300b44] `_ +- oak: Replace cppnetlib with oatpp `[42a42ecb] `_ +- oak: Add several unit tests for server `[89dc9449] `_ +- oak: Refactor server.hpp to move impls to source file `[31718370] `_ +- oak: Fix bin path invalid for editable mode `[a183df39] `_ +- oak: Add header files to CMakeLists.txt for IDE integration `[e850d7de] `_ +- oak: Refactor RequestStub to its own private header file `[3873fe68] `_ + +- runtime: Add version.hpp `[8d5dbd74] `_ +- runtime: Propagate failure from BasicFileOutputStream::open_file `[5ba236e5] `_ + +**Plugins:** + +- gndtruth_extractor: Add smoketests with output comparison `[93714f05] `_ +- gndtruth_extractor: Fix segfault on error opening file `[0821655a] `_ + +- minimator: Fix use of uninitialized mount_pose `[fcb915b0] `_ +- minimator: Add new schema for minimator `[d15cffc] `_ + +- vtd: Fix clang-tidy suggestions regarding includes `[ac7b4de4] `_ +- vtd: Migrate cloe-plugin-vtd package to Conan 2.0 compatibility `[ca03adeb] `_ +- vtd: Migrate osi-sensor package to Conan 2.0 compatibility `[726fbf64] `_ +- vtd: Migrate vtd-2022.3 package to Conan 2.0 compatibility `[090ff6d3] `_ +- vtd: Migrate vtd-2.2.0 package to Conan 2.0 compatibility `[0eceaafb] `_ +- vtd: Migrate protobuf library to Conan 2.0 compatibility `[b89bc756] `_ +- vtd: Migrate open-simulation-interface to Conan 2.0 compatibility `[dca0ef83] `_ +- vtd: Fix ridiculous mistake from da467430c5 `[7bea95ba] `_ +- vtd: Fix potential bug in vehicle creation `[b5fb1006] `_ +- vtd: Fix typo in README `[f1c5f1f6] `_ +- vtd: Change dockerfile to support ubuntu2004 `[58bef791] `_ +- vtd: Fix missing f string in conanfiles `[02cec5b8] `_ +- vtd: Update vtd-api packages for 2.0 compatibility `[da467430] `_ + +**Web UI:** + +- ui: Add proper file type for gzip upload `[32ea6fad] `_ +- ui: Fix fetch interval `[e91e768a] `_ +- ui: Change HMI trigger endpoint to 'next' `[a1c4126f] `_ + +**Tooling & Dependencies:** + +- all: Remove outdated ifndef-define-endif header guards `[98632840] `_ +- all: Bump inja, nlohmann_json, spdlog, fmt, gtest, cli11 versions `[5d646b1c] `_ +- all: Bump required C++ standard from 14 to 17 `[fe678bca] `_ +- all: Remove constraints on Boost version from cppnetlib `[2fabcaa9] `_ +- ci: Improve performance of Github CI jobs `[b13c7182] `_ ci: Remove ubuntu-18.04 from Github workflows `[47cec675] `_ +- tests: Don't fail when *.so glob doesn't match anything `[88a92dca] `_ +- tests: Depend on cloe-launch-profile >= 0.20 `[c6aaea2b] `_ +- tests: Replace testname arg quotes with single quotes `[637f44cf] `_ +- tooling: Add cloe-normal Conan profile `[1893b91f] `_ +- tooling: Fix error in Makefile.setup `[c234f50d] `_ +- tooling: Clean up editorconfig `[63190730] `_ +- tooling: Bundle licenses with cloe-engine Conan package `[6b9b419f] `_ +- tooling: Install conan<2 instead of plain conan `[5400d3c6] `_ +- tooling: Don't warn when using assert() `[d8bbe8a7] `_ +- tooling: Add clang-tidy configuration `[f7bde820] `_ +- tooling: Fix configure target from Makefile.package not working `[19dbccaf] `_ +- tooling: Fix runtime cmake path incorrectly set for editable `[aadfa06a] `_ +- tooling: Remove obsolete conan layout file `[f031655d] `_ +- tooling: Export cloe-launch-profile as part of export and package targets `[0ac5224b] `_ +- tooling: Ensure minimum GCC version of 8 `[4a9bbbfb] `_ +- vendor: Remove cppnetlib `[b8a75a14] `_ + 0.20.0 (2023-04-03) ------------------- diff --git a/docs/contributing/creating-a-new-release.rst b/docs/contributing/creating-a-new-release.rst index 50766636c..7f2a9575a 100644 --- a/docs/contributing/creating-a-new-release.rst +++ b/docs/contributing/creating-a-new-release.rst @@ -18,8 +18,8 @@ released. .. highlight:: bash -Update Github Milestone ------------------------ +A. Update Github Milestone +-------------------------- 1. There should be a `milestone `_ named the precise version ``X.Y.Z`` that shall be released. @@ -45,8 +45,8 @@ Update Github Milestone Feel free to create a draft pull request from this branch if you want early feedback. Assign this pull request to the milestone. -Build Conan Packages --------------------- +B. Build Conan Packages +----------------------- First, set the ``VERSION`` file to ``X.Y.Z``:: @@ -55,9 +55,16 @@ First, set the ``VERSION`` file to ``X.Y.Z``:: This is fudging the version in order to generate better documentation, so we need to be careful to remove this before actually making a release. +In order to isolate the packages from existing ones, it is highly recommended +to use a separate, temporary Conan data directory:: + + export CONAN_USER_HOME=~/.var/cloe-X.Y.Z + mkdir $CONAN_USER_HOME + make setup-conan + Then, compile the entire project locally:: - make purge-all export-vendor export smoketest-deps smoketest + make purge-all export smoketest-deps smoketest This should run through without errors. Then make sure to do the same with the optional packages:: @@ -67,8 +74,8 @@ the optional packages:: We will not be releasing these packages, they are used for documentation generation. -Update the Documentation ------------------------- +C. Update the Documentation +--------------------------- Places in the documentation which require attention at every release have a ``TODO(release)`` comment which explains what needs to be done. @@ -80,8 +87,8 @@ This includes the documentation for the following steps: 2. Update the changelog 3. Write a release news article -Bump Versions Strings ---------------------- +D. Bump Versions Strings +------------------------ For now we are releasing all parts of Cloe in lock-step, even though they are separate packages sometimes. @@ -105,3 +112,48 @@ like ripgrep to search the project for strings containing ``0.19``. there is example output, it may be better to just leave it as is, unless we expect the content to signficantly change, in which case we should regenerate the example output. + +E. Create and Merge Pull Request +-------------------------------- + +From the branch that we created in step A3, create a new pull request to the +master branch. If you had a draft pull request, convert it to "ready for review". + +In addition to the CI checks, run the Docker builds on your local machine:: + + make -f Makefile.docker all + +Once this has been reviewed and approved and the CI checks have run through, +rebase and merge. + +F. Create New Git Tag +--------------------- + +On your local machine, check out the master branch und pull from Github. +You should now have all the changes from the pull request that got merged in +step E. + +Create a new tag for the release, with the following command:: + + git tag -a vX.Y.Z -m "Cloe version X.Y.Z release" + +Replace ``X.Y.Z`` with the corresponding values. + +Then, push the tag to Github:: + + git push vX.Y.Z + +G. Trigger Read-the-Docs +------------------------ + +.. note:: + This step should be automatic now, but you should check that + everything completed successfully. + +Login to `ReadTheDocs `_ and goto the +`Cloe Builds `_ page. + +Trigger the latest build. This should also pick up on the new tag +and add that to the active versions. Check that this is the case. + +Check the generated website and verify that everything is as it should be. diff --git a/docs/news.rst b/docs/news.rst index 792ab8a56..d5b31731f 100644 --- a/docs/news.rst +++ b/docs/news.rst @@ -23,9 +23,32 @@ News :hidden: :maxdepth: 1 + news/release-0.21.0 news/release-0.20.0 news/release-0.19.0 +:doc:`Version 0.21.0 Release ` +--------------------------------------------------- + +This version includes fixes and other improvements and represents +a continuation of the previous releases before breaking changes +are introduced in the next few releases. + +Oat++ replaces the cppnetlib library, which allows us to remove +any constraints regarding the version of Boost that can be used. + +The launcher now provides a better error message when the engine +cannot be located and issues with the Zsh prompt are fixed. + +The web UI can insert triggers again. + +Two significant bugs in the fable library have been fixed. + +Finally, many small development and tooling changes are included +in the release, but should not be relevant for end-users. + +Read all about it :doc:`here `. + :doc:`Version 0.20.0 Release ` --------------------------------------------------- diff --git a/docs/news/release-0.21.0.md b/docs/news/release-0.21.0.md new file mode 100644 index 000000000..84c2345cc --- /dev/null +++ b/docs/news/release-0.21.0.md @@ -0,0 +1,129 @@ +# Version 0.21.0 Release + +This version comprises various fixes and improvements but no major changes, +except that C++17 is now the minimum required C++ standard and the +cppnetlib dependency has been replaced with Oat++. + +The next few releases will contain breaking changes, so this one acts as +a small incremental step before these are released. In particular, this release +also introduces the `version.hpp` header to the `fable` and `cloe-runtime` +packages, which enables developers to more easily support multiple versions at +the same time. + +For the entire changelog, see the [Git commit history](https://github.com/eclipse/cloe/compare/v0.20.0...v0.21.0). + +## Launcher + +Changed: + +- Use `VirtualRunEnv` Conan generator, which is the current recommended approach + and should be compatible with Conan 2.0. + +Improved: + +- Provide better error messages when cloe-engine is not found. + + The Python stack trace is suppressed, since it's not useful, and instead a + message is printed telling you what could be wrong: + + Error: cannot locate cloe-engine exectuable! + Note: + This problem usually stems from one of two common errors: + - The conanfile for cloe-launch does not require cloe-engine. + - The cloe-engine package or binary has not been built / is corrupted. + However, unconvential or unsupported package configuration may also trigger this. + +Fixed: + +- Fix prompt in Zsh when in a cloe-launch shell. + +## Engine + +New: + +- Add the `loop` event that triggers every single cycle, including in the pause state. + +Improved: + +- Replace libcppnetlib with Oat++ as webserver backend. + + This means that we are no longer limited in which Boost versions we support. + (Previously, with the `server` feature enable, the Boost version had to be + between 1.65 and 1.69.) + +## Web UI + +Fixed: + +- Fix failure uploading json.gz to the UI +- Fix certain actions not applying when trying to trigger the HMI + +## Fable Library + +Fixed: + +- Instantiate missing `Number`. + + It is no longer necessary to include `fable/schema/number_impl.hpp` when using this + numerical type. +- Fix `FromConfable` schemas occassionaly causing a segfault. + + Error can be categorized as a use-after-free. + +## Plugins + +New: + +- Add new schema to minimator plugin to specify objects and properties. + +Fixed: + +- Fix segfault when gndtruth-extractor plugin had an error opening the output file. +- Fix use of uninitialized `mount_pose` variable. + +## Development + +New: + +- Add `version.hpp` header to `fable` library. + + This can be used to make compile-time decisions for greater compatibility with + various versions of the library. +- Add `version.hpp` header to `cloe-runtime` library. + + This can be used to make compile-time decisions for greater compatibility with + various versions of the library. +- Add Clang Tidy configuration file + +Improved: + +- Speed up builds by changing default build type from `RelWithDebInfo` to `Debug`. +- Bundle licenses of dependencies with `cloe-engine` Conan package. + +Changed: + +- Change `configure` target in `Makefile.package` to link `compile_commands.json` automatically +- Remove `conan-select` target from `Makefile.all` +- Remove `conan` target from `Makefile.package` +- Require C++17 for compiling the project. + + The oldest supported version of Ubuntu has a new enough compiler to support this + change, so we don't expect anyone to have any problems with this. +- Update dependencies to latest stable versions. + + They are now also pinned to specific versions, since this results in a much more + stable experience with Conan. This is also how it is done in the Conan-Center-Index. +- Remove all ifndef-define-endif header guards. Use `#pragma once` instead. + + Our dependencies already require support for `#pragma once`, which is effectively + universal anyway. +- Remove Ubuntu 18.04 from automated builds. This means it is no longer officially + supported. +- Improve Conan 2.0 support across the board for package recipes. + +Fixed: + +- Fix `setup-conan` target in `Makefile.setup` to install Conan version 1.x +- Fix recipes to respect Conan `--build`, `--test`, `--configure`, and `--install` arguments +- Test configurations depend on any compatible version of cloe-launch-profile +- Don't fail test when *.so glob does not match anything diff --git a/docs/reference/plugins/basic.yaml b/docs/reference/plugins/basic.yaml index 32316b091..ae6d07d15 100644 --- a/docs/reference/plugins/basic.yaml +++ b/docs/reference/plugins/basic.yaml @@ -1,6 +1,6 @@ Name: basic Type: controller -Path: ~/.conan/data/cloe-plugin-basic/0.20.0/cloe/develop/package/498421a99d2afdb65ec3f6555b924a691c6b5f97/lib/cloe/controller_basic.so +Path: ~/.conan/data/cloe-plugin-basic/0.21.0/cloe/develop/package/6352d57f4a7e8dd08c53120788e741395b18563e/lib/cloe/controller_basic.so Usage: { "acc": "object :: ACC configuration", "aeb": "object :: AEB configuration", diff --git a/docs/reference/plugins/basic_schema.json b/docs/reference/plugins/basic_schema.json index 78f905ec4..5e15b939d 100644 --- a/docs/reference/plugins/basic_schema.json +++ b/docs/reference/plugins/basic_schema.json @@ -1,5 +1,5 @@ { - "$id": "~/.conan/data/cloe-plugin-basic/0.20.0/cloe/develop/package/498421a99d2afdb65ec3f6555b924a691c6b5f97/lib/cloe/controller_basic.so", + "$id": "~/.conan/data/cloe-plugin-basic/0.21.0/cloe/develop/package/6352d57f4a7e8dd08c53120788e741395b18563e/lib/cloe/controller_basic.so", "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "description": "very basic vehicle controller", diff --git a/docs/reference/plugins/demo_printer.yaml b/docs/reference/plugins/demo_printer.yaml index 0f5cc6a3a..3188469ed 100644 --- a/docs/reference/plugins/demo_printer.yaml +++ b/docs/reference/plugins/demo_printer.yaml @@ -1,5 +1,5 @@ Name: demo_printer Type: controller -Path: ~/.conan/data/cloe-plugin-mocks/0.20.0/cloe/develop/package/498421a99d2afdb65ec3f6555b924a691c6b5f97/lib/cloe/controller_demo_printer.so +Path: ~/.conan/data/cloe-plugin-mocks/0.21.0/cloe/develop/package/6352d57f4a7e8dd08c53120788e741395b18563e/lib/cloe/controller_demo_printer.so Usage: null Defaults: {} diff --git a/docs/reference/plugins/demo_printer_schema.json b/docs/reference/plugins/demo_printer_schema.json index 6d8e78f0a..7e1a46421 100644 --- a/docs/reference/plugins/demo_printer_schema.json +++ b/docs/reference/plugins/demo_printer_schema.json @@ -1,5 +1,5 @@ { - "$id": "~/.conan/data/cloe-plugin-mocks/0.20.0/cloe/develop/package/498421a99d2afdb65ec3f6555b924a691c6b5f97/lib/cloe/controller_demo_printer.so", + "$id": "~/.conan/data/cloe-plugin-mocks/0.21.0/cloe/develop/package/6352d57f4a7e8dd08c53120788e741395b18563e/lib/cloe/controller_demo_printer.so", "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "description": "print a lot of information", diff --git a/docs/reference/plugins/demo_stuck.yaml b/docs/reference/plugins/demo_stuck.yaml index d8ec26727..e4098144f 100644 --- a/docs/reference/plugins/demo_stuck.yaml +++ b/docs/reference/plugins/demo_stuck.yaml @@ -1,6 +1,6 @@ Name: demo_stuck Type: controller -Path: ~/.conan/data/cloe-plugin-mocks/0.20.0/cloe/develop/package/498421a99d2afdb65ec3f6555b924a691c6b5f97/lib/cloe/controller_demo_stuck.so +Path: ~/.conan/data/cloe-plugin-mocks/0.21.0/cloe/develop/package/6352d57f4a7e8dd08c53120788e741395b18563e/lib/cloe/controller_demo_stuck.so Usage: { "halt_progress_at": "integer :: time in ns at which to halt all progress", "progress_per_step": "integer :: progress to make each step" diff --git a/docs/reference/plugins/demo_stuck_schema.json b/docs/reference/plugins/demo_stuck_schema.json index 9ab0202f7..094bc02b7 100644 --- a/docs/reference/plugins/demo_stuck_schema.json +++ b/docs/reference/plugins/demo_stuck_schema.json @@ -1,5 +1,5 @@ { - "$id": "~/.conan/data/cloe-plugin-mocks/0.20.0/cloe/develop/package/498421a99d2afdb65ec3f6555b924a691c6b5f97/lib/cloe/controller_demo_stuck.so", + "$id": "~/.conan/data/cloe-plugin-mocks/0.21.0/cloe/develop/package/6352d57f4a7e8dd08c53120788e741395b18563e/lib/cloe/controller_demo_stuck.so", "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "description": "slowly progressing demo controller", diff --git a/docs/reference/plugins/gndtruth_extractor.yaml b/docs/reference/plugins/gndtruth_extractor.yaml index d7193bb5e..1bd225267 100644 --- a/docs/reference/plugins/gndtruth_extractor.yaml +++ b/docs/reference/plugins/gndtruth_extractor.yaml @@ -1,6 +1,6 @@ Name: gndtruth_extractor Type: controller -Path: ~/.conan/data/cloe-plugin-gndtruth-extractor/0.20.0/cloe/develop/package/498421a99d2afdb65ec3f6555b924a691c6b5f97/lib/cloe/controller_gndtruth_extractor.so +Path: ~/.conan/data/cloe-plugin-gndtruth-extractor/0.21.0/cloe/develop/package/6352d57f4a7e8dd08c53120788e741395b18563e/lib/cloe/controller_gndtruth_extractor.so Usage: { "components": "array of string :: array of components to be extracted", "output_file": "string :: file path to write groundtruth output to", diff --git a/docs/reference/plugins/gndtruth_extractor_schema.json b/docs/reference/plugins/gndtruth_extractor_schema.json index 5c4b7f86f..012069eb1 100644 --- a/docs/reference/plugins/gndtruth_extractor_schema.json +++ b/docs/reference/plugins/gndtruth_extractor_schema.json @@ -1,5 +1,5 @@ { - "$id": "~/.conan/data/cloe-plugin-gndtruth-extractor/0.20.0/cloe/develop/package/498421a99d2afdb65ec3f6555b924a691c6b5f97/lib/cloe/controller_gndtruth_extractor.so", + "$id": "~/.conan/data/cloe-plugin-gndtruth-extractor/0.21.0/cloe/develop/package/6352d57f4a7e8dd08c53120788e741395b18563e/lib/cloe/controller_gndtruth_extractor.so", "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "description": "extracts information from the simulation", diff --git a/docs/reference/plugins/minimator.yaml b/docs/reference/plugins/minimator.yaml index d5a0a5d43..a518ae538 100644 --- a/docs/reference/plugins/minimator.yaml +++ b/docs/reference/plugins/minimator.yaml @@ -1,6 +1,6 @@ Name: minimator Type: simulator -Path: ~/.conan/data/cloe-plugin-minimator/0.20.0/cloe/develop/package/498421a99d2afdb65ec3f6555b924a691c6b5f97/lib/cloe/simulator_minimator.so +Path: ~/.conan/data/cloe-plugin-minimator/0.21.0/cloe/develop/package/6352d57f4a7e8dd08c53120788e741395b18563e/lib/cloe/simulator_minimator.so Usage: { "vehicles": "array of string :: list of vehicle names to make available" } diff --git a/docs/reference/plugins/minimator_schema.json b/docs/reference/plugins/minimator_schema.json index 30c29c379..c5262b54d 100644 --- a/docs/reference/plugins/minimator_schema.json +++ b/docs/reference/plugins/minimator_schema.json @@ -1,5 +1,5 @@ { - "$id": "~/.conan/data/cloe-plugin-minimator/0.20.0/cloe/develop/package/498421a99d2afdb65ec3f6555b924a691c6b5f97/lib/cloe/simulator_minimator.so", + "$id": "~/.conan/data/cloe-plugin-minimator/0.21.0/cloe/develop/package/6352d57f4a7e8dd08c53120788e741395b18563e/lib/cloe/simulator_minimator.so", "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "description": "minimalistic simulator", diff --git a/docs/reference/plugins/noisy_lane_sensor.yaml b/docs/reference/plugins/noisy_lane_sensor.yaml index f36668cf9..99ea22f94 100644 --- a/docs/reference/plugins/noisy_lane_sensor.yaml +++ b/docs/reference/plugins/noisy_lane_sensor.yaml @@ -1,6 +1,6 @@ Name: noisy_lane_sensor Type: component -Path: ~/.conan/data/cloe-plugin-noisy-sensor/0.20.0/cloe/develop/package/498421a99d2afdb65ec3f6555b924a691c6b5f97/lib/cloe/component_noisy_lane_sensor.so +Path: ~/.conan/data/cloe-plugin-noisy-sensor/0.21.0/cloe/develop/package/6352d57f4a7e8dd08c53120788e741395b18563e/lib/cloe/component_noisy_lane_sensor.so Usage: { "enable": "boolean :: enable or disable component", "noise": "array of object :: configure noisy parameters", diff --git a/docs/reference/plugins/noisy_lane_sensor_schema.json b/docs/reference/plugins/noisy_lane_sensor_schema.json index b08cd7270..b73149c77 100644 --- a/docs/reference/plugins/noisy_lane_sensor_schema.json +++ b/docs/reference/plugins/noisy_lane_sensor_schema.json @@ -1,5 +1,5 @@ { - "$id": "~/.conan/data/cloe-plugin-noisy-sensor/0.20.0/cloe/develop/package/498421a99d2afdb65ec3f6555b924a691c6b5f97/lib/cloe/component_noisy_lane_sensor.so", + "$id": "~/.conan/data/cloe-plugin-noisy-sensor/0.21.0/cloe/develop/package/6352d57f4a7e8dd08c53120788e741395b18563e/lib/cloe/component_noisy_lane_sensor.so", "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "description": "add gaussian noise to lane sensor output", diff --git a/docs/reference/plugins/noisy_object_sensor.yaml b/docs/reference/plugins/noisy_object_sensor.yaml index 42ee3b915..dc35be09a 100644 --- a/docs/reference/plugins/noisy_object_sensor.yaml +++ b/docs/reference/plugins/noisy_object_sensor.yaml @@ -1,6 +1,6 @@ Name: noisy_object_sensor Type: component -Path: ~/.conan/data/cloe-plugin-noisy-sensor/0.20.0/cloe/develop/package/498421a99d2afdb65ec3f6555b924a691c6b5f97/lib/cloe/component_noisy_object_sensor.so +Path: ~/.conan/data/cloe-plugin-noisy-sensor/0.21.0/cloe/develop/package/6352d57f4a7e8dd08c53120788e741395b18563e/lib/cloe/component_noisy_object_sensor.so Usage: { "enable": "boolean :: enable or disable component", "noise": "array of object :: configure noisy parameters", diff --git a/docs/reference/plugins/noisy_object_sensor_schema.json b/docs/reference/plugins/noisy_object_sensor_schema.json index 9ea8eed86..9c97584ed 100644 --- a/docs/reference/plugins/noisy_object_sensor_schema.json +++ b/docs/reference/plugins/noisy_object_sensor_schema.json @@ -1,5 +1,5 @@ { - "$id": "~/.conan/data/cloe-plugin-noisy-sensor/0.20.0/cloe/develop/package/498421a99d2afdb65ec3f6555b924a691c6b5f97/lib/cloe/component_noisy_object_sensor.so", + "$id": "~/.conan/data/cloe-plugin-noisy-sensor/0.21.0/cloe/develop/package/6352d57f4a7e8dd08c53120788e741395b18563e/lib/cloe/component_noisy_object_sensor.so", "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "description": "add gaussian noise to object sensor output", diff --git a/docs/reference/plugins/speedometer.yaml b/docs/reference/plugins/speedometer.yaml index 5a4a8efcb..921bd9c02 100644 --- a/docs/reference/plugins/speedometer.yaml +++ b/docs/reference/plugins/speedometer.yaml @@ -1,5 +1,5 @@ Name: speedometer Type: component -Path: ~/.conan/data/cloe-plugin-speedometer/0.20.0/cloe/develop/package/498421a99d2afdb65ec3f6555b924a691c6b5f97/lib/cloe/component_speedometer.so +Path: ~/.conan/data/cloe-plugin-speedometer/0.21.0/cloe/develop/package/6352d57f4a7e8dd08c53120788e741395b18563e/lib/cloe/component_speedometer.so Usage: null Defaults: {} diff --git a/docs/reference/plugins/speedometer_schema.json b/docs/reference/plugins/speedometer_schema.json index 5eda1ef2a..b2943b130 100644 --- a/docs/reference/plugins/speedometer_schema.json +++ b/docs/reference/plugins/speedometer_schema.json @@ -1,5 +1,5 @@ { - "$id": "~/.conan/data/cloe-plugin-speedometer/0.20.0/cloe/develop/package/498421a99d2afdb65ec3f6555b924a691c6b5f97/lib/cloe/component_speedometer.so", + "$id": "~/.conan/data/cloe-plugin-speedometer/0.21.0/cloe/develop/package/6352d57f4a7e8dd08c53120788e741395b18563e/lib/cloe/component_speedometer.so", "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "description": "provide an event trigger to evaluate speed in km/h", diff --git a/docs/reference/plugins/virtue.yaml b/docs/reference/plugins/virtue.yaml index 152d1dcdb..6c2210271 100644 --- a/docs/reference/plugins/virtue.yaml +++ b/docs/reference/plugins/virtue.yaml @@ -1,6 +1,6 @@ Name: virtue Type: controller -Path: ~/.conan/data/cloe-plugin-virtue/0.20.0/cloe/develop/package/498421a99d2afdb65ec3f6555b924a691c6b5f97/lib/cloe/controller_virtue.so +Path: ~/.conan/data/cloe-plugin-virtue/0.21.0/cloe/develop/package/6352d57f4a7e8dd08c53120788e741395b18563e/lib/cloe/controller_virtue.so Usage: { "init_phase": "integer :: time during which initialization is performed", "lane_sensor_components": "array of string :: array of lane-sensor components to be checked" diff --git a/docs/reference/plugins/virtue_schema.json b/docs/reference/plugins/virtue_schema.json index d6310e07c..333ea4f53 100644 --- a/docs/reference/plugins/virtue_schema.json +++ b/docs/reference/plugins/virtue_schema.json @@ -1,5 +1,5 @@ { - "$id": "~/.conan/data/cloe-plugin-virtue/0.20.0/cloe/develop/package/498421a99d2afdb65ec3f6555b924a691c6b5f97/lib/cloe/controller_virtue.so", + "$id": "~/.conan/data/cloe-plugin-virtue/0.21.0/cloe/develop/package/6352d57f4a7e8dd08c53120788e741395b18563e/lib/cloe/controller_virtue.so", "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "description": "performs various quality assurance measures", diff --git a/optional/vtd/CMakeLists.txt b/optional/vtd/CMakeLists.txt index e96988c40..7e77f4a20 100644 --- a/optional/vtd/CMakeLists.txt +++ b/optional/vtd/CMakeLists.txt @@ -7,7 +7,8 @@ find_package(vtd-api REQUIRED) find_package(cloe-runtime REQUIRED) find_package(cloe-models REQUIRED) find_package(Boost REQUIRED) -find_package(open-simulation-interface REQUIRED) +find_package(open_simulation_interface REQUIRED) +find_package(Protobuf REQUIRED) add_library(vtd-object-lib STATIC src/omni_sensor_component.cpp @@ -22,13 +23,17 @@ add_library(vtd-object-lib STATIC src/scp_messages.cpp src/scp_transceiver.cpp ) +target_include_directories(vtd-object-lib + PRIVATE + protobuf::libprotobuf +) target_link_libraries(vtd-object-lib PUBLIC vtd::api cloe::runtime cloe::models Boost::boost - open-simulation-interface::open-simulation-interface + open_simulation_interface::open_simulation_interface ) set_target_properties(vtd-object-lib PROPERTIES diff --git a/optional/vtd/Makefile b/optional/vtd/Makefile index fc446967e..d7bf853b4 100644 --- a/optional/vtd/Makefile +++ b/optional/vtd/Makefile @@ -17,7 +17,7 @@ UNSELECT_VENDOR := ${WITHOUT_VENDOR} WITH_VENDOR := SELECT_VENDOR := $(call uniq, $(filter-out ${UNSELECT_VENDOR}, ${ALL_VENDOR}) ${WITH_VENDOR}) -vendor/osi-sensor-1.0.0-vtd2.2: vendor/vtd-2.2.0 vendor/open-simulation-interface-3.0.1 +vendor/osi-sensor-1.0.0: vendor/vtd-2.2.0 vendor/open-simulation-interface-3.0.1 vendor/open-simulation-interface-3.0.1: vendor/protobuf-2.6.1 vendor/open-simulation-interface-3.2.0: vendor/protobuf-2.6.1 diff --git a/optional/vtd/conanfile.py b/optional/vtd/conanfile.py index 44c310552..edbc3c0d3 100644 --- a/optional/vtd/conanfile.py +++ b/optional/vtd/conanfile.py @@ -18,12 +18,6 @@ class CloeSimulatorVTD(ConanFile): description = "Cloe simulator plugin that binds to Vires VTD" license = "Apache-2.0" settings = "os", "compiler", "build_type", "arch" - options = { - "pedantic": [True, False], - } - default_options = { - "pedantic": True, - } generators = "CMakeDeps", "VirtualRunEnv" no_copy_source = True exports_sources = [ @@ -37,6 +31,8 @@ class CloeSimulatorVTD(ConanFile): _setup_folder = "contrib/setups" def set_version(self): + # Check for both VERSION and ../../VERSION because when building inside + # Docker only the plugin directory is exported. for version_path in ["VERSION", "../../VERSION"]: version_file = Path(self.recipe_folder) / version_path if version_file.exists(): @@ -73,7 +69,7 @@ def reset(tarinfo): if not dir.is_dir(): return - # Compressing will add a timestamp to the package and therefore + # Compressing will add a timestamp to the package and therefore # leads to different package_hashes everytime we export with conan. # To avoid that, changing from .tgz to .tar was necessary with tarfile.open(f"{dir.name}.tar", "w:") as tar: @@ -107,7 +103,6 @@ def generate(self): tc = cmake.CMakeToolchain(self) tc.cache_variables["CMAKE_EXPORT_COMPILE_COMMANDS"] = True tc.cache_variables["CLOE_PROJECT_VERSION"] = self.version - tc.cache_variables["TargetLintingExtended"] = self.options.pedantic tc.generate() def build(self): @@ -145,8 +140,5 @@ def package_info(self): self.cpp_info.set_property("cmake_find_mode", "both") self.cpp_info.set_property("cmake_file_name", "cloe-plugin-vtd") self.cpp_info.set_property("pkg_config_name", "cloe-plugin-vtd") - self.env_info.VTD_LAUNCH = f"{self.package_folder}/bin/vtd-launch" - self.env_info.VTD_SETUP_DIR = f"{self.package_folder}/{self._setup_folder}" - - def package_id(self): - del self.info.options.pedantic + self.runenv_info.define("VTD_LAUNCH", f"{self.package_folder}/bin/vtd-launch") + self.runenv_info.define("VTD_SETUP_DIR", f"{self.package_folder}/{self._setup_folder}") diff --git a/optional/vtd/src/osi_ground_truth.cpp b/optional/vtd/src/osi_ground_truth.cpp index b2a48a4ea..17eb76ddd 100644 --- a/optional/vtd/src/osi_ground_truth.cpp +++ b/optional/vtd/src/osi_ground_truth.cpp @@ -22,9 +22,8 @@ #include "osi_ground_truth.hpp" // for OsiGroundTruth -#include // for ModelError - -#include "osi_object.pb.h" // for MovingObject +#include // for MovingObject +#include // for ModelError namespace osii { diff --git a/optional/vtd/src/osi_ground_truth.hpp b/optional/vtd/src/osi_ground_truth.hpp index 1895bcd38..f2dd0798c 100644 --- a/optional/vtd/src/osi_ground_truth.hpp +++ b/optional/vtd/src/osi_ground_truth.hpp @@ -22,12 +22,12 @@ #pragma once -#include // for Vector3d +#include // for Vector3d -#include // for ModelError +#include // for GroundTruth +#include // for MovingObject -#include "osi_groundtruth.pb.h" // for GroundTruth -#include "osi_object.pb.h" // for MovingObject +#include // for ModelError #include "osi_utils.hpp" // for osi_require, .. diff --git a/optional/vtd/src/osi_omni_sensor.cpp b/optional/vtd/src/osi_omni_sensor.cpp index fc1d64346..d6281a992 100644 --- a/optional/vtd/src/osi_omni_sensor.cpp +++ b/optional/vtd/src/osi_omni_sensor.cpp @@ -23,9 +23,7 @@ #include "osi_omni_sensor.hpp" #include // for atan -#include // for max #include // for assert -#include // for map<> #include // for Isometry3d, Vector3d @@ -35,12 +33,12 @@ #include // for ModelError #include // for quaternion_from_rpy -#include "osi_common.pb.h" // for Timestamp, Identifier, BaseMoving, .. -#include "osi_detectedobject.pb.h" // for DetectedMovingObject -#include "osi_hostvehicledata.pb.h" // for HostVehicleData -#include "osi_object.pb.h" // for MovingObject -#include "osi_sensordata.pb.h" // for SensorData, DetectedEntityHeader -#include "osi_sensorview.pb.h" // for SensorView +#include // for Timestamp, Identifier, BaseMoving, .. +#include // for DetectedMovingObject +#include // for HostVehicleData +#include // for MovingObject +#include // for SensorData, DetectedEntityHeader +#include // for SensorView #include "osi_ground_truth.hpp" // for OsiGroundTruth #include "osi_utils.hpp" // for osi_require, .. diff --git a/optional/vtd/src/osi_omni_sensor.hpp b/optional/vtd/src/osi_omni_sensor.hpp index 5d481c8e8..97a71c992 100644 --- a/optional/vtd/src/osi_omni_sensor.hpp +++ b/optional/vtd/src/osi_omni_sensor.hpp @@ -22,10 +22,7 @@ #pragma once -#include // for map<> #include // for shared_ptr<>, unique_ptr<> -#include // for string -#include // for move #include // for Isometry3d, Vector3d @@ -35,15 +32,14 @@ #include // for ModelError #include // for Sync -#include "osi_common.pb.h" // for Timestamp, Identifier, BaseMoving, .. -#include "osi_detectedobject.pb.h" // for DetectedMovingObject -#include "osi_hostvehicledata.pb.h" // for HostVehicleData -#include "osi_object.pb.h" // for MovingObject -#include "osi_sensordata.pb.h" // for SensorData, DetectedEntityHeader +#include // for Timestamp, Identifier, BaseMoving, .. +#include // for DetectedMovingObject +#include // for HostVehicleData +#include // for MovingObject +#include // for SensorData, DetectedEntityHeader #include "osi_ground_truth.hpp" // for OsiGroundTruth #include "osi_transceiver.hpp" // for OsiTransceiver -#include "osi_utils.hpp" namespace osii { diff --git a/optional/vtd/src/osi_test.cpp b/optional/vtd/src/osi_test.cpp index 2eede5e58..6d94dde41 100644 --- a/optional/vtd/src/osi_test.cpp +++ b/optional/vtd/src/osi_test.cpp @@ -31,8 +31,8 @@ #include // for Object #include // for quaternion_from_rpy -#include "osi_common.pb.h" // for Orientation3D, BaseMoving, .. -#include "osi_object.pb.h" // for MovingObject +#include // for Orientation3D, BaseMoving, .. +#include // for MovingObject #include "osi_omni_sensor.hpp" // for transform_ego_coord_from_osi_data, ... #include "osi_utils.hpp" // for pose_to_osi_position_orientation, ... diff --git a/optional/vtd/src/osi_transceiver.hpp b/optional/vtd/src/osi_transceiver.hpp index a588a5254..c25db53d0 100644 --- a/optional/vtd/src/osi_transceiver.hpp +++ b/optional/vtd/src/osi_transceiver.hpp @@ -22,12 +22,9 @@ #pragma once -#include // for shared_ptr<> -#include // for vector<> - #include // for Json, Error -#include // for SensorData +#include // for SensorData namespace osii { diff --git a/optional/vtd/src/osi_transceiver_tcp.cpp b/optional/vtd/src/osi_transceiver_tcp.cpp index a701333bc..f6555c2f9 100644 --- a/optional/vtd/src/osi_transceiver_tcp.cpp +++ b/optional/vtd/src/osi_transceiver_tcp.cpp @@ -21,7 +21,6 @@ #include "osi_transceiver_tcp.hpp" -#include // for assert #include // for malloc, free #include // for shared_ptr<> @@ -31,7 +30,7 @@ #include // for CodedInputStream #include // for ArrayInputStream -#include "osi_sensordata.pb.h" // for SensorData +#include // for SensorData namespace osii { diff --git a/optional/vtd/src/osi_transceiver_tcp.hpp b/optional/vtd/src/osi_transceiver_tcp.hpp index c7b09a593..29fecd29c 100644 --- a/optional/vtd/src/osi_transceiver_tcp.hpp +++ b/optional/vtd/src/osi_transceiver_tcp.hpp @@ -23,7 +23,6 @@ #pragma once #include // for shared_ptr<> -#include // for string #include // for vector<> #include // for streamsize @@ -31,7 +30,7 @@ #include // for Json, Logger #include // for TcpTransceiver -#include "osi_sensordata.pb.h" // for SensorData +#include // for SensorData #include "osi_transceiver.hpp" // for OsiTransceiver #include "osi_utils.hpp" // for osi_logger diff --git a/optional/vtd/src/osi_utils.cpp b/optional/vtd/src/osi_utils.cpp index 3b84b4ef5..0ad0e0620 100644 --- a/optional/vtd/src/osi_utils.cpp +++ b/optional/vtd/src/osi_utils.cpp @@ -30,8 +30,8 @@ #include // for quaternion_from_rpy -#include "osi_common.pb.h" // for Timestamp, Identifier, BaseMoving, .. -#include "osi_sensordata.pb.h" // for SensorData, DetectedEntityHeader +#include // for Timestamp, Identifier, BaseMoving, .. +#include // for SensorData, DetectedEntityHeader namespace osii { diff --git a/optional/vtd/src/osi_utils.hpp b/optional/vtd/src/osi_utils.hpp index 8759baf36..222062d48 100644 --- a/optional/vtd/src/osi_utils.hpp +++ b/optional/vtd/src/osi_utils.hpp @@ -22,15 +22,15 @@ #pragma once -#include +#include // for string #include // for Isometry3d, Vector3d #include // for Logger, get #include // for ModelError -#include "osi_common.pb.h" // for Dimension3d, Vector3d, .. -#include "osi_sensordata.pb.h" // for SensorData +#include // for Dimension3d, Vector3d, .. +#include // for SensorData #undef osi_require diff --git a/optional/vtd/src/rdb_transceiver_tcp.hpp b/optional/vtd/src/rdb_transceiver_tcp.hpp index 92e8e989c..d21a2ccc5 100644 --- a/optional/vtd/src/rdb_transceiver_tcp.hpp +++ b/optional/vtd/src/rdb_transceiver_tcp.hpp @@ -24,7 +24,6 @@ #pragma once #include // for shared_ptr<> -#include // for string #include // for vector<> #include // for streamsize diff --git a/optional/vtd/src/rdb_transceiver_tcp_test.cpp b/optional/vtd/src/rdb_transceiver_tcp_test.cpp index 7b8cdc1aa..2981ecaa0 100644 --- a/optional/vtd/src/rdb_transceiver_tcp_test.cpp +++ b/optional/vtd/src/rdb_transceiver_tcp_test.cpp @@ -21,7 +21,6 @@ */ #include // for cout -#include // for vector<> #include // for error_code, endpoint, io_service, ... diff --git a/optional/vtd/src/scp_messages.cpp b/optional/vtd/src/scp_messages.cpp index 4fd479b91..9a27e899d 100644 --- a/optional/vtd/src/scp_messages.cpp +++ b/optional/vtd/src/scp_messages.cpp @@ -24,8 +24,7 @@ #include "scp_messages.hpp" // NOLINT -namespace vtd { -namespace scp { +namespace vtd::scp { // clang-format off const char* Start = ""; @@ -188,5 +187,4 @@ std::string QueryScenario::to_scp() const { } // clang-format on -} // namespace scp -} // namespace vtd +} // namespace vtd::scp diff --git a/optional/vtd/src/scp_messages.hpp b/optional/vtd/src/scp_messages.hpp index 6f796b6f1..3487e7094 100644 --- a/optional/vtd/src/scp_messages.hpp +++ b/optional/vtd/src/scp_messages.hpp @@ -31,8 +31,7 @@ #include "scp_transceiver.hpp" // for ScpMessage -namespace vtd { -namespace scp { +namespace vtd::scp { extern const char* Start; extern const char* Stop; @@ -98,5 +97,4 @@ struct QueryScenario : public ScpMessage { std::string to_scp() const override; }; -} // namespace scp -} // namespace vtd +} // namespace vtd::scp diff --git a/optional/vtd/src/vtd_conf.hpp b/optional/vtd/src/vtd_conf.hpp index 4cf373b7a..342d8f455 100644 --- a/optional/vtd/src/vtd_conf.hpp +++ b/optional/vtd/src/vtd_conf.hpp @@ -28,7 +28,8 @@ #include // for Conf, Schema #include // for TcpTransceiverConfiguration, ... -#include "osi_omni_sensor.hpp" // for SensorMockLevel + +#include "osi_omni_sensor.hpp" // for SensorMockLevel // Connection / Initialization #define VTD_DEFAULT_SCP_PORT 48179 diff --git a/optional/vtd/src/vtd_osi_test.cpp b/optional/vtd/src/vtd_osi_test.cpp index 754eb5757..e0e25798b 100644 --- a/optional/vtd/src/vtd_osi_test.cpp +++ b/optional/vtd/src/vtd_osi_test.cpp @@ -29,16 +29,15 @@ #include // for Duration #include // for quaternion_from_rpy -#include "osi_common.pb.h" // for Timestamp, Identifier, BaseMoving, .. -#include "osi_detectedobject.pb.h" // for DetectedMovingObject -#include "osi_groundtruth.pb.h" // for GroundTruth -#include "osi_object.pb.h" // for MovingObject -#include "osi_sensordata.pb.h" // for SensorData, DetectedEntityHeader -#include "osi_sensorview.pb.h" // for SensorView +#include // for Timestamp, Identifier, BaseMoving, .. +#include // for DetectedMovingObject +#include // for GroundTruth +#include // for MovingObject +#include // for SensorData, DetectedEntityHeader +#include // for SensorView #include "osi_omni_sensor.hpp" #include "osi_sensor_component.hpp" // for transform_... -#include "osi_transceiver_tcp.hpp" struct VehicleData { uint64_t id; diff --git a/optional/vtd/tests/conanfile_with_vtd-2.2.0.py b/optional/vtd/tests/conanfile_with_vtd-2.2.0.py index c122065a5..5761bf764 100644 --- a/optional/vtd/tests/conanfile_with_vtd-2.2.0.py +++ b/optional/vtd/tests/conanfile_with_vtd-2.2.0.py @@ -43,7 +43,7 @@ def requirements(self): self.requires("incbin/cci.20211107", override=True) # Runtime requirements for VTD. - self.requires("osi-sensor/1.0.0-vtd2.2@cloe/stable") + self.requires("osi-sensor/1.0.0@cloe/stable") self.requires("vtd/2.2.0@cloe-restricted/stable") # Overrides: diff --git a/optional/vtd/vendor/open-simulation-interface-3.0.1/CMakeLists.txt b/optional/vtd/vendor/open-simulation-interface-3.0.1/CMakeLists.txt deleted file mode 100644 index 715442f7e..000000000 --- a/optional/vtd/vendor/open-simulation-interface-3.0.1/CMakeLists.txt +++ /dev/null @@ -1,76 +0,0 @@ -cmake_minimum_required(VERSION 3.7) - -project(open_simulation_interface - LANGUAGES CXX -) - -include(${CMAKE_CURRENT_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS NO_OUTPUT_DIRS) - -find_package(Protobuf REQUIRED) -# make sure that protobuf_generate_cpp finds the protobuf headers -set(Protobuf_IMPORT_DIRS ${Protobuf_INCLUDE_DIRS}) - -set(VERSION_MAJOR 3) -set(VERSION_MINOR 2) -set(VERSION_PATCH 0) -configure_file(osi_version.proto.in ${CMAKE_CURRENT_SOURCE_DIR}/osi_version.proto) - -set(OSI_SOURCE_FILES - osi_version.proto - osi_common.proto - osi_datarecording.proto - osi_detectedtrafficsign.proto - osi_detectedtrafficlight.proto - osi_detectedroadmarking.proto - osi_detectedlane.proto - osi_detectedobject.proto - osi_detectedoccupant.proto - osi_environment.proto - osi_groundtruth.proto - osi_hostvehicledata.proto - osi_trafficsign.proto - osi_trafficlight.proto - osi_roadmarking.proto - osi_lane.proto - osi_featuredata.proto - osi_object.proto - osi_occupant.proto - osi_sensordata.proto - osi_sensorviewconfiguration.proto - osi_sensorspecific.proto - osi_sensorview.proto -) -protobuf_generate_cpp(OSI_PROTO_SRCS OSI_PROTO_HDRS ${OSI_SOURCE_FILES}) - -add_library(${PROJECT_NAME} - ${OSI_PROTO_SRCS} -) -set_target_properties(${PROJECT_NAME} PROPERTIES - CXX_STANDARD 11 - CXX_STANDARD_REQUIRED ON -) -target_include_directories(${PROJECT_NAME} - PUBLIC - $ - $ - $ -) -target_link_libraries(${PROJECT_NAME} - PUBLIC - CONAN_PKG::protobuf -) - -include(GNUInstallDirs) -install(TARGETS ${PROJECT_NAME} - LIBRARY - DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE - DESTINATION ${CMAKE_INSTALL_LIBDIR} -) - -# Install generated headers -install( - FILES ${OSI_PROTO_HDRS} - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} -) diff --git a/optional/vtd/vendor/open-simulation-interface-3.0.1/conandata.yml b/optional/vtd/vendor/open-simulation-interface-3.0.1/conandata.yml new file mode 100644 index 000000000..e1d4f6f03 --- /dev/null +++ b/optional/vtd/vendor/open-simulation-interface-3.0.1/conandata.yml @@ -0,0 +1,16 @@ +--- +versions: + - "3.0.1" + - "3.2.0" +sources: + "3.0.1": + url: "https://github.com/OpenSimulationInterface/open-simulation-interface/archive/refs/tags/v3.0.1.tar.gz" + sha256: "c822868e1fc1120685c778f478b263a3336d6b12de8ec288c7a4530cfb072fae" + "3.2.0": + url: "https://github.com/OpenSimulationInterface/open-simulation-interface/archive/refs/tags/v3.2.0.tar.gz" + sha256: "18557ac871d1a32f4603d469239bc6e40e5744129be0ce05b22fb329c6d1f545" +patches: + "3.0.1": + - patch_file: "patches/3.0.1_single_lib.patch" + "3.2.0": + - patch_file: "patches/3.2.0_single_lib.patch" diff --git a/optional/vtd/vendor/open-simulation-interface-3.0.1/conanfile.py b/optional/vtd/vendor/open-simulation-interface-3.0.1/conanfile.py index 111203a61..f297dc1a4 100644 --- a/optional/vtd/vendor/open-simulation-interface-3.0.1/conanfile.py +++ b/optional/vtd/vendor/open-simulation-interface-3.0.1/conanfile.py @@ -2,67 +2,92 @@ # pylint: skip-file import os -import shutil -from conans import CMake, ConanFile, tools +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools import build, cmake, files + +required_conan_version = ">=1.60.0 <2.0 || >=2.0.5" class OpenSimulationInterfaceConan(ConanFile): name = "open-simulation-interface" version = "3.0.1" - license = "Mozilla Public License 2.0" - url = "https://github.com/OpenSimulationInterface/open-simulation-interface" - description = "A generic interface for the environmental perception of automated driving functions in virtual scenarios." - topics = ("Sensor Simulation", "HAD") - settings = "os", "compiler", "build_type", "arch" + description = "Generic interface environmental perception of automated driving functions in virtual scenarios" + license = "MPL-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/OpenSimulationInterface/open-simulation-interface" + topics = ("asam", "adas", "open-simulation", "automated-driving", "openx") + package_type = "library" + generators = "CMakeDeps", "CMakeToolchain" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], } default_options = { - "shared": True, + "shared": False, "fPIC": True, } - generators = "cmake" - build_policy = "missing" - no_copy_source = False - exports_sources = [ - "CMakeLists.txt", - ] - requires = [ - "protobuf/2.6.1@cloe/stable" - ] - - _git_url = ( - "https://github.com/OpenSimulationInterface/open-simulation-interface.git" - ) - _git_dir = "osi" - _git_ref = f"v{version}" - - _cmake = None + + def export_sources(self): + files.export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake.cmake_layout(self) + + def requirements(self): + self.requires("protobuf/2.6.1@cloe/stable", transitive_headers=True, transitive_libs=True) + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + build.check_min_cppstd(self, 11) + if self.options.shared and self.settings.os == "Windows": + raise ConanInvalidConfiguration( + "Shared Libraries are not supported on windows because of the missing symbol export in the library." + ) + + def build_requirements(self): + self.tool_requires("protobuf/") def source(self): - git = tools.Git(folder=self._git_dir) - git.clone(self._git_url, self._git_ref, shallow=True) - dst = os.path.join(self.source_folder, self._git_dir) - shutil.copy("CMakeLists.txt", dst) - - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["CMAKE_PROJECT_VERSION"] = self.version - self._cmake.definitions["CMAKE_EXPORT_COMPILE_COMMANDS"] = True - self._cmake.configure(source_folder=self._git_dir) - return self._cmake + files.get(self, **self.conan_data["sources"][self.version], strip_root=True) def build(self): - cmake = self._configure_cmake() - cmake.build() + files.apply_conandata_patches(self) + cm = cmake.CMake(self) + if self.should_configure: + cm.configure() + if self.should_build: + cm.build() def package(self): - cmake = self._configure_cmake() - cmake.install() + if not self.should_install: + return + cm = cmake.CMake(self) + cm.install() + files.copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + if self.settings.os == "Windows": + files.rmdir(self, os.path.join(self.package_folder, "CMake")) + else: + files.rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): - self.cpp_info.libs = tools.collect_libs(self) + self.cpp_info.set_property("cmake_file_name", "open_simulation_interface") + self.cpp_info.set_property("cmake_target_name", "open_simulation_interface::open_simulation_interface") + self.cpp_info.components["libopen_simulation_interface"].libs = ["open_simulation_interface"] + self.cpp_info.components["libopen_simulation_interface"].requires = ["protobuf::libprotobuf"] + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "open_simulation_interface" + self.cpp_info.names["cmake_find_package_multi"] = "open_simulation_interface" + self.cpp_info.components["libopen_simulation_interface"].names["cmake_find_package"] = "open_simulation_interface" + self.cpp_info.components["libopen_simulation_interface"].names["cmake_find_package_multi"] = "open_simulation_interface" diff --git a/optional/vtd/vendor/open-simulation-interface-3.0.1/patches/3.0.1_single_lib.patch b/optional/vtd/vendor/open-simulation-interface-3.0.1/patches/3.0.1_single_lib.patch new file mode 100644 index 000000000..f0f9fc46f --- /dev/null +++ b/optional/vtd/vendor/open-simulation-interface-3.0.1/patches/3.0.1_single_lib.patch @@ -0,0 +1,114 @@ +--- CMakeLists.txt.original 2023-12-11 10:20:55.975913154 +0100 ++++ CMakeLists.txt 2023-12-11 10:22:57.887983720 +0100 +@@ -43,7 +43,6 @@ + set(INSTALL_CMAKE_DIR ${DEF_INSTALL_CMAKE_DIR} CACHE PATH + "Installation directory for CMake files") + +-set(INSTALL_LIB_DIR ${INSTALL_LIB_DIR}/osi${VERSION_MAJOR}) + set(INSTALL_INCLUDE_DIR ${INSTALL_INCLUDE_DIR}/osi${VERSION_MAJOR}) + + configure_file(osi_version.proto.in ${CMAKE_CURRENT_SOURCE_DIR}/osi_version.proto) +@@ -79,53 +78,17 @@ + + protobuf_generate_cpp(PROTO_SRCS PROTO_HEADERS ${OSI_PROTO_FILES}) + +-add_library(${PROJECT_NAME}_static STATIC ${PROTO_SRCS} ${PROTO_HEADERS}) +-target_include_directories(${PROJECT_NAME}_static +- PUBLIC +- ${PROTOBUF_INCLUDE_DIR} +- $ +- $ +-) +-target_link_libraries(${PROJECT_NAME}_static PUBLIC ${PROTOBUF_LIBRARY}) +-install(TARGETS ${PROJECT_NAME}_static +- EXPORT ${PROJECT_NAME}_targets +- ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" COMPONENT lib) +- +- +-add_library(${PROJECT_NAME}_obj OBJECT ${PROTO_SRCS} ${PROTO_HEADERS}) +-target_include_directories(${PROJECT_NAME}_obj +- PUBLIC +- ${PROTOBUF_INCLUDE_DIR} +- $ +- $ +-) +-set_property(TARGET ${PROJECT_NAME}_obj PROPERTY POSITION_INDEPENDENT_CODE ON) +- +- +-add_library(${PROJECT_NAME}_pic STATIC $) +- +-target_include_directories(${PROJECT_NAME}_pic +- PUBLIC +- ${PROTOBUF_INCLUDE_DIR} +- $ +- $ +-) +-target_link_libraries(${PROJECT_NAME}_pic PUBLIC ${PROTOBUF_LIBRARY}) +- +-set_property(TARGET ${PROJECT_NAME}_pic PROPERTY POSITION_INDEPENDENT_CODE ON) ++add_library(${PROJECT_NAME} ${PROTO_SRCS} ${PROTO_HEADERS}) ++target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_11) + +-install(TARGETS ${PROJECT_NAME}_pic +- EXPORT ${PROJECT_NAME}_targets +- ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" COMPONENT lib) +- +-add_library(${PROJECT_NAME} SHARED $) + target_include_directories(${PROJECT_NAME} + PUBLIC +- ${PROTOBUF_INCLUDE_DIR} + $ + $ + ) + ++target_link_libraries(${PROJECT_NAME} PUBLIC protobuf::libprotobuf) ++ + set_property( + TARGET ${PROJECT_NAME} + PROPERTY SOVERSION ${${PROJECT_NAME}_SOVERSION} +@@ -135,6 +98,11 @@ + PROPERTY VERSION ${${PROJECT_NAME}_LIBVERSION} + ) + ++ set_property( ++ TARGET ${PROJECT_NAME} ++ PROPERTY VERSION ${${PROJECT_NAME}_LIBVERSION} ++) ++ + target_link_libraries(${PROJECT_NAME} PUBLIC ${PROTOBUF_LIBRARY}) + install(TARGETS ${PROJECT_NAME} + EXPORT ${PROJECT_NAME}_targets +@@ -169,33 +137,3 @@ + install(EXPORT ${PROJECT_NAME}_targets + DESTINATION "${INSTALL_CMAKE_DIR}" + COMPONENT dev) +- +-# add a target to generate API documentation with Doxygen +-# Dependencies: Doxygen and proto2cpp.py +-FIND_PACKAGE(Doxygen) +-set(FILTER_PROTO2CPP_PY_PATH CACHE PATH "directory to the filter proto2cpp.py") +- +-if(NOT DOXYGEN_FOUND) +- +- message(WARNING "Doxygen could not be found.") +- +-else() +- +- if(NOT EXISTS ${FILTER_PROTO2CPP_PY_PATH}/proto2cpp.py) +- +- message(WARNING "${FILTER_PROTO2CPP_PY_PATH}/proto2cpp.py could not be found.") +- +- else() +- +- set(doxyfile_in ${CMAKE_CURRENT_SOURCE_DIR}/doxygen_config.cmake.in) +- set(doxyfile ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile) +- +- configure_file(${doxyfile_in} ${doxyfile} @ONLY) +- +- ADD_CUSTOM_TARGET(api_doc ALL +- COMMAND ${DOXYGEN_EXECUTABLE} ${doxyfile} +- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) +- +- endif(NOT EXISTS ${FILTER_PROTO2CPP_PY_PATH}/proto2cpp.py) +- +-endif(NOT DOXYGEN_FOUND) diff --git a/optional/vtd/vendor/open-simulation-interface-3.0.1/patches/3.2.0_single_lib.patch b/optional/vtd/vendor/open-simulation-interface-3.0.1/patches/3.2.0_single_lib.patch new file mode 100644 index 000000000..f0f9fc46f --- /dev/null +++ b/optional/vtd/vendor/open-simulation-interface-3.0.1/patches/3.2.0_single_lib.patch @@ -0,0 +1,114 @@ +--- CMakeLists.txt.original 2023-12-11 10:20:55.975913154 +0100 ++++ CMakeLists.txt 2023-12-11 10:22:57.887983720 +0100 +@@ -43,7 +43,6 @@ + set(INSTALL_CMAKE_DIR ${DEF_INSTALL_CMAKE_DIR} CACHE PATH + "Installation directory for CMake files") + +-set(INSTALL_LIB_DIR ${INSTALL_LIB_DIR}/osi${VERSION_MAJOR}) + set(INSTALL_INCLUDE_DIR ${INSTALL_INCLUDE_DIR}/osi${VERSION_MAJOR}) + + configure_file(osi_version.proto.in ${CMAKE_CURRENT_SOURCE_DIR}/osi_version.proto) +@@ -79,53 +78,17 @@ + + protobuf_generate_cpp(PROTO_SRCS PROTO_HEADERS ${OSI_PROTO_FILES}) + +-add_library(${PROJECT_NAME}_static STATIC ${PROTO_SRCS} ${PROTO_HEADERS}) +-target_include_directories(${PROJECT_NAME}_static +- PUBLIC +- ${PROTOBUF_INCLUDE_DIR} +- $ +- $ +-) +-target_link_libraries(${PROJECT_NAME}_static PUBLIC ${PROTOBUF_LIBRARY}) +-install(TARGETS ${PROJECT_NAME}_static +- EXPORT ${PROJECT_NAME}_targets +- ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" COMPONENT lib) +- +- +-add_library(${PROJECT_NAME}_obj OBJECT ${PROTO_SRCS} ${PROTO_HEADERS}) +-target_include_directories(${PROJECT_NAME}_obj +- PUBLIC +- ${PROTOBUF_INCLUDE_DIR} +- $ +- $ +-) +-set_property(TARGET ${PROJECT_NAME}_obj PROPERTY POSITION_INDEPENDENT_CODE ON) +- +- +-add_library(${PROJECT_NAME}_pic STATIC $) +- +-target_include_directories(${PROJECT_NAME}_pic +- PUBLIC +- ${PROTOBUF_INCLUDE_DIR} +- $ +- $ +-) +-target_link_libraries(${PROJECT_NAME}_pic PUBLIC ${PROTOBUF_LIBRARY}) +- +-set_property(TARGET ${PROJECT_NAME}_pic PROPERTY POSITION_INDEPENDENT_CODE ON) ++add_library(${PROJECT_NAME} ${PROTO_SRCS} ${PROTO_HEADERS}) ++target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_11) + +-install(TARGETS ${PROJECT_NAME}_pic +- EXPORT ${PROJECT_NAME}_targets +- ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" COMPONENT lib) +- +-add_library(${PROJECT_NAME} SHARED $) + target_include_directories(${PROJECT_NAME} + PUBLIC +- ${PROTOBUF_INCLUDE_DIR} + $ + $ + ) + ++target_link_libraries(${PROJECT_NAME} PUBLIC protobuf::libprotobuf) ++ + set_property( + TARGET ${PROJECT_NAME} + PROPERTY SOVERSION ${${PROJECT_NAME}_SOVERSION} +@@ -135,6 +98,11 @@ + PROPERTY VERSION ${${PROJECT_NAME}_LIBVERSION} + ) + ++ set_property( ++ TARGET ${PROJECT_NAME} ++ PROPERTY VERSION ${${PROJECT_NAME}_LIBVERSION} ++) ++ + target_link_libraries(${PROJECT_NAME} PUBLIC ${PROTOBUF_LIBRARY}) + install(TARGETS ${PROJECT_NAME} + EXPORT ${PROJECT_NAME}_targets +@@ -169,33 +137,3 @@ + install(EXPORT ${PROJECT_NAME}_targets + DESTINATION "${INSTALL_CMAKE_DIR}" + COMPONENT dev) +- +-# add a target to generate API documentation with Doxygen +-# Dependencies: Doxygen and proto2cpp.py +-FIND_PACKAGE(Doxygen) +-set(FILTER_PROTO2CPP_PY_PATH CACHE PATH "directory to the filter proto2cpp.py") +- +-if(NOT DOXYGEN_FOUND) +- +- message(WARNING "Doxygen could not be found.") +- +-else() +- +- if(NOT EXISTS ${FILTER_PROTO2CPP_PY_PATH}/proto2cpp.py) +- +- message(WARNING "${FILTER_PROTO2CPP_PY_PATH}/proto2cpp.py could not be found.") +- +- else() +- +- set(doxyfile_in ${CMAKE_CURRENT_SOURCE_DIR}/doxygen_config.cmake.in) +- set(doxyfile ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile) +- +- configure_file(${doxyfile_in} ${doxyfile} @ONLY) +- +- ADD_CUSTOM_TARGET(api_doc ALL +- COMMAND ${DOXYGEN_EXECUTABLE} ${doxyfile} +- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) +- +- endif(NOT EXISTS ${FILTER_PROTO2CPP_PY_PATH}/proto2cpp.py) +- +-endif(NOT DOXYGEN_FOUND) diff --git a/optional/vtd/vendor/open-simulation-interface-3.2.0/CMakeLists.txt b/optional/vtd/vendor/open-simulation-interface-3.2.0/CMakeLists.txt deleted file mode 100644 index 894104b18..000000000 --- a/optional/vtd/vendor/open-simulation-interface-3.2.0/CMakeLists.txt +++ /dev/null @@ -1,77 +0,0 @@ -cmake_minimum_required(VERSION 3.15 FATAL_ERROR) - -project(open_simulation_interface - LANGUAGES CXX -) - -include(${CMAKE_CURRENT_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS NO_OUTPUT_DIRS) - -find_package(Protobuf REQUIRED) -# make sure that protobuf_generate_cpp finds the protobuf headers -set(Protobuf_IMPORT_DIRS ${Protobuf_INCLUDE_DIRS}) - -set(VERSION_MAJOR 3) -set(VERSION_MINOR 2) -set(VERSION_PATCH 0) -configure_file(osi_version.proto.in ${CMAKE_CURRENT_SOURCE_DIR}/osi_version.proto) - -set(OSI_SOURCE_FILES - osi_version.proto - osi_common.proto - osi_datarecording.proto - osi_detectedtrafficsign.proto - osi_detectedtrafficlight.proto - osi_detectedroadmarking.proto - osi_detectedlane.proto - osi_detectedobject.proto - osi_detectedoccupant.proto - osi_environment.proto - osi_groundtruth.proto - osi_hostvehicledata.proto - osi_trafficsign.proto - osi_trafficlight.proto - osi_roadmarking.proto - osi_lane.proto - osi_featuredata.proto - osi_object.proto - osi_occupant.proto - osi_sensordata.proto - osi_sensorviewconfiguration.proto - osi_sensorspecific.proto - osi_sensorview.proto -) -protobuf_generate_cpp(OSI_PROTO_SRCS OSI_PROTO_HDRS ${OSI_SOURCE_FILES}) - -add_library(${PROJECT_NAME} - ${OSI_PROTO_SRCS} -) -set_target_properties(${PROJECT_NAME} PROPERTIES - CXX_STANDARD 11 - CXX_STANDARD_REQUIRED ON -) -target_include_directories(${PROJECT_NAME} - PUBLIC - $ - $ - $ -) -target_link_libraries(${PROJECT_NAME} - PUBLIC - # todo: migrate to conan 2.0 - CONAN_PKG::protobuf -) - -include(GNUInstallDirs) -install(TARGETS ${PROJECT_NAME} - LIBRARY - DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE - DESTINATION ${CMAKE_INSTALL_LIBDIR} -) - -# Install generated headers -install( - FILES ${OSI_PROTO_HDRS} - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} -) diff --git a/optional/vtd/vendor/open-simulation-interface-3.2.0/conandata.yml b/optional/vtd/vendor/open-simulation-interface-3.2.0/conandata.yml new file mode 100644 index 000000000..e1d4f6f03 --- /dev/null +++ b/optional/vtd/vendor/open-simulation-interface-3.2.0/conandata.yml @@ -0,0 +1,16 @@ +--- +versions: + - "3.0.1" + - "3.2.0" +sources: + "3.0.1": + url: "https://github.com/OpenSimulationInterface/open-simulation-interface/archive/refs/tags/v3.0.1.tar.gz" + sha256: "c822868e1fc1120685c778f478b263a3336d6b12de8ec288c7a4530cfb072fae" + "3.2.0": + url: "https://github.com/OpenSimulationInterface/open-simulation-interface/archive/refs/tags/v3.2.0.tar.gz" + sha256: "18557ac871d1a32f4603d469239bc6e40e5744129be0ce05b22fb329c6d1f545" +patches: + "3.0.1": + - patch_file: "patches/3.0.1_single_lib.patch" + "3.2.0": + - patch_file: "patches/3.2.0_single_lib.patch" diff --git a/optional/vtd/vendor/open-simulation-interface-3.2.0/conanfile.py b/optional/vtd/vendor/open-simulation-interface-3.2.0/conanfile.py index 3fbdc44f9..1eb66fd6b 100644 --- a/optional/vtd/vendor/open-simulation-interface-3.2.0/conanfile.py +++ b/optional/vtd/vendor/open-simulation-interface-3.2.0/conanfile.py @@ -2,67 +2,92 @@ # pylint: skip-file import os -import shutil -from conans import CMake, ConanFile, tools +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools import build, cmake, files + +required_conan_version = ">=1.60.0 <2.0 || >=2.0.5" class OpenSimulationInterfaceConan(ConanFile): name = "open-simulation-interface" version = "3.2.0" - license = "Mozilla Public License 2.0" - url = "https://github.com/OpenSimulationInterface/open-simulation-interface" - description = "A generic interface for the environmental perception of automated driving functions in virtual scenarios." - topics = ("Sensor Simulation", "HAD") - settings = "os", "compiler", "build_type", "arch" + description = "Generic interface environmental perception of automated driving functions in virtual scenarios" + license = "MPL-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/OpenSimulationInterface/open-simulation-interface" + topics = ("asam", "adas", "open-simulation", "automated-driving", "openx") + package_type = "library" + generators = "CMakeDeps", "CMakeToolchain" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], } default_options = { - "shared": True, + "shared": False, "fPIC": True, } - generators = "cmake" - build_policy = "missing" - no_copy_source = False - exports_sources = [ - "CMakeLists.txt", - ] - requires = [ - "protobuf/2.6.1@cloe/stable" - ] - - _git_url = ( - "https://github.com/OpenSimulationInterface/open-simulation-interface.git" - ) - _git_dir = "osi" - _git_ref = f"v{version}" - - _cmake = None + + def export_sources(self): + files.export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake.cmake_layout(self) + + def requirements(self): + self.requires("protobuf/2.6.1@cloe/stable", transitive_headers=True, transitive_libs=True) + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + build.check_min_cppstd(self, 11) + if self.options.shared and self.settings.os == "Windows": + raise ConanInvalidConfiguration( + "Shared Libraries are not supported on windows because of the missing symbol export in the library." + ) + + def build_requirements(self): + self.tool_requires("protobuf/") def source(self): - git = tools.Git(folder=self._git_dir) - git.clone(self._git_url, self._git_ref, shallow=True) - dst = os.path.join(self.source_folder, self._git_dir) - shutil.copy("CMakeLists.txt", dst) - - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["CMAKE_PROJECT_VERSION"] = self.version - self._cmake.definitions["CMAKE_EXPORT_COMPILE_COMMANDS"] = True - self._cmake.configure(source_folder=self._git_dir) - return self._cmake + files.get(self, **self.conan_data["sources"][self.version], strip_root=True) def build(self): - cmake = self._configure_cmake() - cmake.build() + files.apply_conandata_patches(self) + cm = cmake.CMake(self) + if self.should_configure: + cm.configure() + if self.should_build: + cm.build() def package(self): - cmake = self._configure_cmake() - cmake.install() + if not self.should_install: + return + cm = cmake.CMake(self) + cm.install() + files.copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + if self.settings.os == "Windows": + files.rmdir(self, os.path.join(self.package_folder, "CMake")) + else: + files.rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): - self.cpp_info.libs = tools.collect_libs(self) + self.cpp_info.set_property("cmake_file_name", "open_simulation_interface") + self.cpp_info.set_property("cmake_target_name", "open_simulation_interface::open_simulation_interface") + self.cpp_info.components["libopen_simulation_interface"].libs = ["open_simulation_interface"] + self.cpp_info.components["libopen_simulation_interface"].requires = ["protobuf::libprotobuf"] + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "open_simulation_interface" + self.cpp_info.names["cmake_find_package_multi"] = "open_simulation_interface" + self.cpp_info.components["libopen_simulation_interface"].names["cmake_find_package"] = "open_simulation_interface" + self.cpp_info.components["libopen_simulation_interface"].names["cmake_find_package_multi"] = "open_simulation_interface" diff --git a/optional/vtd/vendor/open-simulation-interface-3.2.0/patches/3.0.1_single_lib.patch b/optional/vtd/vendor/open-simulation-interface-3.2.0/patches/3.0.1_single_lib.patch new file mode 100644 index 000000000..f0f9fc46f --- /dev/null +++ b/optional/vtd/vendor/open-simulation-interface-3.2.0/patches/3.0.1_single_lib.patch @@ -0,0 +1,114 @@ +--- CMakeLists.txt.original 2023-12-11 10:20:55.975913154 +0100 ++++ CMakeLists.txt 2023-12-11 10:22:57.887983720 +0100 +@@ -43,7 +43,6 @@ + set(INSTALL_CMAKE_DIR ${DEF_INSTALL_CMAKE_DIR} CACHE PATH + "Installation directory for CMake files") + +-set(INSTALL_LIB_DIR ${INSTALL_LIB_DIR}/osi${VERSION_MAJOR}) + set(INSTALL_INCLUDE_DIR ${INSTALL_INCLUDE_DIR}/osi${VERSION_MAJOR}) + + configure_file(osi_version.proto.in ${CMAKE_CURRENT_SOURCE_DIR}/osi_version.proto) +@@ -79,53 +78,17 @@ + + protobuf_generate_cpp(PROTO_SRCS PROTO_HEADERS ${OSI_PROTO_FILES}) + +-add_library(${PROJECT_NAME}_static STATIC ${PROTO_SRCS} ${PROTO_HEADERS}) +-target_include_directories(${PROJECT_NAME}_static +- PUBLIC +- ${PROTOBUF_INCLUDE_DIR} +- $ +- $ +-) +-target_link_libraries(${PROJECT_NAME}_static PUBLIC ${PROTOBUF_LIBRARY}) +-install(TARGETS ${PROJECT_NAME}_static +- EXPORT ${PROJECT_NAME}_targets +- ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" COMPONENT lib) +- +- +-add_library(${PROJECT_NAME}_obj OBJECT ${PROTO_SRCS} ${PROTO_HEADERS}) +-target_include_directories(${PROJECT_NAME}_obj +- PUBLIC +- ${PROTOBUF_INCLUDE_DIR} +- $ +- $ +-) +-set_property(TARGET ${PROJECT_NAME}_obj PROPERTY POSITION_INDEPENDENT_CODE ON) +- +- +-add_library(${PROJECT_NAME}_pic STATIC $) +- +-target_include_directories(${PROJECT_NAME}_pic +- PUBLIC +- ${PROTOBUF_INCLUDE_DIR} +- $ +- $ +-) +-target_link_libraries(${PROJECT_NAME}_pic PUBLIC ${PROTOBUF_LIBRARY}) +- +-set_property(TARGET ${PROJECT_NAME}_pic PROPERTY POSITION_INDEPENDENT_CODE ON) ++add_library(${PROJECT_NAME} ${PROTO_SRCS} ${PROTO_HEADERS}) ++target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_11) + +-install(TARGETS ${PROJECT_NAME}_pic +- EXPORT ${PROJECT_NAME}_targets +- ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" COMPONENT lib) +- +-add_library(${PROJECT_NAME} SHARED $) + target_include_directories(${PROJECT_NAME} + PUBLIC +- ${PROTOBUF_INCLUDE_DIR} + $ + $ + ) + ++target_link_libraries(${PROJECT_NAME} PUBLIC protobuf::libprotobuf) ++ + set_property( + TARGET ${PROJECT_NAME} + PROPERTY SOVERSION ${${PROJECT_NAME}_SOVERSION} +@@ -135,6 +98,11 @@ + PROPERTY VERSION ${${PROJECT_NAME}_LIBVERSION} + ) + ++ set_property( ++ TARGET ${PROJECT_NAME} ++ PROPERTY VERSION ${${PROJECT_NAME}_LIBVERSION} ++) ++ + target_link_libraries(${PROJECT_NAME} PUBLIC ${PROTOBUF_LIBRARY}) + install(TARGETS ${PROJECT_NAME} + EXPORT ${PROJECT_NAME}_targets +@@ -169,33 +137,3 @@ + install(EXPORT ${PROJECT_NAME}_targets + DESTINATION "${INSTALL_CMAKE_DIR}" + COMPONENT dev) +- +-# add a target to generate API documentation with Doxygen +-# Dependencies: Doxygen and proto2cpp.py +-FIND_PACKAGE(Doxygen) +-set(FILTER_PROTO2CPP_PY_PATH CACHE PATH "directory to the filter proto2cpp.py") +- +-if(NOT DOXYGEN_FOUND) +- +- message(WARNING "Doxygen could not be found.") +- +-else() +- +- if(NOT EXISTS ${FILTER_PROTO2CPP_PY_PATH}/proto2cpp.py) +- +- message(WARNING "${FILTER_PROTO2CPP_PY_PATH}/proto2cpp.py could not be found.") +- +- else() +- +- set(doxyfile_in ${CMAKE_CURRENT_SOURCE_DIR}/doxygen_config.cmake.in) +- set(doxyfile ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile) +- +- configure_file(${doxyfile_in} ${doxyfile} @ONLY) +- +- ADD_CUSTOM_TARGET(api_doc ALL +- COMMAND ${DOXYGEN_EXECUTABLE} ${doxyfile} +- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) +- +- endif(NOT EXISTS ${FILTER_PROTO2CPP_PY_PATH}/proto2cpp.py) +- +-endif(NOT DOXYGEN_FOUND) diff --git a/optional/vtd/vendor/open-simulation-interface-3.2.0/patches/3.2.0_single_lib.patch b/optional/vtd/vendor/open-simulation-interface-3.2.0/patches/3.2.0_single_lib.patch new file mode 100644 index 000000000..f0f9fc46f --- /dev/null +++ b/optional/vtd/vendor/open-simulation-interface-3.2.0/patches/3.2.0_single_lib.patch @@ -0,0 +1,114 @@ +--- CMakeLists.txt.original 2023-12-11 10:20:55.975913154 +0100 ++++ CMakeLists.txt 2023-12-11 10:22:57.887983720 +0100 +@@ -43,7 +43,6 @@ + set(INSTALL_CMAKE_DIR ${DEF_INSTALL_CMAKE_DIR} CACHE PATH + "Installation directory for CMake files") + +-set(INSTALL_LIB_DIR ${INSTALL_LIB_DIR}/osi${VERSION_MAJOR}) + set(INSTALL_INCLUDE_DIR ${INSTALL_INCLUDE_DIR}/osi${VERSION_MAJOR}) + + configure_file(osi_version.proto.in ${CMAKE_CURRENT_SOURCE_DIR}/osi_version.proto) +@@ -79,53 +78,17 @@ + + protobuf_generate_cpp(PROTO_SRCS PROTO_HEADERS ${OSI_PROTO_FILES}) + +-add_library(${PROJECT_NAME}_static STATIC ${PROTO_SRCS} ${PROTO_HEADERS}) +-target_include_directories(${PROJECT_NAME}_static +- PUBLIC +- ${PROTOBUF_INCLUDE_DIR} +- $ +- $ +-) +-target_link_libraries(${PROJECT_NAME}_static PUBLIC ${PROTOBUF_LIBRARY}) +-install(TARGETS ${PROJECT_NAME}_static +- EXPORT ${PROJECT_NAME}_targets +- ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" COMPONENT lib) +- +- +-add_library(${PROJECT_NAME}_obj OBJECT ${PROTO_SRCS} ${PROTO_HEADERS}) +-target_include_directories(${PROJECT_NAME}_obj +- PUBLIC +- ${PROTOBUF_INCLUDE_DIR} +- $ +- $ +-) +-set_property(TARGET ${PROJECT_NAME}_obj PROPERTY POSITION_INDEPENDENT_CODE ON) +- +- +-add_library(${PROJECT_NAME}_pic STATIC $) +- +-target_include_directories(${PROJECT_NAME}_pic +- PUBLIC +- ${PROTOBUF_INCLUDE_DIR} +- $ +- $ +-) +-target_link_libraries(${PROJECT_NAME}_pic PUBLIC ${PROTOBUF_LIBRARY}) +- +-set_property(TARGET ${PROJECT_NAME}_pic PROPERTY POSITION_INDEPENDENT_CODE ON) ++add_library(${PROJECT_NAME} ${PROTO_SRCS} ${PROTO_HEADERS}) ++target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_11) + +-install(TARGETS ${PROJECT_NAME}_pic +- EXPORT ${PROJECT_NAME}_targets +- ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" COMPONENT lib) +- +-add_library(${PROJECT_NAME} SHARED $) + target_include_directories(${PROJECT_NAME} + PUBLIC +- ${PROTOBUF_INCLUDE_DIR} + $ + $ + ) + ++target_link_libraries(${PROJECT_NAME} PUBLIC protobuf::libprotobuf) ++ + set_property( + TARGET ${PROJECT_NAME} + PROPERTY SOVERSION ${${PROJECT_NAME}_SOVERSION} +@@ -135,6 +98,11 @@ + PROPERTY VERSION ${${PROJECT_NAME}_LIBVERSION} + ) + ++ set_property( ++ TARGET ${PROJECT_NAME} ++ PROPERTY VERSION ${${PROJECT_NAME}_LIBVERSION} ++) ++ + target_link_libraries(${PROJECT_NAME} PUBLIC ${PROTOBUF_LIBRARY}) + install(TARGETS ${PROJECT_NAME} + EXPORT ${PROJECT_NAME}_targets +@@ -169,33 +137,3 @@ + install(EXPORT ${PROJECT_NAME}_targets + DESTINATION "${INSTALL_CMAKE_DIR}" + COMPONENT dev) +- +-# add a target to generate API documentation with Doxygen +-# Dependencies: Doxygen and proto2cpp.py +-FIND_PACKAGE(Doxygen) +-set(FILTER_PROTO2CPP_PY_PATH CACHE PATH "directory to the filter proto2cpp.py") +- +-if(NOT DOXYGEN_FOUND) +- +- message(WARNING "Doxygen could not be found.") +- +-else() +- +- if(NOT EXISTS ${FILTER_PROTO2CPP_PY_PATH}/proto2cpp.py) +- +- message(WARNING "${FILTER_PROTO2CPP_PY_PATH}/proto2cpp.py could not be found.") +- +- else() +- +- set(doxyfile_in ${CMAKE_CURRENT_SOURCE_DIR}/doxygen_config.cmake.in) +- set(doxyfile ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile) +- +- configure_file(${doxyfile_in} ${doxyfile} @ONLY) +- +- ADD_CUSTOM_TARGET(api_doc ALL +- COMMAND ${DOXYGEN_EXECUTABLE} ${doxyfile} +- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) +- +- endif(NOT EXISTS ${FILTER_PROTO2CPP_PY_PATH}/proto2cpp.py) +- +-endif(NOT DOXYGEN_FOUND) diff --git a/optional/vtd/vendor/osi-sensor-1.0.0-vtd2.2/conanfile.py b/optional/vtd/vendor/osi-sensor-1.0.0-vtd2.2/conanfile.py deleted file mode 100644 index e50034ffd..000000000 --- a/optional/vtd/vendor/osi-sensor-1.0.0-vtd2.2/conanfile.py +++ /dev/null @@ -1,94 +0,0 @@ -# mypy: ignore-errors -# pylint: skip-file - -import os -import shutil -from pathlib import Path - -from conans import CMake, ConanFile, tools - - -class VtdSensorConan(ConanFile): - name = "osi-sensor" - version = "1.0.0-vtd2.2" - license = "Mozilla Public License 2.0" - url = "https://github.com/OpenSimulationInterface/osi-sensor-model-packaging" - description = "Example of a sensor model using OSI with FMI 2.0." - topics = ("Sensor Simulation", "HAD") - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" - build_policy = "missing" - _patch_vtd2p2 = "patches/osmp_vtd_v2.2.patch" # git format-patch v1.0.0 --stdout > osmp_vtd_v2.2.patch - exports_sources = [ - _patch_vtd2p2, - "CMakeLists.txt", - ] - _git_url = ( - "https://github.com/OpenSimulationInterface/osi-sensor-model-packaging.git" - ) - _git_ref = "v{}".format(version.split("-")[0]) - _git_dir = "osmp" - _rel_src_dir = os.path.join(_git_dir, "examples/OSMPDummySensor") - _pkg_lib = "OSMPDummySensor.so" - _cmake = None - - def requirements(self): - self.requires("open-simulation-interface/[=3.0.*]@cloe/stable", private=True) - self.requires("protobuf/2.6.1@cloe/stable", override=True) - self.requires("vtd/2.2.0@cloe-restricted/stable") - - def source(self): - git = tools.Git(folder=self._git_dir) - git.clone(self._git_url, branch=self._git_ref, shallow=True) - dst = os.path.join(self.source_folder, self._rel_src_dir) - shutil.copy("CMakeLists.txt", dst) - - def configure(self): - # requirement options - self.options["open-simulation-interface"].shared = True - # package options - self.settings.compiler.cppstd = "11" - self.settings.compiler.libcxx = "libstdc++" - - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["CMAKE_PROJECT_VERSION"] = self.version - self._cmake.definitions["CMAKE_BUILD_TYPE"] = self.settings.get_safe( - "build_type" - ) - self._cmake.definitions["CMAKE_EXPORT_COMPILE_COMMANDS"] = True - self._cmake.configure(source_folder=self._rel_src_dir) - return self._cmake - - def build(self): - # find VTD osi library - osi_lib_dir = Path( - self.deps_env_info["vtd"].VTD_ROOT + "/Data/Setups/Standard.OSI3/Bin/" - ) - if not Path(str(osi_lib_dir) + "/libopen_simulation_interface.so").is_file(): - self.output.warn(f"VTD OSI library not found: {osi_lib_dir}") - # apply patch for compatibility with VTD osi plugin - trg_path = self._git_dir - patch_file = self._patch_vtd2p2 - if not self.in_local_cache: - trg_path = self.source_folder + "/" + trg_path - patch_file = self.recipe_folder + "/" + patch_file - tools.patch( - base_path=trg_path, - patch_file=patch_file, - ) - # configure and build - cmake = self._configure_cmake() - cmake.build() - - def package(self): - cmake = self._configure_cmake() - cmake.install() - - def package_info(self): - self.cpp_info.libs = tools.collect_libs(self) - pkg_path = os.path.join(self.package_folder, "lib", self._pkg_lib) - # collect the library path for linking the model to the VTD runtime setup - self.env_info.VTD_EXTERNAL_MODELS.append(pkg_path) diff --git a/optional/vtd/vendor/osi-sensor-1.0.0-vtd2.2/CMakeLists.txt b/optional/vtd/vendor/osi-sensor-1.0.0/CMakeLists.txt similarity index 57% rename from optional/vtd/vendor/osi-sensor-1.0.0-vtd2.2/CMakeLists.txt rename to optional/vtd/vendor/osi-sensor-1.0.0/CMakeLists.txt index 39eccf050..4ae722682 100644 --- a/optional/vtd/vendor/osi-sensor-1.0.0-vtd2.2/CMakeLists.txt +++ b/optional/vtd/vendor/osi-sensor-1.0.0/CMakeLists.txt @@ -1,24 +1,29 @@ -cmake_minimum_required(VERSION 3.7) +cmake_minimum_required(VERSION 3.15 FATAL_ERROR) -project(OSMPDummySensor - LANGUAGES CXX -) +project(OSMPDummySensor LANGUAGES CXX) -include(${CMAKE_CURRENT_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS NO_OUTPUT_DIRS) +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) -# Compiler definitions -string(TIMESTAMP FMUTIMESTAMP UTC) -string(MD5 FMUGUID modelDescription.in.xml) -configure_file(modelDescription.in.xml modelDescription.xml @ONLY) +# Input Variables +set(VTD_ROOT "" CACHE STRING "Path to VTD root directory") + +# Dependencies +find_package(open_simulation_interface REQUIRED) +find_package(Protobuf CONFIG REQUIRED) find_library(VTD_OSI_LIBRARY NAME libopen_simulation_interface.so - PATHS "${CONAN_VTD_ROOT}/Data/Setups/Standard.OSI3/Bin/" + PATHS "${VTD_ROOT}/Data/Setups/Standard.OSI3/Bin/" NO_DEFAULT_PATH ) if(NOT VTD_OSI_LIBRARY) - message(WARNING "VTD OSI library not found. Using Conan package..") - set(VTD_OSI_LIBRARY CONAN_PKG::open-simulation-interface) + message(WARNING "VTD OSI library not found. Using external package.") + set(VTD_OSI_LIBRARY open_simulation_interface::libopen_simulation_interface) endif() + +# Configuration +string(TIMESTAMP FMUTIMESTAMP UTC) +string(MD5 FMUGUID modelDescription.in.xml) +configure_file(modelDescription.in.xml modelDescription.xml @ONLY) + # Library ------------------------------------------------------------ add_library(${PROJECT_NAME} SHARED OSMPDummySensor.cpp @@ -28,14 +33,17 @@ set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD_REQUIRED ON PREFIX "" ) +message(STATUS "protobuf_FOUND: ${protobuf_FOUND}") +message(STATUS "protobuf_INCLUDE_DIRS: ${protobuf_INCLUDE_DIRS}") target_include_directories(${PROJECT_NAME} PUBLIC ../includes - $ - $ + ${open_simulation_interface_INCLUDE_DIRS} + ${protobuf_INCLUDE_DIR} ) target_link_libraries(${PROJECT_NAME} PUBLIC + protobuf::libprotobuf ${VTD_OSI_LIBRARY} ) target_compile_definitions(${PROJECT_NAME} diff --git a/optional/vtd/vendor/osi-sensor-1.0.0-vtd2.2/Makefile b/optional/vtd/vendor/osi-sensor-1.0.0/Makefile similarity index 100% rename from optional/vtd/vendor/osi-sensor-1.0.0-vtd2.2/Makefile rename to optional/vtd/vendor/osi-sensor-1.0.0/Makefile diff --git a/optional/vtd/vendor/osi-sensor-1.0.0/conandata.yml b/optional/vtd/vendor/osi-sensor-1.0.0/conandata.yml new file mode 100644 index 000000000..299311975 --- /dev/null +++ b/optional/vtd/vendor/osi-sensor-1.0.0/conandata.yml @@ -0,0 +1,10 @@ +--- +sources: + "1.0.0": + url: "https://github.com/OpenSimulationInterface/osi-sensor-model-packaging/archive/refs/tags/v1.0.0.tar.gz" + sha256: "6c9617608e815419f5c9b7b3359a0573082e7068dfcfc0f42c059c8094265fd6" +patches: + "1.0.0": + - patch_file: "patches/fix-osi-includes.patch" + - patch_file: "patches/osmp_vtd_v2.2.patch" + - patch_file: "patches/cmakelists.patch" diff --git a/optional/vtd/vendor/osi-sensor-1.0.0/conanfile.py b/optional/vtd/vendor/osi-sensor-1.0.0/conanfile.py new file mode 100644 index 000000000..4b7a429ed --- /dev/null +++ b/optional/vtd/vendor/osi-sensor-1.0.0/conanfile.py @@ -0,0 +1,94 @@ +# mypy: ignore-errors +# pylint: skip-file + +import os +import shutil +from pathlib import Path + +from conan import ConanFile +from conan.tools import cmake, files + +required_conan_version = ">=1.52.0" + + +class VtdSensorConan(ConanFile): + name = "osi-sensor" + version = "1.0.0" + license = "Mozilla Public License 2.0" + url = "https://github.com/OpenSimulationInterface/osi-sensor-model-packaging" + description = "Example of a sensor model using OSI with FMI 2.0." + topics = ("Sensor Simulation", "HAD") + settings = "os", "compiler", "build_type", "arch" + generators = "CMakeDeps", "VirtualRunEnv" + options = { + "simulator": ["vtd-2.2.0"], + } + default_options = { + "simulator": "vtd-2.2.0", + } + + def export_sources(self): + files.export_conandata_patches(self) + + def requirements(self): + self.requires("open-simulation-interface/3.0.1@cloe/stable", private=True) + self.requires( + "protobuf/2.6.1@cloe/stable", + transitive_headers=True, + transitive_libs=True, + private=True, + ) + self.requires("vtd/2.2.0@cloe-restricted/stable") + + def source(self): + files.get( + self, + **self.conan_data["sources"][self.version], + destination=".", + strip_root=True, + ) + + def configure(self): + # requirement options + self.options["open-simulation-interface"].shared = True + # package options + self.settings.compiler.cppstd = "11" + self.settings.compiler.libcxx = "libstdc++" + + def layout(self): + cmake.cmake_layout(self) + + def generate(self): + tc = cmake.CMakeToolchain(self) + tc.cache_variables["VTD_ROOT"] = self.deps_env_info["vtd"].VTD_ROOT + tc.generate() + + def build(self): + vtd_root = Path(self.deps_env_info["vtd"].VTD_ROOT) + osi_lib = ( + vtd_root / "/Data/Setups/Standard.OSI3/Bin/libopen_simulation_interface.so" + ) + if not osi_lib.is_file(): + self.output.warn(f"VTD OSI library not found: {osi_lib}") + + cm = cmake.CMake(self) + if self.should_configure: + files.apply_conandata_patches(self) + cm.configure( + build_script_folder=os.path.join( + self.source_folder, "examples", "OSMPDummySensor" + ) + ) + if self.should_build: + cm.build() + + def package(self): + cm = cmake.CMake(self) + if self.should_install: + cm.install() + + def package_info(self): + self.runenv_info.append( + "VTD_EXTERNAL_MODELS", + os.path.join(self.package_folder, "lib", "OSMPDummySensor.so"), + ) diff --git a/optional/vtd/vendor/osi-sensor-1.0.0/patches/cmakelists.patch b/optional/vtd/vendor/osi-sensor-1.0.0/patches/cmakelists.patch new file mode 100644 index 000000000..e773205b8 --- /dev/null +++ b/optional/vtd/vendor/osi-sensor-1.0.0/patches/cmakelists.patch @@ -0,0 +1,123 @@ +--- examples/OSMPDummySensor/CMakeLists.txt.original 2018-06-12 18:02:59.000000000 +0200 ++++ examples/OSMPDummySensor/CMakeLists.txt 2023-12-11 12:09:32.801215890 +0100 +@@ -1,71 +1,57 @@ +-cmake_minimum_required(VERSION 3.5) +-project(OSMPDummySensor) ++cmake_minimum_required(VERSION 3.15 FATAL_ERROR) + +-set(CMAKE_CXX_STANDARD 11) +-set(CMAKE_CXX_STANDARD_REQUIRED ON) +-set(LINK_WITH_SHARED_OSI OFF CACHE BOOL "Link FMU with shared OSI library instead of statically linking") +-set(PUBLIC_LOGGING OFF CACHE BOOL "Enable logging via FMI logger") +-set(PRIVATE_LOGGING OFF CACHE BOOL "Enable private logging to file") +-if(WIN32) +- set(PRIVATE_LOG_PATH "C:/TEMP/OSMPDummySensorLog.log" CACHE FILEPATH "Path to write private log file to") +-else() +- set(PRIVATE_LOG_PATH "/tmp/OSMPDummySensorLog.log" CACHE FILEPATH "Path to write private log file to") ++project(OSMPDummySensor LANGUAGES CXX) ++ ++# Input Variables ++set(VTD_ROOT "" CACHE STRING "Path to VTD root directory") ++ ++# Dependencies ++find_package(open_simulation_interface REQUIRED) ++find_package(Protobuf CONFIG REQUIRED) ++find_library(VTD_OSI_LIBRARY NAME libopen_simulation_interface.so ++ PATHS "${VTD_ROOT}/Data/Setups/Standard.OSI3/Bin/" ++ NO_DEFAULT_PATH ++) ++if(NOT VTD_OSI_LIBRARY) ++ message(WARNING "VTD OSI library not found. Using external package.") ++ set(VTD_OSI_LIBRARY open_simulation_interface::libopen_simulation_interface) + endif() +-set(VERBOSE_FMI_LOGGING OFF CACHE BOOL "Enable detailed FMI function logging") +-set(DEBUG_BREAKS OFF CACHE BOOL "Enable debugger traps for debug builds of FMU") + ++# Configuration + string(TIMESTAMP FMUTIMESTAMP UTC) + string(MD5 FMUGUID modelDescription.in.xml) + configure_file(modelDescription.in.xml modelDescription.xml @ONLY) + +-find_package(Protobuf 2.6.1 REQUIRED) +-add_library(OSMPDummySensor SHARED OSMPDummySensor.cpp) +-set_target_properties(OSMPDummySensor PROPERTIES PREFIX "") +-target_compile_definitions(OSMPDummySensor PRIVATE "FMU_SHARED_OBJECT") +-target_compile_definitions(OSMPDummySensor PRIVATE "FMU_GUID=\"${FMUGUID}\"") +-if(LINK_WITH_SHARED_OSI) +- target_link_libraries(OSMPDummySensor open_simulation_interface) +-else() +- target_link_libraries(OSMPDummySensor open_simulation_interface_pic) +-endif() +-if(PRIVATE_LOGGING) +- file(TO_NATIVE_PATH ${PRIVATE_LOG_PATH} PRIVATE_LOG_PATH_NATIVE) +- string(REPLACE "\\" "\\\\" PRIVATE_LOG_PATH_ESCAPED ${PRIVATE_LOG_PATH_NATIVE}) +- target_compile_definitions(OSMPDummySensor PRIVATE +- "PRIVATE_LOG_PATH=\"${PRIVATE_LOG_PATH_ESCAPED}\"") +-endif() +-target_compile_definitions(OSMPDummySensor PRIVATE +- $<$:PUBLIC_LOGGING> +- $<$:VERBOSE_FMI_LOGGING> +- $<$:DEBUG_BREAKS>) +- +-if(WIN32) +- if(CMAKE_SIZEOF_VOID_P EQUAL 8) +- set(FMI_BINARIES_PLATFORM "win64") +- else() +- set(FMI_BINARIES_PLATFORM "win32") +- endif() +-elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux") +- if(CMAKE_SIZEOF_VOID_P EQUAL 8) +- set(FMI_BINARIES_PLATFORM "linux64") +- else() +- set(FMI_BINARIES_PLATFORM "linux32") +- endif() +-elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") +- if(CMAKE_SIZEOF_VOID_P EQUAL 8) +- set(FMI_BINARIES_PLATFORM "darwin64") +- else() +- set(FMI_BINARIES_PLATFORM "darwin32") +- endif() +-endif() ++# Library ------------------------------------------------------------ ++add_library(${PROJECT_NAME} SHARED ++ OSMPDummySensor.cpp ++) ++set_target_properties(${PROJECT_NAME} PROPERTIES ++ CXX_STANDARD 11 ++ CXX_STANDARD_REQUIRED ON ++ PREFIX "" ++) ++target_include_directories(${PROJECT_NAME} ++ PUBLIC ++ ../includes ++ ${open_simulation_interface_INCLUDE_DIRS} ++) ++target_link_libraries(${PROJECT_NAME} ++ PUBLIC ++ protobuf::libprotobuf ++ ${VTD_OSI_LIBRARY} ++) ++target_compile_definitions(${PROJECT_NAME} ++ PRIVATE ++ FMU_SHARED_OBJECT ++ PRIVATE_LOG_PATH="/tmp/OSMPDummySensor.log" ++) + +-add_custom_command(TARGET OSMPDummySensor +- POST_BUILD +- COMMAND ${CMAKE_COMMAND} -E remove_directory "${CMAKE_CURRENT_BINARY_DIR}/buildfmu" +- COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/buildfmu/sources" +- COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/buildfmu/binaries/${FMI_BINARIES_PLATFORM}" +- COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_BINARY_DIR}/modelDescription.xml" "${CMAKE_CURRENT_BINARY_DIR}/buildfmu" +- COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/OSMPDummySensor.cpp" "${CMAKE_CURRENT_BINARY_DIR}/buildfmu/sources/" +- COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/OSMPDummySensor.h" "${CMAKE_CURRENT_BINARY_DIR}/buildfmu/sources/" +- COMMAND ${CMAKE_COMMAND} -E copy $ $<$:$<$:$>> "${CMAKE_CURRENT_BINARY_DIR}/buildfmu/binaries/${FMI_BINARIES_PLATFORM}" +- COMMAND ${CMAKE_COMMAND} -E chdir "${CMAKE_CURRENT_BINARY_DIR}/buildfmu" ${CMAKE_COMMAND} -E tar "cfv" "../OSMPDummySensor.fmu" --format=zip "modelDescription.xml" "${CMAKE_CURRENT_BINARY_DIR}/buildfmu/sources" "${CMAKE_CURRENT_BINARY_DIR}/buildfmu/binaries/${FMI_BINARIES_PLATFORM}") ++# Installation ------------------------------------------------------- ++include(GNUInstallDirs) ++install(TARGETS ${PROJECT_NAME} ++ LIBRARY ++ DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE ++ DESTINATION ${CMAKE_INSTALL_LIBDIR} ++) diff --git a/optional/vtd/vendor/osi-sensor-1.0.0/patches/fix-osi-includes.patch b/optional/vtd/vendor/osi-sensor-1.0.0/patches/fix-osi-includes.patch new file mode 100644 index 000000000..59a9fd130 --- /dev/null +++ b/optional/vtd/vendor/osi-sensor-1.0.0/patches/fix-osi-includes.patch @@ -0,0 +1,26 @@ +diff -wru examples.original/OSMPDummySensor/OSMPDummySensor.h examples/OSMPDummySensor/OSMPDummySensor.h +--- examples/OSMPDummySensor/OSMPDummySensor.h 2018-06-12 18:02:59.000000000 +0200 ++++ examples/OSMPDummySensor/OSMPDummySensor.h 2023-12-11 16:25:17.620048565 +0100 +@@ -80,8 +80,8 @@ + + #undef min + #undef max +-#include "osi_sensorview.pb.h" +-#include "osi_sensordata.pb.h" ++#include ++#include + + /* FMU Class */ + class COSMPDummySensor { +diff -wru examples.original/OSMPDummySource/OSMPDummySource.h examples/OSMPDummySource/OSMPDummySource.h +--- examples/OSMPDummySource/OSMPDummySource.h 2018-06-12 18:02:59.000000000 +0200 ++++ examples/OSMPDummySource/OSMPDummySource.h 2023-12-11 16:25:08.283737538 +0100 +@@ -70,7 +70,7 @@ + + #undef min + #undef max +-#include "osi_sensorview.pb.h" ++#include + + /* FMU Class */ + class COSMPDummySource { diff --git a/optional/vtd/vendor/osi-sensor-1.0.0-vtd2.2/patches/osmp_vtd_v2.2.patch b/optional/vtd/vendor/osi-sensor-1.0.0/patches/osmp_vtd_v2.2.patch similarity index 100% rename from optional/vtd/vendor/osi-sensor-1.0.0-vtd2.2/patches/osmp_vtd_v2.2.patch rename to optional/vtd/vendor/osi-sensor-1.0.0/patches/osmp_vtd_v2.2.patch diff --git a/optional/vtd/vendor/protobuf-2.6.1/cmake/protobuf-generate.cmake b/optional/vtd/vendor/protobuf-2.6.1/cmake/protobuf-generate.cmake new file mode 100644 index 000000000..f76ec609f --- /dev/null +++ b/optional/vtd/vendor/protobuf-2.6.1/cmake/protobuf-generate.cmake @@ -0,0 +1,223 @@ +# Copyright 2008 Google Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# Code generated by the Protocol Buffer compiler is owned by the owner +# of the input file used when generating it. This code is not +# standalone and requires a support library to be linked with it. This +# support library is itself covered by the above license. + +# --- BEGIN NOTICE --- +# Source: https://github.com/protocolbuffers/protobuf/blob/v3.21.12/cmake/ +# Modifications: +# - Add license text above from repository +# - Add `-I ${protobuf_INCLUDE_DIR}` at line 158 +# --- END NOTICE --- + +# User options +include("${CMAKE_CURRENT_LIST_DIR}/protobuf-options.cmake") + +# Depend packages +# BEGIN CONAN PATCH +#_protobuf_FIND_ZLIB@ +# END CONAN PATCH + +# Imported targets +if(NOT TARGET protobuf::protoc) + if(CMAKE_CROSSCOMPILING) + find_program(PROTOC_PROGRAM protoc PATHS ENV PATH NO_DEFAULT_PATH) + endif() + if(NOT PROTOC_PROGRAM) + set(PROTOC_PROGRAM "${CMAKE_CURRENT_LIST_DIR}/../../../bin/protoc") + endif() + get_filename_component(PROTOC_PROGRAM "${PROTOC_PROGRAM}" ABSOLUTE) + set(Protobuf_PROTOC_EXECUTABLE ${PROTOC_PROGRAM} CACHE FILEPATH "The protoc compiler") + add_executable(protobuf::protoc IMPORTED) + set_property(TARGET protobuf::protoc PROPERTY IMPORTED_LOCATION ${Protobuf_PROTOC_EXECUTABLE}) +endif() + + +function(protobuf_generate) + include(CMakeParseArguments) + + set(_options APPEND_PATH) + set(_singleargs LANGUAGE OUT_VAR EXPORT_MACRO PROTOC_OUT_DIR PLUGIN PLUGIN_OPTIONS) + if(COMMAND target_sources) + list(APPEND _singleargs TARGET) + endif() + set(_multiargs PROTOS IMPORT_DIRS GENERATE_EXTENSIONS PROTOC_OPTIONS) + + cmake_parse_arguments(protobuf_generate "${_options}" "${_singleargs}" "${_multiargs}" "${ARGN}") + + if(NOT protobuf_generate_PROTOS AND NOT protobuf_generate_TARGET) + message(SEND_ERROR "Error: protobuf_generate called without any targets or source files") + return() + endif() + + if(NOT protobuf_generate_OUT_VAR AND NOT protobuf_generate_TARGET) + message(SEND_ERROR "Error: protobuf_generate called without a target or output variable") + return() + endif() + + if(NOT protobuf_generate_LANGUAGE) + set(protobuf_generate_LANGUAGE cpp) + endif() + string(TOLOWER ${protobuf_generate_LANGUAGE} protobuf_generate_LANGUAGE) + + if(NOT protobuf_generate_PROTOC_OUT_DIR) + set(protobuf_generate_PROTOC_OUT_DIR ${CMAKE_CURRENT_BINARY_DIR}) + endif() + + if(protobuf_generate_EXPORT_MACRO AND protobuf_generate_LANGUAGE STREQUAL cpp) + set(_dll_export_decl "dllexport_decl=${protobuf_generate_EXPORT_MACRO}") + endif() + + foreach(_option ${_dll_export_decl} ${protobuf_generate_PLUGIN_OPTIONS}) + # append comma - not using CMake lists and string replacement as users + # might have semicolons in options + if(_plugin_options) + set( _plugin_options "${_plugin_options},") + endif() + set(_plugin_options "${_plugin_options}${_option}") + endforeach() + + if(protobuf_generate_PLUGIN) + set(_plugin "--plugin=${protobuf_generate_PLUGIN}") + endif() + + if(NOT protobuf_generate_GENERATE_EXTENSIONS) + if(protobuf_generate_LANGUAGE STREQUAL cpp) + set(protobuf_generate_GENERATE_EXTENSIONS .pb.h .pb.cc) + elseif(protobuf_generate_LANGUAGE STREQUAL python) + set(protobuf_generate_GENERATE_EXTENSIONS _pb2.py) + else() + message(SEND_ERROR "Error: protobuf_generate given unknown Language ${LANGUAGE}, please provide a value for GENERATE_EXTENSIONS") + return() + endif() + endif() + + if(protobuf_generate_TARGET) + get_target_property(_source_list ${protobuf_generate_TARGET} SOURCES) + foreach(_file ${_source_list}) + if(_file MATCHES "proto$") + list(APPEND protobuf_generate_PROTOS ${_file}) + endif() + endforeach() + endif() + + if(NOT protobuf_generate_PROTOS) + message(SEND_ERROR "Error: protobuf_generate could not find any .proto files") + return() + endif() + + if(protobuf_generate_APPEND_PATH) + # Create an include path for each file specified + foreach(_file ${protobuf_generate_PROTOS}) + get_filename_component(_abs_file ${_file} ABSOLUTE) + get_filename_component(_abs_dir ${_abs_file} DIRECTORY) + list(FIND _protobuf_include_path ${_abs_dir} _contains_already) + if(${_contains_already} EQUAL -1) + list(APPEND _protobuf_include_path -I ${_abs_dir}) + endif() + endforeach() + endif() + + foreach(DIR ${protobuf_generate_IMPORT_DIRS}) + get_filename_component(ABS_PATH ${DIR} ABSOLUTE) + list(FIND _protobuf_include_path ${ABS_PATH} _contains_already) + if(${_contains_already} EQUAL -1) + list(APPEND _protobuf_include_path -I ${ABS_PATH}) + endif() + endforeach() + + if(NOT _protobuf_include_path) + set(_protobuf_include_path -I ${CMAKE_CURRENT_SOURCE_DIR} -I ${protobuf_INCLUDE_DIR}) + endif() + + set(_generated_srcs_all) + foreach(_proto ${protobuf_generate_PROTOS}) + get_filename_component(_abs_file ${_proto} ABSOLUTE) + get_filename_component(_abs_dir ${_abs_file} DIRECTORY) + + get_filename_component(_file_full_name ${_proto} NAME) + string(FIND "${_file_full_name}" "." _file_last_ext_pos REVERSE) + string(SUBSTRING "${_file_full_name}" 0 ${_file_last_ext_pos} _basename) + + set(_suitable_include_found FALSE) + foreach(DIR ${_protobuf_include_path}) + if(NOT DIR STREQUAL "-I") + file(RELATIVE_PATH _rel_dir ${DIR} ${_abs_dir}) + string(FIND "${_rel_dir}" "../" _is_in_parent_folder) + if (NOT ${_is_in_parent_folder} EQUAL 0) + set(_suitable_include_found TRUE) + break() + endif() + endif() + endforeach() + + if(NOT _suitable_include_found) + message(SEND_ERROR "Error: protobuf_generate could not find any correct proto include directory.") + return() + endif() + + set(_generated_srcs) + foreach(_ext ${protobuf_generate_GENERATE_EXTENSIONS}) + list(APPEND _generated_srcs "${protobuf_generate_PROTOC_OUT_DIR}/${_rel_dir}/${_basename}${_ext}") + endforeach() + list(APPEND _generated_srcs_all ${_generated_srcs}) + + set(_comment "Running ${protobuf_generate_LANGUAGE} protocol buffer compiler on ${_proto}") + if(protobuf_generate_PROTOC_OPTIONS) + set(_comment "${_comment}, protoc-options: ${protobuf_generate_PROTOC_OPTIONS}") + endif() + if(_plugin_options) + set(_comment "${_comment}, plugin-options: ${_plugin_options}") + endif() + + add_custom_command( + OUTPUT ${_generated_srcs} + COMMAND protobuf::protoc + ARGS ${protobuf_generate_PROTOC_OPTIONS} --${protobuf_generate_LANGUAGE}_out ${_plugin_options}:${protobuf_generate_PROTOC_OUT_DIR} ${_plugin} ${_protobuf_include_path} ${_abs_file} + DEPENDS ${_abs_file} protobuf::protoc + COMMENT ${_comment} + VERBATIM ) + endforeach() + + set_source_files_properties(${_generated_srcs_all} PROPERTIES GENERATED TRUE) + if(protobuf_generate_OUT_VAR) + set(${protobuf_generate_OUT_VAR} ${_generated_srcs_all} PARENT_SCOPE) + endif() + if(protobuf_generate_TARGET) + target_sources(${protobuf_generate_TARGET} PRIVATE ${_generated_srcs_all}) + endif() + +endfunction() + +# CMake FindProtobuf module compatible file +if(protobuf_MODULE_COMPATIBLE) + include("${CMAKE_CURRENT_LIST_DIR}/protobuf-module.cmake") +endif() diff --git a/optional/vtd/vendor/protobuf-2.6.1/cmake/protobuf-module.cmake b/optional/vtd/vendor/protobuf-2.6.1/cmake/protobuf-module.cmake new file mode 100644 index 000000000..dafcfd890 --- /dev/null +++ b/optional/vtd/vendor/protobuf-2.6.1/cmake/protobuf-module.cmake @@ -0,0 +1,229 @@ +# Copyright 2008 Google Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# Code generated by the Protocol Buffer compiler is owned by the owner +# of the input file used when generating it. This code is not +# standalone and requires a support library to be linked with it. This +# support library is itself covered by the above license. + +# --- BEGIN NOTICE --- +# Source: https://github.com/protocolbuffers/protobuf/blob/v3.21.12/cmake/ +# Modifications: +# - Add license text above from repository +# --- END NOTICE --- + +# This file contains backwards compatibility patches for various legacy functions and variables +# Functions + +function(PROTOBUF_GENERATE_CPP SRCS HDRS) + cmake_parse_arguments(protobuf_generate_cpp "" "EXPORT_MACRO" "" ${ARGN}) + + set(_proto_files "${protobuf_generate_cpp_UNPARSED_ARGUMENTS}") + if(NOT _proto_files) + message(SEND_ERROR "Error: PROTOBUF_GENERATE_CPP() called without any proto files") + return() + endif() + + if(PROTOBUF_GENERATE_CPP_APPEND_PATH) + set(_append_arg APPEND_PATH) + endif() + + if(DEFINED Protobuf_IMPORT_DIRS) + set(_import_arg IMPORT_DIRS ${Protobuf_IMPORT_DIRS}) + endif() + + set(_outvar) + protobuf_generate(${_append_arg} LANGUAGE cpp EXPORT_MACRO ${protobuf_generate_cpp_EXPORT_MACRO} OUT_VAR _outvar ${_import_arg} PROTOS ${_proto_files}) + + set(${SRCS}) + set(${HDRS}) + foreach(_file ${_outvar}) + if(_file MATCHES "cc$") + list(APPEND ${SRCS} ${_file}) + else() + list(APPEND ${HDRS} ${_file}) + endif() + endforeach() + set(${SRCS} ${${SRCS}} PARENT_SCOPE) + set(${HDRS} ${${HDRS}} PARENT_SCOPE) +endfunction() + +function(PROTOBUF_GENERATE_PYTHON SRCS) + if(NOT ARGN) + message(SEND_ERROR "Error: PROTOBUF_GENERATE_PYTHON() called without any proto files") + return() + endif() + + if(PROTOBUF_GENERATE_CPP_APPEND_PATH) + set(_append_arg APPEND_PATH) + endif() + + if(DEFINED Protobuf_IMPORT_DIRS) + set(_import_arg IMPORT_DIRS ${Protobuf_IMPORT_DIRS}) + endif() + + set(_outvar) + protobuf_generate(${_append_arg} LANGUAGE python OUT_VAR _outvar ${_import_arg} PROTOS ${ARGN}) + set(${SRCS} ${_outvar} PARENT_SCOPE) +endfunction() + +# Environment + +# Backwards compatibility +# Define camel case versions of input variables +foreach(UPPER + PROTOBUF_SRC_ROOT_FOLDER + PROTOBUF_IMPORT_DIRS + PROTOBUF_DEBUG + PROTOBUF_LIBRARY + PROTOBUF_PROTOC_LIBRARY + PROTOBUF_INCLUDE_DIR + PROTOBUF_PROTOC_EXECUTABLE + PROTOBUF_LIBRARY_DEBUG + PROTOBUF_PROTOC_LIBRARY_DEBUG + PROTOBUF_LITE_LIBRARY + PROTOBUF_LITE_LIBRARY_DEBUG + ) + if (DEFINED ${UPPER}) + string(REPLACE "PROTOBUF_" "Protobuf_" Camel ${UPPER}) + if (NOT DEFINED ${Camel}) + set(${Camel} ${${UPPER}}) + endif() + endif() +endforeach() + +if(0) +if(DEFINED Protobuf_SRC_ROOT_FOLDER) + message(AUTHOR_WARNING "Variable Protobuf_SRC_ROOT_FOLDER defined, but not" + " used in CONFIG mode") +endif() + +include(SelectLibraryConfigurations) + +# Internal function: search for normal library as well as a debug one +# if the debug one is specified also include debug/optimized keywords +# in *_LIBRARIES variable +function(_protobuf_find_libraries name filename) + if(${name}_LIBRARIES) + # Use result recorded by a previous call. + elseif(${name}_LIBRARY) + # Honor cache entry used by CMake 3.5 and lower. + set(${name}_LIBRARIES "${${name}_LIBRARY}" PARENT_SCOPE) + elseif(TARGET protobuf::lib${filename}) + get_target_property(${name}_LIBRARY_RELEASE protobuf::lib${filename} + LOCATION_RELEASE) + get_target_property(${name}_LIBRARY_RELWITHDEBINFO protobuf::lib${filename} + LOCATION_RELWITHDEBINFO) + get_target_property(${name}_LIBRARY_MINSIZEREL protobuf::lib${filename} + LOCATION_MINSIZEREL) + get_target_property(${name}_LIBRARY_DEBUG protobuf::lib${filename} + LOCATION_DEBUG) + + select_library_configurations(${name}) + set(${name}_LIBRARY ${${name}_LIBRARY} PARENT_SCOPE) + set(${name}_LIBRARIES ${${name}_LIBRARIES} PARENT_SCOPE) + endif() +endfunction() + +# +# Main. +# + +# By default have PROTOBUF_GENERATE_CPP macro pass -I to protoc +# for each directory where a proto file is referenced. +if(NOT DEFINED PROTOBUF_GENERATE_CPP_APPEND_PATH) + set(PROTOBUF_GENERATE_CPP_APPEND_PATH TRUE) +endif() + +# The Protobuf library +_protobuf_find_libraries(Protobuf protobuf) + +# The Protobuf Lite library +_protobuf_find_libraries(Protobuf_LITE protobuf-lite) + +# The Protobuf Protoc Library +_protobuf_find_libraries(Protobuf_PROTOC protoc) + +# Set the include directory +get_target_property(Protobuf_INCLUDE_DIRS protobuf::libprotobuf + INTERFACE_INCLUDE_DIRECTORIES) + +# Set the protoc Executable +if(NOT Protobuf_PROTOC_EXECUTABLE AND TARGET protobuf::protoc) + get_target_property(Protobuf_PROTOC_EXECUTABLE protobuf::protoc + IMPORTED_LOCATION_RELEASE) + if(NOT EXISTS "${Protobuf_PROTOC_EXECUTABLE}") + get_target_property(Protobuf_PROTOC_EXECUTABLE protobuf::protoc + IMPORTED_LOCATION_RELWITHDEBINFO) + endif() + if(NOT EXISTS "${Protobuf_PROTOC_EXECUTABLE}") + get_target_property(Protobuf_PROTOC_EXECUTABLE protobuf::protoc + IMPORTED_LOCATION_MINSIZEREL) + endif() + if(NOT EXISTS "${Protobuf_PROTOC_EXECUTABLE}") + get_target_property(Protobuf_PROTOC_EXECUTABLE protobuf::protoc + IMPORTED_LOCATION_DEBUG) + endif() + if(NOT EXISTS "${Protobuf_PROTOC_EXECUTABLE}") + get_target_property(Protobuf_PROTOC_EXECUTABLE protobuf::protoc + IMPORTED_LOCATION_NOCONFIG) + endif() +endif() + +# Version info variable +set(Protobuf_VERSION "3.21.9.0") + +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(Protobuf + REQUIRED_VARS Protobuf_PROTOC_EXECUTABLE Protobuf_LIBRARIES Protobuf_INCLUDE_DIRS + VERSION_VAR Protobuf_VERSION +) + +# Backwards compatibility +endif() +foreach(Camel + Protobuf_VERSION + Protobuf_SRC_ROOT_FOLDER + Protobuf_IMPORT_DIRS + Protobuf_DEBUG + Protobuf_INCLUDE_DIRS + Protobuf_LIBRARIES + Protobuf_PROTOC_LIBRARIES + Protobuf_LITE_LIBRARIES + Protobuf_LIBRARY + Protobuf_PROTOC_LIBRARY + Protobuf_INCLUDE_DIR + Protobuf_PROTOC_EXECUTABLE + Protobuf_LIBRARY_DEBUG + Protobuf_PROTOC_LIBRARY_DEBUG + Protobuf_LITE_LIBRARY + Protobuf_LITE_LIBRARY_DEBUG + ) + string(TOUPPER ${Camel} UPPER) + set(${UPPER} ${${Camel}}) +endforeach() diff --git a/optional/vtd/vendor/protobuf-2.6.1/cmake/protobuf-options.cmake b/optional/vtd/vendor/protobuf-2.6.1/cmake/protobuf-options.cmake new file mode 100644 index 000000000..e54b078e0 --- /dev/null +++ b/optional/vtd/vendor/protobuf-2.6.1/cmake/protobuf-options.cmake @@ -0,0 +1,45 @@ +# Copyright 2008 Google Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# Code generated by the Protocol Buffer compiler is owned by the owner +# of the input file used when generating it. This code is not +# standalone and requires a support library to be linked with it. This +# support library is itself covered by the above license. + +# --- BEGIN NOTICE --- +# Source: https://github.com/protocolbuffers/protobuf/blob/v3.21.12/cmake/ +# Modifications: +# - Add license text above from repository +# --- END NOTICE --- +# Verbose output +option(protobuf_VERBOSE "Enable for verbose output" OFF) +mark_as_advanced(protobuf_VERBOSE) + +# FindProtobuf module compatible +option(protobuf_MODULE_COMPATIBLE "CMake built-in FindProtobuf.cmake module compatible" OFF) +mark_as_advanced(protobuf_MODULE_COMPATIBLE) diff --git a/optional/vtd/vendor/protobuf-2.6.1/conandata.yml b/optional/vtd/vendor/protobuf-2.6.1/conandata.yml new file mode 100644 index 000000000..b06d7a5ba --- /dev/null +++ b/optional/vtd/vendor/protobuf-2.6.1/conandata.yml @@ -0,0 +1,8 @@ +--- +sources: + "2.6.1": + url: "https://github.com/protocolbuffers/protobuf/releases/download/v2.6.1/protobuf-2.6.1.tar.bz2" + sha256: "ee445612d544d885ae240ffbcbf9267faa9f593b7b101f21d58beceb92661910" +patches: + "2.6.1": + - patches/protobuf_v2.6.1.patch diff --git a/optional/vtd/vendor/protobuf-2.6.1/conanfile.py b/optional/vtd/vendor/protobuf-2.6.1/conanfile.py index ebad85cef..6300df328 100644 --- a/optional/vtd/vendor/protobuf-2.6.1/conanfile.py +++ b/optional/vtd/vendor/protobuf-2.6.1/conanfile.py @@ -2,8 +2,12 @@ # pylint: skip-file import os +import subprocess -from conans import AutoToolsBuildEnvironment, ConanFile, tools +from conan import ConanFile +from conan.tools import files, gnu + +required_conan_version = ">=1.52.0" class ProtobufConan(ConanFile): @@ -14,38 +18,97 @@ class ProtobufConan(ConanFile): description = "Google Protocol Buffers." topics = ("protobuf", "serialization") settings = "os", "compiler", "build_type", "arch" - generators = "cmake" - build_policy = "missing" - _patch_v2p6p1 = "patches/protobuf_v2.6.1.patch" # git format-patch v2.6.1 --stdout > protobuf_v2.6.1.patch + generators = "AutotoolsToolchain" + options = { + "lite": [True, False], + } + default_options = { + "lite": False, + } exports_sources = [ - _patch_v2p6p1, - "CMakeLists.txt", + "patches/*", + "cmake/*", ] build_requires = [ "autoconf/[>=2.69]", "libtool/[>=2.4.6]", ] - _src_dir = "protobuf" - _git_url = url - _git_ref = f"v{version}" - _git_dir = "protobuf" - _autotools = None + + @property + def _is_clang_x86(self): + return self.settings.compiler == "clang" and self.settings.arch == "x86" def source(self): - git = tools.Git(folder=self._git_dir) - git.clone(self._git_url, branch=self._git_ref, shallow=True) + files.get(self, **self.conan_data["sources"][self.version], strip_root=True) + for patch in self.conan_data["patches"][self.version]: + files.patch(self, patch_file=patch) def build(self): - # change googletest version - tools.patch(base_path=self._src_dir, patch_file=self._patch_v2p6p1) - self.run(f"cd {self._src_dir} && ./autogen.sh") - # configure and make - self._autotools = AutoToolsBuildEnvironment(self) - self._autotools.configure(configure_dir=self._src_dir) - self._autotools.make() + autotools = gnu.Autotools(self) + if self.should_configure: + autotools.configure() + if self.should_build: + autotools.make() + + @property + def _cmake_install_base_path(self): + return os.path.join("lib", "cmake", "protobuf") def package(self): - self._autotools.make(target="install") + if not self.should_install: + return + autotools = gnu.Autotools(self) + autotools.install() + + # files.copy(self, "*.proto", + files.copy(self, "cmake/*", dst=os.path.join(self.package_folder, self._cmake_install_base_path), src=self.source_folder, keep_path=False) + + if not self.options.lite: + files.rm(self, "libprotobuf-lite*", os.path.join(self.package_folder, "lib")) + files.rm(self, "libprotobuf-lite*", os.path.join(self.package_folder, "bin")) def package_info(self): - self.cpp_info.libs = tools.collect_libs(self) + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_module_file_name", "Protobuf") + self.cpp_info.set_property("cmake_file_name", "protobuf") + self.cpp_info.set_property("pkg_config_name", "protobuf_full_package") # unofficial, but required to avoid side effects (libprotobuf component "steals" the default global pkg_config name) + + build_modules = [ + os.path.join(self._cmake_install_base_path, "protobuf-generate.cmake"), + os.path.join(self._cmake_install_base_path, "protobuf-module.cmake"), + os.path.join(self._cmake_install_base_path, "protobuf-options.cmake"), + ] + self.cpp_info.set_property("cmake_build_modules", build_modules) + + # libprotobuf + self.cpp_info.components["libprotobuf"].set_property("cmake_target_name", "protobuf::libprotobuf") + self.cpp_info.components["libprotobuf"].set_property("pkg_config_name", "protobuf") + self.cpp_info.components["libprotobuf"].includedirs = ["include"] + self.cpp_info.components["libprotobuf"].libs = ["protobuf"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["libprotobuf"].system_libs.extend(["m", "pthread"]) + if self._is_clang_x86 or "arm" in str(self.settings.arch): + self.cpp_info.components["libprotobuf"].system_libs.append("atomic") + + # libprotoc + self.cpp_info.components["libprotoc"].set_property("cmake_target_name", "protobuf::libprotoc") + self.cpp_info.components["libprotoc"].libs = ["protoc"] + self.cpp_info.components["libprotoc"].requires = ["libprotobuf"] + + # libprotobuf-lite + if self.options.lite: + self.cpp_info.components["libprotobuf-lite"].set_property("cmake_target_name", "protobuf::libprotobuf-lite") + self.cpp_info.components["libprotobuf-lite"].set_property("pkg_config_name", "protobuf-lite") + self.cpp_info.components["libprotobuf-lite"].includedirs = ["include"] + self.cpp_info.components["libprotobuf-lite"].libs = ["protobuf-lite"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["libprotobuf-lite"].system_libs.extend(["m", "pthread"]) + if self._is_clang_x86 or "arm" in str(self.settings.arch): + self.cpp_info.components["libprotobuf-lite"].system_libs.append("atomic") + + # TODO: Remove once everything is on Conan v2: + self.cpp_info.filenames["cmake_find_package"] = "Protobuf" + self.cpp_info.filenames["cmake_find_package_multi"] = "protobuf" + self.cpp_info.names["pkg_config"] ="protobuf_full_package" + self.env_info.LD_LIBRARY_PATH.append(os.path.join(self.package_folder, "lib")) + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/optional/vtd/vendor/protobuf-2.6.1/test_package/CMakeLists.txt b/optional/vtd/vendor/protobuf-2.6.1/test_package/CMakeLists.txt new file mode 100644 index 000000000..c24d54471 --- /dev/null +++ b/optional/vtd/vendor/protobuf-2.6.1/test_package/CMakeLists.txt @@ -0,0 +1,21 @@ +cmake_minimum_required(VERSION 3.15) + +project(test_package LANGUAGES CXX) + +find_package(Protobuf CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp addressbook.proto) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +target_include_directories(${PROJECT_NAME} PRIVATE "${CMAKE_CURRENT_BINARY_DIR}") +if (protobuf_LITE) + target_link_libraries(${PROJECT_NAME} PRIVATE protobuf::libprotobuf-lite) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE protobuf::libprotobuf) +endif() + +if(TARGET protobuf::libprotoc) + target_link_libraries(${PROJECT_NAME} PRIVATE protobuf::libprotoc) +endif() + +protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS TARGET ${PROJECT_NAME}) +protobuf_generate(LANGUAGE cpp TARGET ${PROJECT_NAME} PROTOS addressbook.proto) diff --git a/optional/vtd/vendor/protobuf-2.6.1/test_package/addressbook.proto b/optional/vtd/vendor/protobuf-2.6.1/test_package/addressbook.proto new file mode 100644 index 000000000..bbb0e4c33 --- /dev/null +++ b/optional/vtd/vendor/protobuf-2.6.1/test_package/addressbook.proto @@ -0,0 +1,28 @@ +syntax = "proto2"; + +import "google/protobuf/descriptor.proto"; + +package tutorial; + +message Person { + required string name = 1; + required int32 id = 2; + optional string email = 3; + + enum PhoneType { + MOBILE = 0; + HOME = 1; + WORK = 2; + } + + message PhoneNumber { + required string number = 1; + optional PhoneType type = 2 [default = HOME]; + } + + repeated PhoneNumber phone = 4; +} + +message AddressBook { + repeated Person person = 1; +} diff --git a/optional/vtd/vendor/protobuf-2.6.1/test_package/conanfile.py b/optional/vtd/vendor/protobuf-2.6.1/test_package/conanfile.py new file mode 100644 index 000000000..81404c861 --- /dev/null +++ b/optional/vtd/vendor/protobuf-2.6.1/test_package/conanfile.py @@ -0,0 +1,34 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake, CMakeToolchain +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualBuildEnv", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["protobuf_LITE"] = self.dependencies[self.tested_reference_str].options.lite + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/optional/vtd/vendor/protobuf-2.6.1/test_package/test_package.cpp b/optional/vtd/vendor/protobuf-2.6.1/test_package/test_package.cpp new file mode 100644 index 000000000..9c12d10b0 --- /dev/null +++ b/optional/vtd/vendor/protobuf-2.6.1/test_package/test_package.cpp @@ -0,0 +1,32 @@ +#include +#include + +#include + +#include "addressbook.pb.h" + +using namespace std; + +int main() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + tutorial::AddressBook address_book; + tutorial::Person* person = address_book.add_person(); + + person->set_id(123); + person->set_name("John"); + person->set_email("john@gmail.com"); + tutorial::Person::PhoneNumber* phone_number = person->add_phone(); + phone_number->set_number("1234567"); + phone_number->set_type(tutorial::Person::MOBILE); + + string output; + address_book.SerializeToString(&output); + + tutorial::AddressBook address_book2; + address_book2.ParseFromString(output); + + cout<" - add_library(vtd::api ALIAS vtd-api) "$" ) @@ -18,7 +17,6 @@ include(GNUInstallDirs) install(TARGETS vtd-api LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - add_library(vtd::api ALIAS vtd-api) ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} )