Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
pablode committed Nov 4, 2024
1 parent e5c7bb6 commit 91a7bbd
Show file tree
Hide file tree
Showing 5 changed files with 310 additions and 8 deletions.
12 changes: 10 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
cmake_minimum_required(VERSION 3.15 FATAL_ERROR)

#set(CMAKE_FIND_DEBUG_MODE 1)
project(guc VERSION 0.5)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

set(CMAKE_MODULE_PATH "${CMAKE_PROJECT_DIR}/cmake")

# Find USD - only non-monolithic builds have been tested.
find_package(pxr CONFIG REQUIRED)

Expand All @@ -14,9 +16,15 @@ find_package(pxr CONFIG REQUIRED)
find_package(MaterialX 1.38.6 REQUIRED HINTS ${pxr_DIR})

# We need to open PNG and JPEG files in order to read the number of channels
# for shading node creation. OIIO should be provided by the USD installation.
# for shading node creation. OIIO can be provided by the USD installation,
# otherwise we fall back to stb_image.
find_package(OpenImageIO HINTS ${pxr_DIR})

# Draco CMake config file is broken in this version, rely on Find* script.
# TODO: set Draco_DIR / ROOT instead of pxr_DIR
#find_package(XDraco)# HINTS ${pxr_DIR})
include(cmake/FindXDraco.cmake)

option(GUC_BUILD_EXECUTABLE "Build the guc executable." ON)
option(GUC_BUILD_USDGLTF "Build the Sdf file format plugin." OFF)

Expand Down
11 changes: 11 additions & 0 deletions src/libguc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,16 @@ else()
list(APPEND LIBGUC_SHARED_LIBRARIES $<BUILD_INTERFACE:stb_image>)
endif()

if(draco_FOUND)
list(APPEND LIBGUC_DEFINES "GUC_USE_DRACO")
if(NOT TARGET usd_ms)
list(APPEND LIBGUC_SHARED_LIBRARIES ${DRACO_LIBRARIES})
endif()
# TODO: how are headers included? --> need target
else()
message(FATAL_ERROR "Draco NOT FOUND :(")
endif()

#
# libguc
#
Expand All @@ -77,6 +87,7 @@ target_link_libraries(libguc PRIVATE ${LIBGUC_SHARED_LIBRARIES})
target_include_directories(libguc
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
PUBLIC $<INSTALL_INTERFACE:include>
${DRACO_INCLUDE_DIRS}
)

set_target_properties(
Expand Down
Loading

0 comments on commit 91a7bbd

Please sign in to comment.