Skip to content

Commit

Permalink
Prepare for Conan 2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
Latios96 committed Aug 12, 2022
1 parent 94e2691 commit 25ca40a
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions recipes/opensubdiv/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import functools
import os

from conans import ConanFile, CMake, tools
from conans.errors import ConanInvalidConfiguration
from conan import ConanFile
from conan.tools.files import get, replace_in_file
from conans import CMake, tools
from conan.errors import ConanInvalidConfiguration

required_conan_version = ">=1.48.0"


class OpenSubdivConan(ConanFile):
Expand Down Expand Up @@ -93,7 +97,7 @@ def validate(self):
)

def source(self):
tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder)
get(self, **self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder)

@property
def _osd_gpu_enabled(self):
Expand Down Expand Up @@ -134,9 +138,9 @@ def _configure_cmake(self):
def build(self):
if self.settings.os == "Macos":
path = os.path.join(self._source_subfolder, "opensubdiv", "CMakeLists.txt")
tools.replace_in_file(path, "${CMAKE_SOURCE_DIR}/opensubdiv", "${CMAKE_SOURCE_DIR}/source_subfolder/opensubdiv")
replace_in_file(self, path, "${CMAKE_SOURCE_DIR}/opensubdiv", "${CMAKE_SOURCE_DIR}/source_subfolder/opensubdiv")
if not self._osd_gpu_enabled:
tools.replace_in_file(path, "$<TARGET_OBJECTS:osd_gpu_obj>", "")
replace_in_file(self, path, "$<TARGET_OBJECTS:osd_gpu_obj>", "")
cmake = self._configure_cmake()
cmake.build()

Expand Down

0 comments on commit 25ca40a

Please sign in to comment.