From c6167f840e13d3298fff94c57a11f7832f5070eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ulrik=20J=C3=B8rgensen?= Date: Mon, 22 Apr 2024 15:10:00 +0200 Subject: [PATCH 1/5] Use conan 2.2.x --- .github/workflows/ci-cosim-demo-app.yml | 4 +- conanfile.py | 33 ++++++++++++++++ conanfile.txt | 51 ------------------------- 3 files changed, 35 insertions(+), 53 deletions(-) create mode 100644 conanfile.py delete mode 100644 conanfile.txt diff --git a/.github/workflows/ci-cosim-demo-app.yml b/.github/workflows/ci-cosim-demo-app.yml index 15f598e..a293f34 100644 --- a/.github/workflows/ci-cosim-demo-app.yml +++ b/.github/workflows/ci-cosim-demo-app.yml @@ -51,7 +51,7 @@ jobs: with: python-version: '3.x' - name: Install prerequisites - run: pip install conan==1.59 + run: pip install conan~=2.2.0 - name: Configure libcxx for Linux run: | conan profile new default --detect @@ -60,7 +60,7 @@ jobs: - name: Add Conan remote run: conan remote add osp https://osp.jfrog.io/artifactory/api/conan/conan-local --force - name: Install Conan deps - run: conan install -s build_type=Release . + run: conan install . - name: Download client uses: actions/download-artifact@v2 with: diff --git a/conanfile.py b/conanfile.py new file mode 100644 index 0000000..e3641d1 --- /dev/null +++ b/conanfile.py @@ -0,0 +1,33 @@ +from os import path +from conan import ConanFile +from conan.tools.files import copy + + +class ConanRecipe(ConanFile): + name = "cosim-demo-app" + url = "https://gitlab.sintef.no/open-simulation-platform/cosim-demo-app" + settings = "os", "compiler", "build_type", "arch" + package_type = "application" + generators = "VirtualRunEnv" + + def configure(self): + self.options["libcosim/*"].proxyfmu = True + + def requirements(self): + self.requires("libcosimc/0.11.0@osp/testing-feature_conan-2") + + def generate(self): + for dep in self.dependencies.values(): + if dep.ref.name == "libcosimc": + copy(self, "cosim.h", dep.cpp_info.includedirs[0], + path.join(self.build_folder, "include"), keep_path=False) + if dep.ref.name == "proxyfmu": + copy(self, "proxyfmu*", dep.cpp_info.bindirs[0], + path.join(self.build_folder, "dist", "bin"), keep_path=False) + for bindeps in dep.cpp_info.bindirs: + copy(self, "*.dll", bindeps, + path.join(self.build_folder, "dist", "bin"), keep_path=False) + + for libdeps in dep.cpp_info.libdirs: + copy(self, "*.so*", libdeps, + path.join(self.build_folder, "dist", "lib"), keep_path=False) \ No newline at end of file diff --git a/conanfile.txt b/conanfile.txt deleted file mode 100644 index aef4b29..0000000 --- a/conanfile.txt +++ /dev/null @@ -1,51 +0,0 @@ -[generators] - -[requires] -libcosimc/0.10.2@osp/stable - -[options] -libcosim:proxyfmu=True - -[imports] -include, cosim.h -> ./include - -bin, boost_chrono*.dll -> ./dist/bin -bin, boost_context*.dll -> ./dist/bin -bin, boost_date_time*.dll -> ./dist/bin -bin, boost_fiber*.dll -> ./dist/bin -bin, boost_filesystem*.dll -> ./dist/bin -bin, boost_log*.dll -> ./dist/bin -bin, boost_system*.dll -> ./dist/bin -bin, boost_thread*.dll -> ./dist/bin -bin, cosim*.dll -> ./dist/bin -bin, fmilib_shared.dll -> ./dist/bin -bin, xerces-c*.dll -> ./dist/bin -bin, yaml-cpp*.dll -> ./dist/bin -bin, zip.dll -> ./dist/bin -bin, proxyfmu* -> ./dist/bin -bin, fmilibwrapper*.dll -> ./dist/bin - -lib, libboost_chrono.so.* -> ./dist/lib -lib, libboost_context.so.* -> ./dist/lib -lib, libboost_date_time.so.* -> ./dist/lib -lib, libboost_fiber.so.* -> ./dist/lib -lib, libboost_filesystem.so.* -> ./dist/lib -lib, libboost_log.so.* -> ./dist/lib -lib, libboost_system.so.* -> ./dist/lib -lib, libboost_thread.so* -> ./dist/lib -lib, libcosim*.so -> ./dist/lib -lib, libfmilib_shared.so -> ./dist/lib -lib, libxerces-c*.so -> ./dist/lib -lib, libyaml-cpp*.so.* -> ./dist/lib -lib, libzip.so* -> ./dist/lib -lib, libfmilibwrapper*.so -> ./dist/lib -lib, libproxyfmu-client*.so -> ./dist/lib - -., license* -> ./dist/doc/licenses @ folder=True, ignore_case=True, keep_path=False -., */license* -> ./dist/doc/licenses @ folder=True, ignore_case=True, keep_path=False -., copying* -> ./dist/doc/licenses @ folder=True, ignore_case=True, keep_path=False -., */copying* -> ./dist/doc/licenses @ folder=True, ignore_case=True, keep_path=False -., notice* -> ./dist/doc/licenses @ folder=True, ignore_case=True, keep_path=False -., */notice* -> ./dist/doc/licenses @ folder=True, ignore_case=True, keep_path=False -., authors* -> ./dist/doc/licenses @ folder=True, ignore_case=True, keep_path=False -., */authors* -> ./dist/doc/licenses @ folder=True, ignore_case=True, keep_path=False From 1f5605df5045409d5a658b35bc360e3ccc1f76cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ulrik=20J=C3=B8rgensen?= Date: Tue, 23 Apr 2024 08:30:12 +0200 Subject: [PATCH 2/5] Update to conan 2 use --- .github/workflows/ci-cosim-demo-app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-cosim-demo-app.yml b/.github/workflows/ci-cosim-demo-app.yml index a293f34..79c85f3 100644 --- a/.github/workflows/ci-cosim-demo-app.yml +++ b/.github/workflows/ci-cosim-demo-app.yml @@ -54,7 +54,7 @@ jobs: run: pip install conan~=2.2.0 - name: Configure libcxx for Linux run: | - conan profile new default --detect + conan profile detect --name default --force conan profile update settings.compiler.libcxx=libstdc++11 default if: runner.os == 'Linux' - name: Add Conan remote From dec578be0249290137c238576977253dc833b489 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ulrik=20J=C3=B8rgensen?= Date: Tue, 23 Apr 2024 08:43:25 +0200 Subject: [PATCH 3/5] Remove obsolete conan command --- .github/workflows/ci-cosim-demo-app.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci-cosim-demo-app.yml b/.github/workflows/ci-cosim-demo-app.yml index 79c85f3..1feaf67 100644 --- a/.github/workflows/ci-cosim-demo-app.yml +++ b/.github/workflows/ci-cosim-demo-app.yml @@ -55,7 +55,6 @@ jobs: - name: Configure libcxx for Linux run: | conan profile detect --name default --force - conan profile update settings.compiler.libcxx=libstdc++11 default if: runner.os == 'Linux' - name: Add Conan remote run: conan remote add osp https://osp.jfrog.io/artifactory/api/conan/conan-local --force From b2c7d1d1df14354aa794229a35266dd14e9065dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ulrik=20J=C3=B8rgensen?= Date: Tue, 23 Apr 2024 10:10:31 +0200 Subject: [PATCH 4/5] Test adding build missing when running conan install --- .github/workflows/ci-cosim-demo-app.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-cosim-demo-app.yml b/.github/workflows/ci-cosim-demo-app.yml index 1feaf67..57c903f 100644 --- a/.github/workflows/ci-cosim-demo-app.yml +++ b/.github/workflows/ci-cosim-demo-app.yml @@ -52,14 +52,14 @@ jobs: python-version: '3.x' - name: Install prerequisites run: pip install conan~=2.2.0 - - name: Configure libcxx for Linux + - name: Configure conan profile for Linux run: | conan profile detect --name default --force if: runner.os == 'Linux' - name: Add Conan remote run: conan remote add osp https://osp.jfrog.io/artifactory/api/conan/conan-local --force - name: Install Conan deps - run: conan install . + run: conan install . --build missing - name: Download client uses: actions/download-artifact@v2 with: From eb50775fb6abb782dc350e5c44b1aab15cb9c182 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ulrik=20J=C3=B8rgensen?= Date: Tue, 23 Apr 2024 10:25:55 +0200 Subject: [PATCH 5/5] Also setup conan profile for Windows --- .github/workflows/ci-cosim-demo-app.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci-cosim-demo-app.yml b/.github/workflows/ci-cosim-demo-app.yml index 57c903f..75d52c9 100644 --- a/.github/workflows/ci-cosim-demo-app.yml +++ b/.github/workflows/ci-cosim-demo-app.yml @@ -52,10 +52,8 @@ jobs: python-version: '3.x' - name: Install prerequisites run: pip install conan~=2.2.0 - - name: Configure conan profile for Linux - run: | - conan profile detect --name default --force - if: runner.os == 'Linux' + - name: Add conan profile + run: conan profile detect --name default --force - name: Add Conan remote run: conan remote add osp https://osp.jfrog.io/artifactory/api/conan/conan-local --force - name: Install Conan deps