diff --git a/conanfile.py b/conanfile.py index f3d22f0..79961c1 100644 --- a/conanfile.py +++ b/conanfile.py @@ -85,6 +85,13 @@ def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + def generate_vcpkg(self): + # Install vcpkg dependencies + self.vcpkg_dir = os.environ["VCPKG_ROOT"] + print("vcpkg_dir: ", vcpkg_dir) + self.vcpkg_exe = f"{self.vcpkg_dir}/vcpkg.exe" if self.settings.os == "Windows" else f"{self.vcpkg_dir}/vcpkg" + self.run(f"{self.vcpkg_exe} install --manifest") + def generate(self): generator = None if self.settings.os == "Macos": @@ -115,19 +122,13 @@ def generate(self): # Set some build options tc.variables["MV_UNITY_BUILD"] = "ON" - tc.generate() + # vcpkg settings + tc.variables["CMAKE_PROJECT_INCLUDE "] = os.path.join(self.vcpkg_dir, "scripts", "buildsystems", "vcpkg.cmake") - # Install vcpkg dependencies - vcpkg_dir = os.environ["VCPKG_ROOT"] - print("vcpkg_dir: ", vcpkg_dir) - #vcpkg_exe = f"{vcpkg_dir}/vcpkg.exe" if self.settings.os == "Windows" else f"{vcpkg_dir}/vcpkg" - #self.run(f"{vcpkg_exe} install --manifest") + tc.generate() def _configure_cmake(self): cmake = CMake(self) - # Set Conan's toolchain with CMAKE_PROJECT_INCLUDE to include Conan toolchain early - cmake.definitions["CMAKE_PROJECT_INCLUDE"] = os.path.join(self.build_folder, "conan_toolchain.cmake") - cmake.definitions["CMAKE_TOOLCHAIN_FILE"] = os.path.join(os.environ["VCPKG_ROOT"], "vcpkg/scripts/buildsystems/vcpkg.cmake") cmake.configure(build_script_folder="hdps/ExamplePlugins") cmake.verbose = True return cmake