Skip to content

Commit

Permalink
Adjust mv cmake variables on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
alxvth committed Oct 9, 2024
1 parent 0e3421c commit 4ae4066
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 30 deletions.
2 changes: 2 additions & 0 deletions ExampleDependencies/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ add_library(${PROJECT_NAME} SHARED ${PLUGIN_SOURCES})
# Include ManiVault headers, including system data plugins
target_include_directories(${PROJECT_NAME} PRIVATE "${ManiVault_INCLUDE_DIR}")

message(STATUS "ManiVault_INCLUDE_DIR: ${ManiVault_INCLUDE_DIR}")

# -----------------------------------------------------------------------------
# Target properties
# -----------------------------------------------------------------------------
Expand Down
58 changes: 28 additions & 30 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,42 +109,45 @@ def generate(self):
# for Qt < 6.4.2
tc.variables["CMAKE_PREFIX_PATH"] = qt_dir

# Set the installation directory for ManiVault based on the MV_INSTALL_DIR environment variable
# or if none is specified, set it to the build/install dir.
if not os.environ.get("MV_INSTALL_DIR", None):
os.environ["MV_INSTALL_DIR"] = os.path.join(self.build_folder, "install")
print("MV_INSTALL_DIR: ", os.environ["MV_INSTALL_DIR"])
self.install_dir = pathlib.Path(os.environ["MV_INSTALL_DIR"]).as_posix()
# Install in subfolder of build
self.install_dir = pathlib.Path(self.build_folder, "install").as_posix()
print("Install dir: ", self.install_dir)

# Use the ManiVault .cmake files
mv_core_root = self.deps_cpp_info["hdps-core"].rootpath
shutil.copytree(mv_core_root, self.install_dir)
self.manivault_dir = os.path.join(self.install_dir, "cmake", "mv")

# Find ManiVault with find_package
self.manivault_dir = self.install_dir + '/cmake/mv/'
tc.variables["ManiVault_DIR"] = self.manivault_dir
print("ManiVault_DIR: ", self.manivault_dir)

# Set some build options
tc.variables["MV_UNITY_BUILD"] = "ON"

# Install vcpkg dependencies
vcpkg_dir = pathlib.Path(os.environ["VCPKG_ROOT"])
vcpkg_exe = vcpkg_dir / "vcpkg.exe" if self.settings.os == "Windows" else vcpkg_dir / "vcpkg"
vcpkg_tc = vcpkg_dir / "scripts" / "buildsystems" / "vcpkg.cmake"
if not os.environ.get("ManiVault_DIR", None):
vcpkg_dir = pathlib.Path(os.environ["VCPKG_ROOT"])
vcpkg_exe = vcpkg_dir / "vcpkg.exe" if self.settings.os == "Windows" else vcpkg_dir / "vcpkg"
vcpkg_tc = vcpkg_dir / "scripts" / "buildsystems" / "vcpkg.cmake"

vcpkg_triplet = "x64-windows"
if self.settings.os == "Macos":
vcpkg_triplet = "x64-osx"
if self.settings.os == "Linux":
vcpkg_triplet = "x64-linux"
vcpkg_triplet = "x64-windows"
if self.settings.os == "Macos":
vcpkg_triplet = "x64-osx"
if self.settings.os == "Linux":
vcpkg_triplet = "x64-linux"

print("vcpkg_dir: ", vcpkg_dir)
print("vcpkg_exe: ", vcpkg_exe)
print("vcpkg_tc: ", vcpkg_tc)
print("vcpkg_triplet: ", vcpkg_triplet)
print("vcpkg_dir: ", vcpkg_dir)
print("vcpkg_exe: ", vcpkg_exe)
print("vcpkg_tc: ", vcpkg_tc)
print("vcpkg_triplet: ", vcpkg_triplet)

tc.variables["VCPKG_LIBRARY_LINKAGE"] = "dynamic"
tc.variables["VCPKG_TARGET_TRIPLET"] = vcpkg_triplet
tc.variables["VCPKG_HOST_TRIPLET"] = vcpkg_triplet
tc.variables["VCPKG_ROOT"] = vcpkg_dir.as_posix()
tc.variables["VCPKG_LIBRARY_LINKAGE"] = "dynamic"
tc.variables["VCPKG_TARGET_TRIPLET"] = vcpkg_triplet
tc.variables["VCPKG_HOST_TRIPLET"] = vcpkg_triplet
tc.variables["VCPKG_ROOT"] = vcpkg_dir.as_posix()

tc.variables["CMAKE_PROJECT_INCLUDE"] = vcpkg_tc.as_posix()
tc.variables["CMAKE_PROJECT_INCLUDE"] = vcpkg_tc.as_posix()

tc.generate()

Expand All @@ -155,12 +158,7 @@ def _configure_cmake(self):
return cmake

def build(self):
print("Build OS is : ", self.settings.os)

# The ExamplePlugins build expects the ManiVaultStudio package to be in this install dir
hdps_pkg_root = self.deps_cpp_info["hdps-core"].rootpath
print("Install dir type: ", self.install_dir)
shutil.copytree(hdps_pkg_root, self.install_dir)
print("Build OS is: ", self.settings.os)

cmake = self._configure_cmake()
cmake.build(build_type="Debug")
Expand Down

0 comments on commit 4ae4066

Please sign in to comment.