Skip to content

Commit

Permalink
Safely test with_tk option
Browse files Browse the repository at this point in the history
  • Loading branch information
EstebanDugueperoux2 committed Aug 28, 2024
1 parent 63ce290 commit f2a82a5
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 35 deletions.
18 changes: 9 additions & 9 deletions recipes/opencascade/all/conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ sources:
"7.8.1":
url: "https://github.com/Open-Cascade-SAS/OCCT/archive/refs/tags/V7_8_1.tar.gz"
sha256: "7321af48c34dc253bf8aae3f0430e8cb10976961d534d8509e72516978aa82f5"
"7.6.2":
url: "https://github.com/Open-Cascade-SAS/OCCT/archive/refs/tags/V7_6_2.tar.gz"
sha256: "dea04077d71507c666aaa7ccaeacc73ab580d6572d7f75e90a1984c4c0302a7a"
"7.6.0":
url: "https://github.com/Open-Cascade-SAS/OCCT/archive/refs/tags/V7_6_0.tar.gz"
sha256: "73f8f71be02c1d9a977e854bcc9202502184d339f1f212c19797a5f23baefabe"
"7.5.0":
url: "https://github.com/Open-Cascade-SAS/OCCT/archive/V7_5_0.tar.gz"
sha256: "dbe1d62a9317ad1516bd4575293d9aab2dc20206ca7a60a7705c9a3b77dc59c9"
# "7.6.2":
# url: "https://github.com/Open-Cascade-SAS/OCCT/archive/refs/tags/V7_6_2.tar.gz"
# sha256: "dea04077d71507c666aaa7ccaeacc73ab580d6572d7f75e90a1984c4c0302a7a"
# "7.6.0":
# url: "https://github.com/Open-Cascade-SAS/OCCT/archive/refs/tags/V7_6_0.tar.gz"
# sha256: "73f8f71be02c1d9a977e854bcc9202502184d339f1f212c19797a5f23baefabe"
# "7.5.0":
# url: "https://github.com/Open-Cascade-SAS/OCCT/archive/V7_5_0.tar.gz"
# sha256: "dbe1d62a9317ad1516bd4575293d9aab2dc20206ca7a60a7705c9a3b77dc59c9"
patches:
"7.8.1":
- patch_file: "patches/7.8.1-fix-tkexpress-linking.patch"
Expand Down
41 changes: 21 additions & 20 deletions recipes/opencascade/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class OpenCascadeConan(ConanFile):
"with_tbb": [True, False],
"with_opengl": [True, False],
"extended_debug_messages": [True, False],
"with_samples": [True, False],
}
default_options = {
"shared": False,
Expand All @@ -52,6 +53,7 @@ class OpenCascadeConan(ConanFile):
"with_tbb": False,
"with_opengl": True,
"extended_debug_messages": False,
"with_samples": False
}

short_paths = True
Expand Down Expand Up @@ -113,8 +115,7 @@ def layout(self):
cmake_layout(self, src_folder="src")

def requirements(self):
if self.options.with_tk:
self.requires("tcl/8.6.10")
# self.requires("tcl/8.6.10")
if self._link_tk:
self.requires("tk/8.6.10")
self.requires("freetype/2.13.2")
Expand All @@ -136,6 +137,8 @@ def requirements(self):
self.requires("draco/1.5.6")
if self.options.with_tbb:
self.requires("onetbb/2021.10.0")
if self.options.with_samples:
self.requires("qt/6.7.1")

def validate(self):
if self.settings.compiler.get_safe("cppstd"):
Expand All @@ -160,9 +163,9 @@ def generate(self):
tc.variables["CMAKE_CXX_STANDARD"] = self._min_cppstd
else:
if not valid_min_cppstd(self, self._min_cppstd):
tc.cache_variables["BUILD_CPP_STANDARD"] = self._min_cppstd
tc.cache_variables["BUILD_CPP_STANDARD"] = "C++"+self._min_cppstd
else:
tc.cache_variables["BUILD_CPP_STANDARD"] = str(self.settings.compiler.cppstd)
tc.cache_variables["BUILD_CPP_STANDARD"] = "C++"+str(self.settings.compiler.cppstd)

