mirror of
https://github.com/PixarAnimationStudios/OpenSubdiv
synced 2025-01-03 05:31:12 +00:00
FindPTex.cmake: enable discovery of newer versions of ptex
This commit is contained in:
parent
6d74e8c0e8
commit
e16edaa99e
@ -101,15 +101,20 @@ 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})
|
||||
|
Loading…
Reference in New Issue
Block a user