diff --git a/cmake/FindGLFW.cmake b/cmake/FindGLFW.cmake index 8caa9f7e..960c4527 100644 --- a/cmake/FindGLFW.cmake +++ b/cmake/FindGLFW.cmake @@ -124,7 +124,15 @@ else () message(FATAL_ERROR "Xcursor library not found - required for GLFW") endif() - list(APPEND GLFW_x11_LIBRARY "${X11_Xrandr_LIB}" "${X11_Xxf86vm_LIB}" "${X11_Xcursor_LIB}" -lrt) + if(NOT X11_Xinerama_FOUND) + message(FATAL_ERROR "Xinerama library not found - required for GLFW") + endif() + + if(NOT X11_Xi_FOUND) + message(FATAL_ERROR "Xi library not found - required for GLFW") + endif() + + list(APPEND GLFW_x11_LIBRARY "${X11_Xrandr_LIB}" "${X11_Xxf86vm_LIB}" "${X11_Xcursor_LIB}" "${X11_Xinerama_LIB}" "${X11_Xi_LIB}" "${X11_LIBRARIES}" -lpthread -lrt -ldl) find_library( GLFW_glfw_LIBRARY NAMES diff --git a/cmake/FindPTex.cmake b/cmake/FindPTex.cmake index be98eb7f..e743693d 100644 --- a/cmake/FindPTex.cmake +++ b/cmake/FindPTex.cmake @@ -34,18 +34,20 @@ if (WIN32) find_path( PTEX_INCLUDE_DIR NAMES Ptexture.h - PATHS + HINTS "${PTEX_LOCATION}/include" "$ENV{PTEX_LOCATION}/include" + PATHS "$ENV{PROGRAMFILES}/Ptex/include" /usr/include DOC "The directory where Ptexture.h resides") find_library( PTEX_LIBRARY NAMES Ptex32 Ptex32s Ptex - PATHS + HINTS "${PTEX_LOCATION}/lib" "$ENV{PTEX_LOCATION}/lib" + PATHS "$ENV{PROGRAMFILES}/Ptex/lib" /usr/lib /usr/lib/w32api @@ -56,26 +58,39 @@ elseif (APPLE) find_path( PTEX_INCLUDE_DIR NAMES Ptexture.h - PATHS + HINTS "${PTEX_LOCATION}/include" "$ENV{PTEX_LOCATION}/include" - DOC "The directory where Ptexture.h resides") - find_library( PTEX_LIBRARY - NAMES - Ptex libPtex.a PATHS - "${PTEX_LOCATION}/lib" - "$ENV{PTEX_LOCATION}/lib" - DOC "The Ptex Library") + DOC "The directory where Ptexture.h resides") + if (IOS) + #IOS needs to link with the static version of ptex + find_library( PTEX_LIBRARY + NAMES + libPtex.a + PATHS + "${PTEX_LOCATION}/lib" + "$ENV{PTEX_LOCATION}/lib" + DOC "The Ptex Library") + else () + find_library( PTEX_LIBRARY + NAMES + Ptex libPtex.a + PATHS + "${PTEX_LOCATION}/lib" + "$ENV{PTEX_LOCATION}/lib" + DOC "The Ptex Library") + endif() else () find_path( PTEX_INCLUDE_DIR NAMES Ptexture.h - PATHS + HINTS "${PTEX_LOCATION}/include" "${PTEX_LOCATION}/include/wdas" "$ENV{PTEX_LOCATION}/include" "$ENV{PTEX_LOCATION}/include/wdas" + PATHS /usr/include /usr/local/include /usr/openwin/share/include @@ -86,9 +101,10 @@ else () find_library( PTEX_LIBRARY NAMES Ptex wdasPtex - PATHS + HINTS "${PTEX_LOCATION}/lib" "$ENV{PTEX_LOCATION}/lib" + PATHS /usr/lib /usr/local/lib /usr/openwin/lib @@ -96,15 +112,21 @@ else () DOC "The Ptex library") endif () -if (PTEX_INCLUDE_DIR AND EXISTS "${PTEX_INCLUDE_DIR}/Ptexture.h" ) +if (PTEX_INCLUDE_DIR AND EXISTS "${PTEX_INCLUDE_DIR}/PtexVersion.h") + set (PTEX_VERSION_FILE "${PTEX_INCLUDE_DIR}/PtexVersion.h") +elseif (PTEX_INCLUDE_DIR AND EXISTS "${PTEX_INCLUDE_DIR}/Ptexture.h") + set (PTEX_VERSION_FILE "${PTEX_INCLUDE_DIR}/Ptexture.h") +endif() - file(STRINGS "${PTEX_INCLUDE_DIR}/Ptexture.h" TMP REGEX "^#define PtexAPIVersion.*$") +if (PTEX_VERSION_FILE) + + file(STRINGS "${PTEX_VERSION_FILE}" TMP REGEX "^#define PtexAPIVersion.*$") string(REGEX MATCHALL "[0-9]+" API ${TMP}) - file(STRINGS "${PTEX_INCLUDE_DIR}/Ptexture.h" TMP REGEX "^#define PtexFileMajorVersion.*$") + file(STRINGS "${PTEX_VERSION_FILE}" TMP REGEX "^#define PtexFileMajorVersion.*$") string(REGEX MATCHALL "[0-9]+" MAJOR ${TMP}) - file(STRINGS "${PTEX_INCLUDE_DIR}/Ptexture.h" TMP REGEX "^#define PtexFileMinorVersion.*$") + file(STRINGS "${PTEX_VERSION_FILE}" TMP REGEX "^#define PtexFileMinorVersion.*$") string(REGEX MATCHALL "[0-9]+" MINOR ${TMP}) set(PTEX_VERSION ${API}.${MAJOR}.${MINOR}) diff --git a/opensubdiv/osd/glPtexMipmapTexture.h b/opensubdiv/osd/glPtexMipmapTexture.h index 6bbb6ce4..5be59595 100644 --- a/opensubdiv/osd/glPtexMipmapTexture.h +++ b/opensubdiv/osd/glPtexMipmapTexture.h @@ -30,9 +30,9 @@ #include "../osd/nonCopyable.h" #include "../osd/opengl.h" -#include +#include -class PtexTexture; +#include namespace OpenSubdiv { namespace OPENSUBDIV_VERSION { diff --git a/opensubdiv/osd/glPtexTexture.h b/opensubdiv/osd/glPtexTexture.h index 8fd50314..e5fb4371 100644 --- a/opensubdiv/osd/glPtexTexture.h +++ b/opensubdiv/osd/glPtexTexture.h @@ -31,7 +31,7 @@ #include "../osd/opengl.h" -class PtexTexture; +#include namespace OpenSubdiv { namespace OPENSUBDIV_VERSION { diff --git a/opensubdiv/osd/ptexMipmapTextureLoader.cpp b/opensubdiv/osd/ptexMipmapTextureLoader.cpp index 7987dbf7..c5efe601 100644 --- a/opensubdiv/osd/ptexMipmapTextureLoader.cpp +++ b/opensubdiv/osd/ptexMipmapTextureLoader.cpp @@ -25,7 +25,6 @@ #include "../osd/ptexMipmapTextureLoader.h" #include "../osd/error.h" -#include #include #include #include diff --git a/opensubdiv/osd/ptexMipmapTextureLoader.h b/opensubdiv/osd/ptexMipmapTextureLoader.h index 6d00bc32..f2c56d0c 100644 --- a/opensubdiv/osd/ptexMipmapTextureLoader.h +++ b/opensubdiv/osd/ptexMipmapTextureLoader.h @@ -27,12 +27,12 @@ #include "../version.h" +#include + #include #include #include -class PtexTexture; - namespace OpenSubdiv { namespace OPENSUBDIV_VERSION { diff --git a/opensubdiv/osd/ptexTextureLoader.cpp b/opensubdiv/osd/ptexTextureLoader.cpp index 11e0b45d..aa37eda6 100644 --- a/opensubdiv/osd/ptexTextureLoader.cpp +++ b/opensubdiv/osd/ptexTextureLoader.cpp @@ -25,7 +25,6 @@ #include "../osd/error.h" #include "../osd/ptexTextureLoader.h" -#include #include #include #include diff --git a/opensubdiv/osd/ptexTextureLoader.h b/opensubdiv/osd/ptexTextureLoader.h index a9d12926..51010761 100644 --- a/opensubdiv/osd/ptexTextureLoader.h +++ b/opensubdiv/osd/ptexTextureLoader.h @@ -27,9 +27,9 @@ #include "../version.h" -#include +#include -class PtexTexture; +#include namespace OpenSubdiv { namespace OPENSUBDIV_VERSION {