Fixed compatibility issues with external packages

Merged changes from the dev branch which improve
compatibility with newer versions of GLFW and PTEX
This commit is contained in:
David G Yu 2017-04-28 14:29:46 -07:00
parent 22d8fa22b7
commit 6747fc3ecb
8 changed files with 54 additions and 26 deletions

View File

@ -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

View File

@ -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})

View File

@ -30,9 +30,9 @@
#include "../osd/nonCopyable.h"
#include "../osd/opengl.h"
#include <stdlib.h>
#include <Ptexture.h>
class PtexTexture;
#include <stdlib.h>
namespace OpenSubdiv {
namespace OPENSUBDIV_VERSION {

View File

@ -31,7 +31,7 @@
#include "../osd/opengl.h"
class PtexTexture;
#include <Ptexture.h>
namespace OpenSubdiv {
namespace OPENSUBDIV_VERSION {

View File

@ -25,7 +25,6 @@
#include "../osd/ptexMipmapTextureLoader.h"
#include "../osd/error.h"
#include <Ptexture.h>
#include <vector>
#include <list>
#include <algorithm>

View File

@ -27,12 +27,12 @@
#include "../version.h"
#include <Ptexture.h>
#include <stdlib.h>
#include <stdint.h>
#include <vector>
class PtexTexture;
namespace OpenSubdiv {
namespace OPENSUBDIV_VERSION {

View File

@ -25,7 +25,6 @@
#include "../osd/error.h"
#include "../osd/ptexTextureLoader.h"
#include <Ptexture.h>
#include <algorithm>
#include <iostream>
#include <string.h>

View File

@ -27,9 +27,9 @@
#include "../version.h"
#include <vector>
#include <Ptexture.h>
class PtexTexture;
#include <vector>
namespace OpenSubdiv {
namespace OPENSUBDIV_VERSION {