From f0ba532c9cd13eb756761386a360b4360bcd9c31 Mon Sep 17 00:00:00 2001 From: Paul Molodowitch Date: Tue, 20 Dec 2016 17:53:43 -0800 Subject: [PATCH] FindPTex: add support for PTEX_PREFER_STATIC to osx --- cmake/modules/FindPTex.cmake | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cmake/modules/FindPTex.cmake b/cmake/modules/FindPTex.cmake index 720ba4dc09..410a09d6c9 100644 --- a/cmake/modules/FindPTex.cmake +++ b/cmake/modules/FindPTex.cmake @@ -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 @@ -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"