Skip to content

Commit

Permalink
FindPTex: add support for PTEX_PREFER_STATIC to osx
Browse files Browse the repository at this point in the history
  • Loading branch information
pmolodo authored and sirpalee committed Mar 1, 2017
1 parent 6291954 commit f0ba532
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions cmake/modules/FindPTex.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0

option(PTEX_PREFER_STATIC "Prefer static library when linking pTex" OFF)
option(PTEX_PREFER_STATIC "Prefer static library when linking pTex on linux or osx" OFF)

if (WIN32)
find_path( PTEX_INCLUDE_DIR
Expand Down Expand Up @@ -52,9 +52,14 @@ elseif (APPLE)
"$ENV{PTEX_LOCATION}/include"
PATHS
DOC "The directory where Ptexture.h resides")
if (${PTEX_PREFER_STATIC})
set(PTEX_LIBRARY_NAMES libPtex.a Ptex)
else ()
set(PTEX_LIBRARY_NAMES Ptex libPtex.a)
endif ()
find_library( PTEX_LIBRARY
NAMES
Ptex libPtex.a
${PTEX_LIBRARY_NAMES}
PATHS
"${PTEX_LOCATION}/lib"
"$ENV{PTEX_LOCATION}/lib"
Expand Down

0 comments on commit f0ba532

Please sign in to comment.