Skip to content

Commit

Permalink
Updated cgns to 4.3.0, plus some recipe fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
paulharris committed May 18, 2022
1 parent b4b92c3 commit 95afd77
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 6 deletions.
10 changes: 8 additions & 2 deletions recipes/cgns/all/conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@ sources:
"3.4.1":
url: "https://github.com/CGNS/CGNS/archive/v3.4.1.tar.gz"
sha256: "d32595e7737b9332243bd3de1eb8c018a272f620f09b289dea8292eba1365994"
"4.3.0":
url: "https://github.com/CGNS/CGNS/archive/v4.3.0.tar.gz"
sha256: "7709eb7d99731dea0dd1eff183f109eaef8d9556624e3fbc34dc5177afc0a032"
patches:
"3.4.1":
- patch_file: "patches/fix_find_hdf5.patch"
- patch_file: "patches/3.4.1-fix_find_hdf5.patch"
base_path: "source_subfolder"
- patch_file: "patches/fix_static_or_shared.patch"
- patch_file: "patches/3.4.1-fix_static_or_shared.patch"
base_path: "source_subfolder"
"4.3.0":
- patch_file: "patches/4.3.0-fixes.patch"
base_path: "source_subfolder"
8 changes: 5 additions & 3 deletions recipes/cgns/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
from conans import ConanFile, CMake, tools
from conan.tools.files import rename


required_conan_version = ">=1.29.1"
Expand All @@ -9,7 +10,7 @@ class CgnsConan(ConanFile):
name = "cgns"
description = "Standard for data associated with the numerical solution " \
"of fluid dynamics equations."
topics = ("conan", "cgns", "data", "cfd", "fluids")
topics = ("cgns", "data", "cfd", "fluids")
homepage = "http://cgns.org/"
license = "Zlib"
url = "https://github.com/conan-io/conan-center-index"
Expand Down Expand Up @@ -49,11 +50,11 @@ def configure(self):

def requirements(self):
if self.options.with_hdf5:
self.requires("hdf5/1.12.0")
self.requires("hdf5/1.12.1")

def source(self):
tools.get(**self.conan_data["sources"][self.version])
os.rename("CGNS-" + self.version, self._source_subfolder)
rename(self, "CGNS-" + self.version, self._source_subfolder)

def _configure_cmake(self):
if self._cmake:
Expand Down Expand Up @@ -87,6 +88,7 @@ def package(self):
os.remove(os.path.join(self.package_folder, "include", "cgnsBuild.defs"))

def package_info(self):
self.cpp_info.builddirs = [os.path.join("lib","cmake","cgns")]
self.cpp_info.libs = ["cgnsdll" if self.settings.os == "Windows" and self.options.shared else "cgns"]
if self.settings.os == "Windows" and self.options.shared:
self.cpp_info.defines = ["CGNSDLL=__declspec(dllimport)"] # we could instead define USE_DLL but it's too generic
12 changes: 12 additions & 0 deletions recipes/cgns/all/patches/4.3.0-fixes.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 103cb1f..d2b1563 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -738,7 +738,6 @@ install(EXPORT cgns-targets
# Tools #
#########

-add_subdirectory(tools)

#########
# Tests #
2 changes: 1 addition & 1 deletion recipes/cgns/all/test_package/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ def build(self):
cmake.build()

def test(self):
if not tools.cross_building(self.settings):
if not tools.cross_building(self):
bin_path = os.path.join("bin", "test_package")
self.run(bin_path, run_environment=True)
2 changes: 2 additions & 0 deletions recipes/cgns/config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
versions:
"3.4.1":
folder: all
"4.3.0":
folder: all

0 comments on commit 95afd77

Please sign in to comment.