From c4245946252223495f0f3bd6439a08a34e0e0ccb Mon Sep 17 00:00:00 2001 From: barry Date: Tue, 9 Oct 2018 10:51:31 -0700 Subject: [PATCH] Major step towards consistent use of include paths in source files: - changed the main OPENSUBDIV_INCLUDE_DIR to exclude ./opensubdiv - updated CMakeLists.txt files in non-examples to use only this path - updated CMakeLists.txt files in examples to append ./opensubdiv to path - updated source in regression/common to use #include - updated source in examples/common to use #include - deferred source in examples to be updated on a case-by-case basis --- CMakeLists.txt | 2 +- examples/common/clDeviceContext.h | 2 +- examples/common/d3d11ControlMeshDisplay.h | 2 +- examples/common/d3d11PtexMipmapTexture.cpp | 2 +- examples/common/d3d11PtexMipmapTexture.h | 2 +- examples/common/d3d11ShaderCache.cpp | 2 +- examples/common/glControlMeshDisplay.h | 4 ++-- examples/common/glHud.h | 2 +- examples/common/glPtexMipmapTexture.cpp | 2 +- examples/common/glPtexMipmapTexture.h | 4 ++-- examples/common/glShaderCache.cpp | 4 ++-- examples/common/glShaderCache.h | 2 +- examples/common/glUtils.h | 2 +- examples/common/mtlControlMeshDisplay.h | 4 ++-- examples/common/mtlPtexMipmapTexture.h | 4 ++-- examples/common/patchColors.h | 2 +- examples/dxPtexViewer/CMakeLists.txt | 1 + examples/dxViewer/CMakeLists.txt | 1 + examples/farViewer/CMakeLists.txt | 1 + examples/glEvalLimit/CMakeLists.txt | 1 + examples/glFVarViewer/CMakeLists.txt | 1 + examples/glImaging/CMakeLists.txt | 1 + examples/glPaintTest/CMakeLists.txt | 1 + examples/glPtexViewer/CMakeLists.txt | 1 + examples/glShareTopology/CMakeLists.txt | 1 + examples/glStencilViewer/CMakeLists.txt | 1 + examples/glViewer/CMakeLists.txt | 1 + examples/mtlPtexViewer/CMakeLists.txt | 1 + examples/mtlViewer/CMakeLists.txt | 1 + regression/common/cmp_utils.h | 2 +- regression/common/far_utils.h | 9 +++++---- regression/common/hbr_utils.h | 16 ++++++++-------- regression/far_perf/CMakeLists.txt | 3 +-- regression/osd_regression/main.cpp | 8 ++++---- tutorials/CMakeLists.txt | 1 - 35 files changed, 53 insertions(+), 41 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 39208961..b37c32dc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -768,7 +768,7 @@ endmacro() # set (OPENSUBDIV_INCLUDE_DIR ${CMAKE_INSTALL_PREFIX}/${CMAKE_INCDIR_BASE}) if (NOT OPENSUBDIV_INCLUDE_DIR) - set(OPENSUBDIV_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/opensubdiv") + set(OPENSUBDIV_INCLUDE_DIR "${PROJECT_SOURCE_DIR}") endif() if (NOT NO_TESTS) diff --git a/examples/common/clDeviceContext.h b/examples/common/clDeviceContext.h index 00c23232..817d39f2 100644 --- a/examples/common/clDeviceContext.h +++ b/examples/common/clDeviceContext.h @@ -25,7 +25,7 @@ #ifndef OSD_EXAMPLES_COMMON_CL_DEVICE_CONTEXT_H #define OSD_EXAMPLES_COMMON_CL_DEVICE_CONTEXT_H -#include "osd/opencl.h" +#include class CLDeviceContext { public: diff --git a/examples/common/d3d11ControlMeshDisplay.h b/examples/common/d3d11ControlMeshDisplay.h index 22cb9b55..f4a9e096 100644 --- a/examples/common/d3d11ControlMeshDisplay.h +++ b/examples/common/d3d11ControlMeshDisplay.h @@ -26,7 +26,7 @@ #define OPENSUBDIV_EXAMPLES_D3D11_CONTROL_MESH_DISPLAY_H #include -#include +#include class D3D11ControlMeshDisplay { public: diff --git a/examples/common/d3d11PtexMipmapTexture.cpp b/examples/common/d3d11PtexMipmapTexture.cpp index cd74e454..bb3e6160 100644 --- a/examples/common/d3d11PtexMipmapTexture.cpp +++ b/examples/common/d3d11PtexMipmapTexture.cpp @@ -24,7 +24,7 @@ #include "d3d11PtexMipmapTexture.h" #include "ptexMipmapTextureLoader.h" -#include // XXX: to be replaced +#include // XXX: to be replaced #include #include diff --git a/examples/common/d3d11PtexMipmapTexture.h b/examples/common/d3d11PtexMipmapTexture.h index a3ff1227..87abdbf6 100644 --- a/examples/common/d3d11PtexMipmapTexture.h +++ b/examples/common/d3d11PtexMipmapTexture.h @@ -25,7 +25,7 @@ #ifndef OPENSUBDIV_EXAMPLES_D3D11_PTEX_MIPMAP_TEXTURE_H #define OPENSUBDIV_EXAMPLES_D3D11_PTEX_MIPMAP_TEXTURE_H -#include +#include #include diff --git a/examples/common/d3d11ShaderCache.cpp b/examples/common/d3d11ShaderCache.cpp index 78e8cf35..ec58947f 100644 --- a/examples/common/d3d11ShaderCache.cpp +++ b/examples/common/d3d11ShaderCache.cpp @@ -27,7 +27,7 @@ #include #include -#include +#include D3D11DrawConfig::D3D11DrawConfig() : _vertexShader(NULL), _hullShader(NULL), _domainShader(NULL), diff --git a/examples/common/glControlMeshDisplay.h b/examples/common/glControlMeshDisplay.h index fd381a9e..ad502736 100644 --- a/examples/common/glControlMeshDisplay.h +++ b/examples/common/glControlMeshDisplay.h @@ -25,8 +25,8 @@ #ifndef OPENSUBDIV_EXAMPLES_GL_CONTROL_MESH_DISPLAY_H #define OPENSUBDIV_EXAMPLES_GL_CONTROL_MESH_DISPLAY_H -#include -#include +#include +#include class GLControlMeshDisplay { public: diff --git a/examples/common/glHud.h b/examples/common/glHud.h index 5a608510..73f5fb06 100644 --- a/examples/common/glHud.h +++ b/examples/common/glHud.h @@ -27,7 +27,7 @@ #include "hud.h" -#include +#include class GLhud : public Hud { diff --git a/examples/common/glPtexMipmapTexture.cpp b/examples/common/glPtexMipmapTexture.cpp index f536deb4..5a3afdd1 100644 --- a/examples/common/glPtexMipmapTexture.cpp +++ b/examples/common/glPtexMipmapTexture.cpp @@ -25,7 +25,7 @@ #include "glPtexMipmapTexture.h" #include "ptexMipmapTextureLoader.h" -#include +#include GLPtexMipmapTexture::GLPtexMipmapTexture() : _width(0), _height(0), _depth(0), _layout(0), _texels(0), _memoryUsage(0) diff --git a/examples/common/glPtexMipmapTexture.h b/examples/common/glPtexMipmapTexture.h index da11b1f0..44932354 100644 --- a/examples/common/glPtexMipmapTexture.h +++ b/examples/common/glPtexMipmapTexture.h @@ -25,8 +25,8 @@ #ifndef OPENSUBDIV_EXAMPLES_GL_PTEX_MIPMAP_TEXTURE_H #define OPENSUBDIV_EXAMPLES_GL_PTEX_MIPMAP_TEXTURE_H -#include -#include +#include +#include #include #include diff --git a/examples/common/glShaderCache.cpp b/examples/common/glShaderCache.cpp index b462f8b4..05a62573 100644 --- a/examples/common/glShaderCache.cpp +++ b/examples/common/glShaderCache.cpp @@ -26,8 +26,8 @@ #include "glUtils.h" #include -#include -#include +#include +#include GLDrawConfig::GLDrawConfig(const std::string &version) : _version(version), _numShaders(0) { diff --git a/examples/common/glShaderCache.h b/examples/common/glShaderCache.h index c5c1c977..d8965d89 100644 --- a/examples/common/glShaderCache.h +++ b/examples/common/glShaderCache.h @@ -25,7 +25,7 @@ #ifndef OPENSUBDIV_EXAMPLES_GL_SHADER_CACHE_H #define OPENSUBDIV_EXAMPLES_GL_SHADER_CACHE_H -#include +#include #include #include #include "./shaderCache.h" diff --git a/examples/common/glUtils.h b/examples/common/glUtils.h index 3b238b60..3de6936a 100644 --- a/examples/common/glUtils.h +++ b/examples/common/glUtils.h @@ -41,7 +41,7 @@ #endif #endif -#include +#include #include #include diff --git a/examples/common/mtlControlMeshDisplay.h b/examples/common/mtlControlMeshDisplay.h index 210cbccd..afa59b15 100644 --- a/examples/common/mtlControlMeshDisplay.h +++ b/examples/common/mtlControlMeshDisplay.h @@ -26,7 +26,7 @@ #define OPENSUBDIV_EXAMPLES_MTL_CONTROL_MESH_DISPLAY_H #include -#include +#include class MTLControlMeshDisplay { public: @@ -59,4 +59,4 @@ private: id _edgeIndicesBuffer; }; -#endif // OPENSUBDIV_EXAMPLES_MTL_CONTROL_MESH_DISPLAY_H \ No newline at end of file +#endif // OPENSUBDIV_EXAMPLES_MTL_CONTROL_MESH_DISPLAY_H diff --git a/examples/common/mtlPtexMipmapTexture.h b/examples/common/mtlPtexMipmapTexture.h index e99d18b7..58bef520 100644 --- a/examples/common/mtlPtexMipmapTexture.h +++ b/examples/common/mtlPtexMipmapTexture.h @@ -25,8 +25,8 @@ #ifndef OPENSUBDIV_EXAMPLES_MTL_PTEX_MIPMAP_TEXTURE_H #define OPENSUBDIV_EXAMPLES_MTL_PTEX_MIPMAP_TEXTURE_H -#include -#include +#include +#include #include diff --git a/examples/common/patchColors.h b/examples/common/patchColors.h index 8d9a48e2..ea6ba49c 100644 --- a/examples/common/patchColors.h +++ b/examples/common/patchColors.h @@ -25,7 +25,7 @@ #ifndef OPENSUBDIV_EXAMPLES_COMMON_PATCH_COLORS_H #define OPENSUBDIV_EXAMPLES_COMMON_PATCH_COLORS_H -#include +#include // returns a unique color for each type of feature-adaptive patches float const * getAdaptivePatchColor(OpenSubdiv::Far::PatchDescriptor const & desc); diff --git a/examples/dxPtexViewer/CMakeLists.txt b/examples/dxPtexViewer/CMakeLists.txt index 9d571fc4..53a06ef2 100644 --- a/examples/dxPtexViewer/CMakeLists.txt +++ b/examples/dxPtexViewer/CMakeLists.txt @@ -38,6 +38,7 @@ set(PLATFORM_LIBRARIES include_directories( "${OPENSUBDIV_INCLUDE_DIR}" + "${OPENSUBDIV_INCLUDE_DIR}/opensubdiv" "${DXSDK_INCLUDE_DIR}" "${PTEX_INCLUDE_DIR}" ) diff --git a/examples/dxViewer/CMakeLists.txt b/examples/dxViewer/CMakeLists.txt index f71359c9..80cf86fe 100644 --- a/examples/dxViewer/CMakeLists.txt +++ b/examples/dxViewer/CMakeLists.txt @@ -35,6 +35,7 @@ set(PLATFORM_LIBRARIES include_directories( "${OPENSUBDIV_INCLUDE_DIR}" + "${OPENSUBDIV_INCLUDE_DIR}/opensubdiv" "${DXSDK_INCLUDE_DIR}" ) diff --git a/examples/farViewer/CMakeLists.txt b/examples/farViewer/CMakeLists.txt index 5e60a731..3550ade2 100644 --- a/examples/farViewer/CMakeLists.txt +++ b/examples/farViewer/CMakeLists.txt @@ -32,6 +32,7 @@ set(SHADER_FILES include_directories( "${OPENSUBDIV_INCLUDE_DIR}" + "${OPENSUBDIV_INCLUDE_DIR}/opensubdiv" "${GLFW_INCLUDE_DIR}" ) diff --git a/examples/glEvalLimit/CMakeLists.txt b/examples/glEvalLimit/CMakeLists.txt index 223f3736..de664c3e 100644 --- a/examples/glEvalLimit/CMakeLists.txt +++ b/examples/glEvalLimit/CMakeLists.txt @@ -31,6 +31,7 @@ list(APPEND PLATFORM_LIBRARIES include_directories( "${OPENSUBDIV_INCLUDE_DIR}" + "${OPENSUBDIV_INCLUDE_DIR}/opensubdiv" "${GLFW_INCLUDE_DIR}" ) diff --git a/examples/glFVarViewer/CMakeLists.txt b/examples/glFVarViewer/CMakeLists.txt index 1db7a107..405e33c3 100644 --- a/examples/glFVarViewer/CMakeLists.txt +++ b/examples/glFVarViewer/CMakeLists.txt @@ -36,6 +36,7 @@ list(APPEND PLATFORM_LIBRARIES include_directories( "${OPENSUBDIV_INCLUDE_DIR}" + "${OPENSUBDIV_INCLUDE_DIR}/opensubdiv" "${GLFW_INCLUDE_DIR}" ) diff --git a/examples/glImaging/CMakeLists.txt b/examples/glImaging/CMakeLists.txt index d896a60d..bf8786e8 100644 --- a/examples/glImaging/CMakeLists.txt +++ b/examples/glImaging/CMakeLists.txt @@ -24,6 +24,7 @@ include_directories( "${OPENSUBDIV_INCLUDE_DIR}" + "${OPENSUBDIV_INCLUDE_DIR}/opensubdiv" "${GLFW_INCLUDE_DIR}" ) diff --git a/examples/glPaintTest/CMakeLists.txt b/examples/glPaintTest/CMakeLists.txt index b45206bb..a7076247 100644 --- a/examples/glPaintTest/CMakeLists.txt +++ b/examples/glPaintTest/CMakeLists.txt @@ -38,6 +38,7 @@ list(APPEND PLATFORM_LIBRARIES include_directories( "${OPENSUBDIV_INCLUDE_DIR}" + "${OPENSUBDIV_INCLUDE_DIR}/opensubdiv" "${GLEW_INCLUDE_DIR}" "${GLFW_INCLUDE_DIR}" ) diff --git a/examples/glPtexViewer/CMakeLists.txt b/examples/glPtexViewer/CMakeLists.txt index 3478a7f8..e533e57e 100644 --- a/examples/glPtexViewer/CMakeLists.txt +++ b/examples/glPtexViewer/CMakeLists.txt @@ -40,6 +40,7 @@ list(APPEND PLATFORM_LIBRARIES include_directories( "${OPENSUBDIV_INCLUDE_DIR}" + "${OPENSUBDIV_INCLUDE_DIR}/opensubdiv" "${GLFW_INCLUDE_DIR}" "${PTEX_INCLUDE_DIR}" ) diff --git a/examples/glShareTopology/CMakeLists.txt b/examples/glShareTopology/CMakeLists.txt index a24cea6a..52f250b7 100644 --- a/examples/glShareTopology/CMakeLists.txt +++ b/examples/glShareTopology/CMakeLists.txt @@ -36,6 +36,7 @@ list(APPEND PLATFORM_LIBRARIES include_directories( "${OPENSUBDIV_INCLUDE_DIR}" + "${OPENSUBDIV_INCLUDE_DIR}/opensubdiv" "${GLFW_INCLUDE_DIR}" ) diff --git a/examples/glStencilViewer/CMakeLists.txt b/examples/glStencilViewer/CMakeLists.txt index a22ff3e4..b3244e38 100644 --- a/examples/glStencilViewer/CMakeLists.txt +++ b/examples/glStencilViewer/CMakeLists.txt @@ -31,6 +31,7 @@ list(APPEND PLATFORM_LIBRARIES include_directories( "${OPENSUBDIV_INCLUDE_DIR}" + "${OPENSUBDIV_INCLUDE_DIR}/opensubdiv" "${GLFW_INCLUDE_DIR}" ) diff --git a/examples/glViewer/CMakeLists.txt b/examples/glViewer/CMakeLists.txt index 3a1feb86..359fbba4 100644 --- a/examples/glViewer/CMakeLists.txt +++ b/examples/glViewer/CMakeLists.txt @@ -31,6 +31,7 @@ set(SHADER_FILES include_directories( "${OPENSUBDIV_INCLUDE_DIR}" + "${OPENSUBDIV_INCLUDE_DIR}/opensubdiv" "${GLFW_INCLUDE_DIR}" ) diff --git a/examples/mtlPtexViewer/CMakeLists.txt b/examples/mtlPtexViewer/CMakeLists.txt index 1001314d..f5361c88 100644 --- a/examples/mtlPtexViewer/CMakeLists.txt +++ b/examples/mtlPtexViewer/CMakeLists.txt @@ -63,6 +63,7 @@ endif() include_directories( "${OPENSUBDIV_INCLUDE_DIR}" + "${OPENSUBDIV_INCLUDE_DIR}/opensubdiv" "${METAL_INCLUDE_DIR}" "${PTEX_INCLUDE_DIR}" ) diff --git a/examples/mtlViewer/CMakeLists.txt b/examples/mtlViewer/CMakeLists.txt index e79a5e2d..5d41d02f 100644 --- a/examples/mtlViewer/CMakeLists.txt +++ b/examples/mtlViewer/CMakeLists.txt @@ -62,6 +62,7 @@ endif() include_directories( "${OPENSUBDIV_INCLUDE_DIR}" + "${OPENSUBDIV_INCLUDE_DIR}/opensubdiv" "${METAL_INCLUDE_DIR}" ) diff --git a/regression/common/cmp_utils.h b/regression/common/cmp_utils.h index 716e0579..1c3ee6a7 100644 --- a/regression/common/cmp_utils.h +++ b/regression/common/cmp_utils.h @@ -25,7 +25,7 @@ #ifndef CMP_UTILS_H #define CMP_UTILS_H -#include +#include #include "hbr_utils.h" diff --git a/regression/common/far_utils.h b/regression/common/far_utils.h index df5fa37e..3a05a836 100644 --- a/regression/common/far_utils.h +++ b/regression/common/far_utils.h @@ -25,13 +25,14 @@ #ifndef FAR_UTILS_H #define FAR_UTILS_H -#include -#include -#include +#include "shape_utils.h" + +#include +#include +#include #include -#include "shape_utils.h" //------------------------------------------------------------------------------ diff --git a/regression/common/hbr_utils.h b/regression/common/hbr_utils.h index 04b60ce9..9c2bf44b 100644 --- a/regression/common/hbr_utils.h +++ b/regression/common/hbr_utils.h @@ -29,16 +29,16 @@ #define HBR_ADAPTIVE #endif -#include -#include -#include -#include -#include -#include -#include - #include "shape_utils.h" +#include +#include +#include +#include +#include +#include +#include + #include //------------------------------------------------------------------------------ diff --git a/regression/far_perf/CMakeLists.txt b/regression/far_perf/CMakeLists.txt index 759412b3..0658f677 100644 --- a/regression/far_perf/CMakeLists.txt +++ b/regression/far_perf/CMakeLists.txt @@ -23,8 +23,7 @@ # include_directories( - "${OPENSUBDIV_INCLUDE_DIR}/" - "${PROJECT_SOURCE_DIR}/" + "${OPENSUBDIV_INCLUDE_DIR}" ) set(SOURCE_FILES diff --git a/regression/osd_regression/main.cpp b/regression/osd_regression/main.cpp index 396571ac..4efcdd59 100644 --- a/regression/osd_regression/main.cpp +++ b/regression/osd_regression/main.cpp @@ -46,10 +46,10 @@ GLFWwindow* g_window=0; #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include "../common/cmp_utils.h" #include "../common/hbr_utils.h" diff --git a/tutorials/CMakeLists.txt b/tutorials/CMakeLists.txt index 3b5b784e..ef2a1cbc 100644 --- a/tutorials/CMakeLists.txt +++ b/tutorials/CMakeLists.txt @@ -24,7 +24,6 @@ include_directories( - "${PROJECT_SOURCE_DIR}/" "${OPENSUBDIV_INCLUDE_DIR}/" )