tc.cache_variables["BUILD_LIBRARY_TYPE"] = "Shared" if self.options.shared else "Static"
tc.cache_variables["INSTALL_TEST_CASES"] = False
Expand All @@ -184,7 +187,7 @@ def generate(self):

if is_msvc(self):
tc.cache_variables["BUILD_SAMPLES_MFC"] = False
tc.cache_variables["BUILD_SAMPLES_QT"] = False
tc.cache_variables["BUILD_SAMPLES_QT"] = self.options.with_samples
tc.cache_variables["BUILD_Inspector"] = False
if is_apple_os(self):
tc.cache_variables["USE_GLX"] = False
Expand Down Expand Up @@ -220,9 +223,6 @@ def _patch_sources(self):
occt_csf_cmake = os.path.join(self.source_folder, "adm", "cmake", "occt_csf.cmake")
occt_defs_flags_cmake = os.path.join(self.source_folder, "adm", "cmake", "occt_defs_flags.cmake")

# modules = os.path.join(self.source_folder, "adm", "MODULES")
# replace_in_file(self, modules, "DETools TKExpress ExpToCasExe", "")

# Inject interface definitions of dependencies because opencascade
# does not always link to CMake imported targets
sorted_deps = [dep for dep in reversed(self.dependencies.host.topological_sort.values())]
Expand Down Expand Up @@ -278,18 +278,19 @@ def _patch_sources(self):
"set (CSF_FREETYPE \"freetype\")",
f"set (CSF_FREETYPE \"{freetype_libs}\")",
)
## tcl
# deps_targets.append("tcl::tcl")
# replace_in_file(self, cmakelists, "OCCT_INCLUDE_CMAKE_FILE (\"adm/cmake/tcl\")", "find_package(TCL REQUIRED)")
# tcl_libs = " ".join(self.dependencies["tcl"].cpp_info.aggregated_components().libs)
# csf_tcl_libs = f"set (CSF_TclLibs \"{tcl_libs}\")"
# replace_in_file(self, occt_csf_cmake, "set (CSF_TclLibs \"tcl86\")", csf_tcl_libs)
# replace_in_file(self, occt_csf_cmake, "set (CSF_TclLibs Tcl)", csf_tcl_libs)
# if Version(self.version) >= "7.6.0":
# replace_in_file(self, occt_csf_cmake, "set (CSF_TclLibs \"tcl8.6\")", csf_tcl_libs)
# else:
# replace_in_file(self, occt_csf_cmake, "set (CSF_TclLibs \"tcl8.6\")", csf_tcl_libs)
## tk
# tcl
if Version(self.version) <= "7.6.0":
deps_targets.append("tcl::tcl")
replace_in_file(self, cmakelists, "OCCT_INCLUDE_CMAKE_FILE (\"adm/cmake/tcl\")", "find_package(TCL REQUIRED)")
tcl_libs = " ".join(self.dependencies["tcl"].cpp_info.aggregated_components().libs)
csf_tcl_libs = f"set (CSF_TclLibs \"{tcl_libs}\")"
replace_in_file(self, occt_csf_cmake, "set (CSF_TclLibs \"tcl86\")", csf_tcl_libs)
replace_in_file(self, occt_csf_cmake, "set (CSF_TclLibs Tcl)", csf_tcl_libs)
if Version(self.version) >= "7.6.0":
replace_in_file(self, occt_csf_cmake, "set (CSF_TclLibs \"tcl8.6\")", csf_tcl_libs)
else:
replace_in_file(self, occt_csf_cmake, "set (CSF_TclLibs \"tcl8.6\")", csf_tcl_libs)
# tk
if self._link_tk:
deps_targets.append("tk::tk")
replace_in_file(self, cmakelists, "OCCT_INCLUDE_CMAKE_FILE (\"adm/cmake/tk\")", "find_package(tk REQUIRED)")
Expand Down
12 changes: 6 additions & 6 deletions recipes/opencascade/config.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
versions:
"7.8.1":
folder: all
"7.6.2":
folder: all
"7.6.0":
folder: all
"7.5.0":
folder: all
# "7.6.2":
# folder: all
# "7.6.0":
# folder: all
# "7.5.0":
# folder: all

0 comments on commit f2a82a5

Please sign in to comment.