From e602521dd24a32b290c7e4f9c6ddab65e3910eec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9a=20Machizaud?= Date: Wed, 20 May 2026 14:40:54 +0200 Subject: [PATCH] Add minimal CMake setup --- CMakeLists.txt | 54 ++++++++++++++ examples/CMakeLists.txt | 14 ++++ .../minimal_cpp_example.cpp | 2 +- include/CMakeLists.txt | 70 +++++++++++++++++++ .../impl}/data/openpbr_energy_array_access.h | 0 .../impl}/data/openpbr_energy_arrays.h | 0 ...al_dielectric_avg_energy_complement_data.h | 0 ..._ideal_dielectric_energy_complement_data.h | 0 ...r_ideal_dielectric_reflection_ratio_data.h | 0 ...r_ideal_metal_avg_energy_complement_data.h | 0 ...enpbr_ideal_metal_energy_complement_data.h | 0 .../openpbr/impl}/data/openpbr_ltc_array.h | 0 .../openpbr/impl}/data/openpbr_ltc_data.h | 0 ...ue_dielectric_avg_energy_complement_data.h | 0 ...opaque_dielectric_energy_complement_data.h | 0 .../openpbr/impl}/openpbr_aggregate_lobe.h | 0 {impl => include/openpbr/impl}/openpbr_bsdf.h | 0 .../openpbr/impl}/openpbr_coating_lobe.h | 0 .../openpbr/impl}/openpbr_complex.h | 0 .../openpbr_comprehensive_microfacet_lobe.h | 0 .../openpbr_constant_reflection_coefficient.h | 0 .../openpbr/impl}/openpbr_diffuse_lobe.h | 0 .../openpbr/impl}/openpbr_dispersion_utils.h | 0 .../openpbr/impl}/openpbr_fuzz_lobe.h | 0 .../impl}/openpbr_generic_flipped_lobe.h | 0 .../openpbr_generic_minimal_microfacet_lobe.h | 0 .../openpbr_ior_reflection_coefficient.h | 0 .../openpbr/impl}/openpbr_lobe_utils.h | 0 {impl => include/openpbr/impl}/openpbr_math.h | 0 ...npbr_microfacet_multiple_scattering_data.h | 0 ...pbr_microfacet_multiple_scattering_lobes.h | 0 ...npbr_reflection_transmission_coefficient.h | 0 ...lection_transmission_coefficient_structs.h | 0 .../openpbr/impl}/openpbr_sampling.h | 0 .../openpbr_thin_film_iridescence_utils.h | 0 ...npbr_thin_wall_diffuse_transmission_lobe.h | 0 ...pbr_thin_wall_specular_transmission_lobe.h | 0 .../openpbr_vndf_microfacet_distribution.h | 0 .../openpbr/impl}/openpbr_volume_utils.h | 0 .../openpbr/interop}/openpbr_interop.h | 0 .../openpbr/interop}/openpbr_interop_cpp.h | 0 .../openpbr/interop}/openpbr_interop_cuda.h | 0 .../openpbr/interop}/openpbr_interop_glsl.h | 0 .../openpbr/interop}/openpbr_interop_msl.h | 0 .../openpbr/interop}/openpbr_interop_slang.h | 0 openpbr.h => include/openpbr/openpbr.h | 0 .../openpbr/openpbr_api.h | 0 .../openpbr/openpbr_basis.h | 0 .../openpbr/openpbr_bsdf_lobe_type.h | 0 .../openpbr/openpbr_constants.h | 0 .../openpbr/openpbr_data_constants.h | 0 .../openpbr/openpbr_diffuse_specular.h | 0 .../openpbr/openpbr_homogeneous_volume.h | 0 .../openpbr/openpbr_resolved_inputs.h | 0 .../openpbr/openpbr_settings.h | 0 installation/CMakeLists.txt | 33 +++++++++ 56 files changed, 172 insertions(+), 1 deletion(-) create mode 100644 CMakeLists.txt create mode 100644 examples/CMakeLists.txt rename minimal_cpp_example.cpp => examples/minimal_cpp_example.cpp (99%) create mode 100644 include/CMakeLists.txt rename {impl => include/openpbr/impl}/data/openpbr_energy_array_access.h (100%) rename {impl => include/openpbr/impl}/data/openpbr_energy_arrays.h (100%) rename {impl => include/openpbr/impl}/data/openpbr_ideal_dielectric_avg_energy_complement_data.h (100%) rename {impl => include/openpbr/impl}/data/openpbr_ideal_dielectric_energy_complement_data.h (100%) rename {impl => include/openpbr/impl}/data/openpbr_ideal_dielectric_reflection_ratio_data.h (100%) rename {impl => include/openpbr/impl}/data/openpbr_ideal_metal_avg_energy_complement_data.h (100%) rename {impl => include/openpbr/impl}/data/openpbr_ideal_metal_energy_complement_data.h (100%) rename {impl => include/openpbr/impl}/data/openpbr_ltc_array.h (100%) rename {impl => include/openpbr/impl}/data/openpbr_ltc_data.h (100%) rename {impl => include/openpbr/impl}/data/openpbr_opaque_dielectric_avg_energy_complement_data.h (100%) rename {impl => include/openpbr/impl}/data/openpbr_opaque_dielectric_energy_complement_data.h (100%) rename {impl => include/openpbr/impl}/openpbr_aggregate_lobe.h (100%) rename {impl => include/openpbr/impl}/openpbr_bsdf.h (100%) rename {impl => include/openpbr/impl}/openpbr_coating_lobe.h (100%) rename {impl => include/openpbr/impl}/openpbr_complex.h (100%) rename {impl => include/openpbr/impl}/openpbr_comprehensive_microfacet_lobe.h (100%) rename {impl => include/openpbr/impl}/openpbr_constant_reflection_coefficient.h (100%) rename {impl => include/openpbr/impl}/openpbr_diffuse_lobe.h (100%) rename {impl => include/openpbr/impl}/openpbr_dispersion_utils.h (100%) rename {impl => include/openpbr/impl}/openpbr_fuzz_lobe.h (100%) rename {impl => include/openpbr/impl}/openpbr_generic_flipped_lobe.h (100%) rename {impl => include/openpbr/impl}/openpbr_generic_minimal_microfacet_lobe.h (100%) rename {impl => include/openpbr/impl}/openpbr_ior_reflection_coefficient.h (100%) rename {impl => include/openpbr/impl}/openpbr_lobe_utils.h (100%) rename {impl => include/openpbr/impl}/openpbr_math.h (100%) rename {impl => include/openpbr/impl}/openpbr_microfacet_multiple_scattering_data.h (100%) rename {impl => include/openpbr/impl}/openpbr_microfacet_multiple_scattering_lobes.h (100%) rename {impl => include/openpbr/impl}/openpbr_reflection_transmission_coefficient.h (100%) rename {impl => include/openpbr/impl}/openpbr_reflection_transmission_coefficient_structs.h (100%) rename {impl => include/openpbr/impl}/openpbr_sampling.h (100%) rename {impl => include/openpbr/impl}/openpbr_thin_film_iridescence_utils.h (100%) rename {impl => include/openpbr/impl}/openpbr_thin_wall_diffuse_transmission_lobe.h (100%) rename {impl => include/openpbr/impl}/openpbr_thin_wall_specular_transmission_lobe.h (100%) rename {impl => include/openpbr/impl}/openpbr_vndf_microfacet_distribution.h (100%) rename {impl => include/openpbr/impl}/openpbr_volume_utils.h (100%) rename {interop => include/openpbr/interop}/openpbr_interop.h (100%) rename {interop => include/openpbr/interop}/openpbr_interop_cpp.h (100%) rename {interop => include/openpbr/interop}/openpbr_interop_cuda.h (100%) rename {interop => include/openpbr/interop}/openpbr_interop_glsl.h (100%) rename {interop => include/openpbr/interop}/openpbr_interop_msl.h (100%) rename {interop => include/openpbr/interop}/openpbr_interop_slang.h (100%) rename openpbr.h => include/openpbr/openpbr.h (100%) rename openpbr_api.h => include/openpbr/openpbr_api.h (100%) rename openpbr_basis.h => include/openpbr/openpbr_basis.h (100%) rename openpbr_bsdf_lobe_type.h => include/openpbr/openpbr_bsdf_lobe_type.h (100%) rename openpbr_constants.h => include/openpbr/openpbr_constants.h (100%) rename openpbr_data_constants.h => include/openpbr/openpbr_data_constants.h (100%) rename openpbr_diffuse_specular.h => include/openpbr/openpbr_diffuse_specular.h (100%) rename openpbr_homogeneous_volume.h => include/openpbr/openpbr_homogeneous_volume.h (100%) rename openpbr_resolved_inputs.h => include/openpbr/openpbr_resolved_inputs.h (100%) rename openpbr_settings.h => include/openpbr/openpbr_settings.h (100%) create mode 100644 installation/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..eb32dd3 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,54 @@ +cmake_minimum_required(VERSION 3.26 FATAL_ERROR) + +# +# Initial setup. +# + +if(NOT DEFINED CMAKE_CXX_STANDARD) + set(CMAKE_CXX_STANDARD 17) +endif() +if(NOT DEFINED CMAKE_CXX_STANDARD_REQUIRED) + set(CMAKE_CXX_STANDARD_REQUIRED ON) +endif() +if(NOT DEFINED CMAKE_CXX_EXTENSIONS) + set(CMAKE_CXX_EXTENSIONS OFF) +endif() + +# +# Options. +# + +option(OPENPBRBSDF_ENABLE_INSTALL "Enable installation rules" ON) +option(OPENPBRBSDF_ENABLE_EXAMPLES "Enable examples" ON) + +# +# Project. +# + +project(openpbr-bsdf) + +# +# Toolchain-dependent CMake Libraries. +# + +include(CMakePackageConfigHelpers) +include(CTest) +include(GNUInstallDirs) + +# +# Subdirectories. +# + +add_subdirectory(include) + +if(OPENPBRBSDF_ENABLE_EXAMPLES) + add_subdirectory(examples) +endif() + +# +# Installation. +# + +if(OPENPBRBSDF_ENABLE_INSTALL) + add_subdirectory(installation) +endif() diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt new file mode 100644 index 0000000..99d6584 --- /dev/null +++ b/examples/CMakeLists.txt @@ -0,0 +1,14 @@ +find_package(glm REQUIRED) + +add_executable(openpbr-bsdf-minimal-cpp-example) +add_executable(openpbr-bsdf::minimal-cpp-example ALIAS openpbr-bsdf-minimal-cpp-example) +set_property(TARGET openpbr-bsdf-minimal-cpp-example PROPERTY EXPORT_NAME "minimal-cpp-example") +target_sources(openpbr-bsdf-minimal-cpp-example PRIVATE minimal_cpp_example.cpp) +target_link_libraries(openpbr-bsdf-minimal-cpp-example PRIVATE glm::glm openpbr-bsdf::headers) + +get_target_property(sources openpbr-bsdf-minimal-cpp-example SOURCES) +source_group(TREE "${CMAKE_CURRENT_LIST_DIR}" FILES ${sources}) + +if(OPENPBRBSDF_ENABLE_INSTALL) + install(TARGETS openpbr-bsdf-minimal-cpp-example EXPORT openpbr-bsdf-targets) +endif() diff --git a/minimal_cpp_example.cpp b/examples/minimal_cpp_example.cpp similarity index 99% rename from minimal_cpp_example.cpp rename to examples/minimal_cpp_example.cpp index 3c9b44c..b8e1a18 100644 --- a/minimal_cpp_example.cpp +++ b/examples/minimal_cpp_example.cpp @@ -31,7 +31,7 @@ #include // Include OpenPBR main header after including GLM and tweaking any relevant OpenPBR settings. -#include "openpbr.h" +#include "openpbr/openpbr.h" // Standard includes for this example. #include diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt new file mode 100644 index 0000000..121cfba --- /dev/null +++ b/include/CMakeLists.txt @@ -0,0 +1,70 @@ +add_library(openpbr-bsdf-headers INTERFACE) +add_library(openpbr-bsdf::headers ALIAS openpbr-bsdf-headers) +set_target_properties(openpbr-bsdf-headers PROPERTIES EXPORT_NAME "headers") +target_sources(openpbr-bsdf-headers + PUBLIC FILE_SET HEADERS + FILES + openpbr/impl/data/openpbr_energy_array_access.h + openpbr/impl/data/openpbr_energy_arrays.h + openpbr/impl/data/openpbr_ideal_dielectric_avg_energy_complement_data.h + openpbr/impl/data/openpbr_ideal_dielectric_energy_complement_data.h + openpbr/impl/data/openpbr_ideal_dielectric_reflection_ratio_data.h + openpbr/impl/data/openpbr_ideal_metal_avg_energy_complement_data.h + openpbr/impl/data/openpbr_ideal_metal_energy_complement_data.h + openpbr/impl/data/openpbr_ltc_array.h + openpbr/impl/data/openpbr_ltc_data.h + openpbr/impl/data/openpbr_opaque_dielectric_avg_energy_complement_data.h + openpbr/impl/data/openpbr_opaque_dielectric_energy_complement_data.h + openpbr/impl/openpbr_aggregate_lobe.h + openpbr/impl/openpbr_bsdf.h + openpbr/impl/openpbr_coating_lobe.h + openpbr/impl/openpbr_complex.h + openpbr/impl/openpbr_comprehensive_microfacet_lobe.h + openpbr/impl/openpbr_constant_reflection_coefficient.h + openpbr/impl/openpbr_diffuse_lobe.h + openpbr/impl/openpbr_dispersion_utils.h + openpbr/impl/openpbr_fuzz_lobe.h + openpbr/impl/openpbr_generic_flipped_lobe.h + openpbr/impl/openpbr_generic_minimal_microfacet_lobe.h + openpbr/impl/openpbr_ior_reflection_coefficient.h + openpbr/impl/openpbr_lobe_utils.h + openpbr/impl/openpbr_math.h + openpbr/impl/openpbr_microfacet_multiple_scattering_data.h + openpbr/impl/openpbr_microfacet_multiple_scattering_lobes.h + openpbr/impl/openpbr_reflection_transmission_coefficient.h + openpbr/impl/openpbr_reflection_transmission_coefficient_structs.h + openpbr/impl/openpbr_sampling.h + openpbr/impl/openpbr_thin_film_iridescence_utils.h + openpbr/impl/openpbr_thin_wall_diffuse_transmission_lobe.h + openpbr/impl/openpbr_thin_wall_specular_transmission_lobe.h + openpbr/impl/openpbr_vndf_microfacet_distribution.h + openpbr/impl/openpbr_volume_utils.h + openpbr/interop/openpbr_interop.h + openpbr/interop/openpbr_interop_cpp.h + openpbr/interop/openpbr_interop_cuda.h + openpbr/interop/openpbr_interop_glsl.h + openpbr/interop/openpbr_interop_msl.h + openpbr/interop/openpbr_interop_slang.h + openpbr/openpbr.h + openpbr/openpbr_api.h + openpbr/openpbr_basis.h + openpbr/openpbr_bsdf_lobe_type.h + openpbr/openpbr_constants.h + openpbr/openpbr_data_constants.h + openpbr/openpbr_diffuse_specular.h + openpbr/openpbr_homogeneous_volume.h + openpbr/openpbr_resolved_inputs.h + openpbr/openpbr_settings.h +) +target_include_directories(openpbr-bsdf-headers + INTERFACE + $ + $ +) + +get_target_property(sources openpbr-bsdf-headers SOURCES) +source_group(TREE "${CMAKE_CURRENT_LIST_DIR}" FILES ${sources}) + +if(OPENPBRBSDF_ENABLE_INSTALL) + install(TARGETS openpbr-bsdf-headers EXPORT openpbr-bsdf-targets FILE_SET HEADERS) +endif() diff --git a/impl/data/openpbr_energy_array_access.h b/include/openpbr/impl/data/openpbr_energy_array_access.h similarity index 100% rename from impl/data/openpbr_energy_array_access.h rename to include/openpbr/impl/data/openpbr_energy_array_access.h diff --git a/impl/data/openpbr_energy_arrays.h b/include/openpbr/impl/data/openpbr_energy_arrays.h similarity index 100% rename from impl/data/openpbr_energy_arrays.h rename to include/openpbr/impl/data/openpbr_energy_arrays.h diff --git a/impl/data/openpbr_ideal_dielectric_avg_energy_complement_data.h b/include/openpbr/impl/data/openpbr_ideal_dielectric_avg_energy_complement_data.h similarity index 100% rename from impl/data/openpbr_ideal_dielectric_avg_energy_complement_data.h rename to include/openpbr/impl/data/openpbr_ideal_dielectric_avg_energy_complement_data.h diff --git a/impl/data/openpbr_ideal_dielectric_energy_complement_data.h b/include/openpbr/impl/data/openpbr_ideal_dielectric_energy_complement_data.h similarity index 100% rename from impl/data/openpbr_ideal_dielectric_energy_complement_data.h rename to include/openpbr/impl/data/openpbr_ideal_dielectric_energy_complement_data.h diff --git a/impl/data/openpbr_ideal_dielectric_reflection_ratio_data.h b/include/openpbr/impl/data/openpbr_ideal_dielectric_reflection_ratio_data.h similarity index 100% rename from impl/data/openpbr_ideal_dielectric_reflection_ratio_data.h rename to include/openpbr/impl/data/openpbr_ideal_dielectric_reflection_ratio_data.h diff --git a/impl/data/openpbr_ideal_metal_avg_energy_complement_data.h b/include/openpbr/impl/data/openpbr_ideal_metal_avg_energy_complement_data.h similarity index 100% rename from impl/data/openpbr_ideal_metal_avg_energy_complement_data.h rename to include/openpbr/impl/data/openpbr_ideal_metal_avg_energy_complement_data.h diff --git a/impl/data/openpbr_ideal_metal_energy_complement_data.h b/include/openpbr/impl/data/openpbr_ideal_metal_energy_complement_data.h similarity index 100% rename from impl/data/openpbr_ideal_metal_energy_complement_data.h rename to include/openpbr/impl/data/openpbr_ideal_metal_energy_complement_data.h diff --git a/impl/data/openpbr_ltc_array.h b/include/openpbr/impl/data/openpbr_ltc_array.h similarity index 100% rename from impl/data/openpbr_ltc_array.h rename to include/openpbr/impl/data/openpbr_ltc_array.h diff --git a/impl/data/openpbr_ltc_data.h b/include/openpbr/impl/data/openpbr_ltc_data.h similarity index 100% rename from impl/data/openpbr_ltc_data.h rename to include/openpbr/impl/data/openpbr_ltc_data.h diff --git a/impl/data/openpbr_opaque_dielectric_avg_energy_complement_data.h b/include/openpbr/impl/data/openpbr_opaque_dielectric_avg_energy_complement_data.h similarity index 100% rename from impl/data/openpbr_opaque_dielectric_avg_energy_complement_data.h rename to include/openpbr/impl/data/openpbr_opaque_dielectric_avg_energy_complement_data.h diff --git a/impl/data/openpbr_opaque_dielectric_energy_complement_data.h b/include/openpbr/impl/data/openpbr_opaque_dielectric_energy_complement_data.h similarity index 100% rename from impl/data/openpbr_opaque_dielectric_energy_complement_data.h rename to include/openpbr/impl/data/openpbr_opaque_dielectric_energy_complement_data.h diff --git a/impl/openpbr_aggregate_lobe.h b/include/openpbr/impl/openpbr_aggregate_lobe.h similarity index 100% rename from impl/openpbr_aggregate_lobe.h rename to include/openpbr/impl/openpbr_aggregate_lobe.h diff --git a/impl/openpbr_bsdf.h b/include/openpbr/impl/openpbr_bsdf.h similarity index 100% rename from impl/openpbr_bsdf.h rename to include/openpbr/impl/openpbr_bsdf.h diff --git a/impl/openpbr_coating_lobe.h b/include/openpbr/impl/openpbr_coating_lobe.h similarity index 100% rename from impl/openpbr_coating_lobe.h rename to include/openpbr/impl/openpbr_coating_lobe.h diff --git a/impl/openpbr_complex.h b/include/openpbr/impl/openpbr_complex.h similarity index 100% rename from impl/openpbr_complex.h rename to include/openpbr/impl/openpbr_complex.h diff --git a/impl/openpbr_comprehensive_microfacet_lobe.h b/include/openpbr/impl/openpbr_comprehensive_microfacet_lobe.h similarity index 100% rename from impl/openpbr_comprehensive_microfacet_lobe.h rename to include/openpbr/impl/openpbr_comprehensive_microfacet_lobe.h diff --git a/impl/openpbr_constant_reflection_coefficient.h b/include/openpbr/impl/openpbr_constant_reflection_coefficient.h similarity index 100% rename from impl/openpbr_constant_reflection_coefficient.h rename to include/openpbr/impl/openpbr_constant_reflection_coefficient.h diff --git a/impl/openpbr_diffuse_lobe.h b/include/openpbr/impl/openpbr_diffuse_lobe.h similarity index 100% rename from impl/openpbr_diffuse_lobe.h rename to include/openpbr/impl/openpbr_diffuse_lobe.h diff --git a/impl/openpbr_dispersion_utils.h b/include/openpbr/impl/openpbr_dispersion_utils.h similarity index 100% rename from impl/openpbr_dispersion_utils.h rename to include/openpbr/impl/openpbr_dispersion_utils.h diff --git a/impl/openpbr_fuzz_lobe.h b/include/openpbr/impl/openpbr_fuzz_lobe.h similarity index 100% rename from impl/openpbr_fuzz_lobe.h rename to include/openpbr/impl/openpbr_fuzz_lobe.h diff --git a/impl/openpbr_generic_flipped_lobe.h b/include/openpbr/impl/openpbr_generic_flipped_lobe.h similarity index 100% rename from impl/openpbr_generic_flipped_lobe.h rename to include/openpbr/impl/openpbr_generic_flipped_lobe.h diff --git a/impl/openpbr_generic_minimal_microfacet_lobe.h b/include/openpbr/impl/openpbr_generic_minimal_microfacet_lobe.h similarity index 100% rename from impl/openpbr_generic_minimal_microfacet_lobe.h rename to include/openpbr/impl/openpbr_generic_minimal_microfacet_lobe.h diff --git a/impl/openpbr_ior_reflection_coefficient.h b/include/openpbr/impl/openpbr_ior_reflection_coefficient.h similarity index 100% rename from impl/openpbr_ior_reflection_coefficient.h rename to include/openpbr/impl/openpbr_ior_reflection_coefficient.h diff --git a/impl/openpbr_lobe_utils.h b/include/openpbr/impl/openpbr_lobe_utils.h similarity index 100% rename from impl/openpbr_lobe_utils.h rename to include/openpbr/impl/openpbr_lobe_utils.h diff --git a/impl/openpbr_math.h b/include/openpbr/impl/openpbr_math.h similarity index 100% rename from impl/openpbr_math.h rename to include/openpbr/impl/openpbr_math.h diff --git a/impl/openpbr_microfacet_multiple_scattering_data.h b/include/openpbr/impl/openpbr_microfacet_multiple_scattering_data.h similarity index 100% rename from impl/openpbr_microfacet_multiple_scattering_data.h rename to include/openpbr/impl/openpbr_microfacet_multiple_scattering_data.h diff --git a/impl/openpbr_microfacet_multiple_scattering_lobes.h b/include/openpbr/impl/openpbr_microfacet_multiple_scattering_lobes.h similarity index 100% rename from impl/openpbr_microfacet_multiple_scattering_lobes.h rename to include/openpbr/impl/openpbr_microfacet_multiple_scattering_lobes.h diff --git a/impl/openpbr_reflection_transmission_coefficient.h b/include/openpbr/impl/openpbr_reflection_transmission_coefficient.h similarity index 100% rename from impl/openpbr_reflection_transmission_coefficient.h rename to include/openpbr/impl/openpbr_reflection_transmission_coefficient.h diff --git a/impl/openpbr_reflection_transmission_coefficient_structs.h b/include/openpbr/impl/openpbr_reflection_transmission_coefficient_structs.h similarity index 100% rename from impl/openpbr_reflection_transmission_coefficient_structs.h rename to include/openpbr/impl/openpbr_reflection_transmission_coefficient_structs.h diff --git a/impl/openpbr_sampling.h b/include/openpbr/impl/openpbr_sampling.h similarity index 100% rename from impl/openpbr_sampling.h rename to include/openpbr/impl/openpbr_sampling.h diff --git a/impl/openpbr_thin_film_iridescence_utils.h b/include/openpbr/impl/openpbr_thin_film_iridescence_utils.h similarity index 100% rename from impl/openpbr_thin_film_iridescence_utils.h rename to include/openpbr/impl/openpbr_thin_film_iridescence_utils.h diff --git a/impl/openpbr_thin_wall_diffuse_transmission_lobe.h b/include/openpbr/impl/openpbr_thin_wall_diffuse_transmission_lobe.h similarity index 100% rename from impl/openpbr_thin_wall_diffuse_transmission_lobe.h rename to include/openpbr/impl/openpbr_thin_wall_diffuse_transmission_lobe.h diff --git a/impl/openpbr_thin_wall_specular_transmission_lobe.h b/include/openpbr/impl/openpbr_thin_wall_specular_transmission_lobe.h similarity index 100% rename from impl/openpbr_thin_wall_specular_transmission_lobe.h rename to include/openpbr/impl/openpbr_thin_wall_specular_transmission_lobe.h diff --git a/impl/openpbr_vndf_microfacet_distribution.h b/include/openpbr/impl/openpbr_vndf_microfacet_distribution.h similarity index 100% rename from impl/openpbr_vndf_microfacet_distribution.h rename to include/openpbr/impl/openpbr_vndf_microfacet_distribution.h diff --git a/impl/openpbr_volume_utils.h b/include/openpbr/impl/openpbr_volume_utils.h similarity index 100% rename from impl/openpbr_volume_utils.h rename to include/openpbr/impl/openpbr_volume_utils.h diff --git a/interop/openpbr_interop.h b/include/openpbr/interop/openpbr_interop.h similarity index 100% rename from interop/openpbr_interop.h rename to include/openpbr/interop/openpbr_interop.h diff --git a/interop/openpbr_interop_cpp.h b/include/openpbr/interop/openpbr_interop_cpp.h similarity index 100% rename from interop/openpbr_interop_cpp.h rename to include/openpbr/interop/openpbr_interop_cpp.h diff --git a/interop/openpbr_interop_cuda.h b/include/openpbr/interop/openpbr_interop_cuda.h similarity index 100% rename from interop/openpbr_interop_cuda.h rename to include/openpbr/interop/openpbr_interop_cuda.h diff --git a/interop/openpbr_interop_glsl.h b/include/openpbr/interop/openpbr_interop_glsl.h similarity index 100% rename from interop/openpbr_interop_glsl.h rename to include/openpbr/interop/openpbr_interop_glsl.h diff --git a/interop/openpbr_interop_msl.h b/include/openpbr/interop/openpbr_interop_msl.h similarity index 100% rename from interop/openpbr_interop_msl.h rename to include/openpbr/interop/openpbr_interop_msl.h diff --git a/interop/openpbr_interop_slang.h b/include/openpbr/interop/openpbr_interop_slang.h similarity index 100% rename from interop/openpbr_interop_slang.h rename to include/openpbr/interop/openpbr_interop_slang.h diff --git a/openpbr.h b/include/openpbr/openpbr.h similarity index 100% rename from openpbr.h rename to include/openpbr/openpbr.h diff --git a/openpbr_api.h b/include/openpbr/openpbr_api.h similarity index 100% rename from openpbr_api.h rename to include/openpbr/openpbr_api.h diff --git a/openpbr_basis.h b/include/openpbr/openpbr_basis.h similarity index 100% rename from openpbr_basis.h rename to include/openpbr/openpbr_basis.h diff --git a/openpbr_bsdf_lobe_type.h b/include/openpbr/openpbr_bsdf_lobe_type.h similarity index 100% rename from openpbr_bsdf_lobe_type.h rename to include/openpbr/openpbr_bsdf_lobe_type.h diff --git a/openpbr_constants.h b/include/openpbr/openpbr_constants.h similarity index 100% rename from openpbr_constants.h rename to include/openpbr/openpbr_constants.h diff --git a/openpbr_data_constants.h b/include/openpbr/openpbr_data_constants.h similarity index 100% rename from openpbr_data_constants.h rename to include/openpbr/openpbr_data_constants.h diff --git a/openpbr_diffuse_specular.h b/include/openpbr/openpbr_diffuse_specular.h similarity index 100% rename from openpbr_diffuse_specular.h rename to include/openpbr/openpbr_diffuse_specular.h diff --git a/openpbr_homogeneous_volume.h b/include/openpbr/openpbr_homogeneous_volume.h similarity index 100% rename from openpbr_homogeneous_volume.h rename to include/openpbr/openpbr_homogeneous_volume.h diff --git a/openpbr_resolved_inputs.h b/include/openpbr/openpbr_resolved_inputs.h similarity index 100% rename from openpbr_resolved_inputs.h rename to include/openpbr/openpbr_resolved_inputs.h diff --git a/openpbr_settings.h b/include/openpbr/openpbr_settings.h similarity index 100% rename from openpbr_settings.h rename to include/openpbr/openpbr_settings.h diff --git a/installation/CMakeLists.txt b/installation/CMakeLists.txt new file mode 100644 index 0000000..964f200 --- /dev/null +++ b/installation/CMakeLists.txt @@ -0,0 +1,33 @@ +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/openpbr-bsdf-config.cmake.in" [=[ +@PACKAGE_INIT@ + +set(OPENPBRBSDF_ENABLE_EXAMPLES @OPENPBRBSDF_ENABLE_EXAMPLES@) + +include(CMakeFindDependencyMacro) + +if(OPENPBRBSDF_ENABLE_EXAMPLES) + find_dependency(glm) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/openpbr-bsdf-targets.cmake") + +check_required_components("openpbr-bsdf") +]=]) + +configure_package_config_file( + "${CMAKE_CURRENT_BINARY_DIR}/openpbr-bsdf-config.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/openpbr-bsdf-config.cmake" + INSTALL_DESTINATION ${CMAKE_INSTALL_DATADIR}/openpbr-bsdf +) + +install( + EXPORT openpbr-bsdf-targets + NAMESPACE "openpbr-bsdf::" + DESTINATION "${CMAKE_INSTALL_DATADIR}/openpbr-bsdf" +) +install( + FILES + "${CMAKE_CURRENT_BINARY_DIR}/openpbr-bsdf-config.cmake" + DESTINATION + "${CMAKE_INSTALL_DATADIR}/openpbr-bsdf" +)