From 4643a51fb069a88ac0463247da9746e83f10c80f Mon Sep 17 00:00:00 2001 From: manuelk Date: Thu, 18 Dec 2014 11:13:28 -0800 Subject: [PATCH] Fix Png dependency in examples build (fixes screenshot ability in glViewer) --- examples/CMakeLists.txt | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index fc314755..9eeb25b5 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -22,21 +22,19 @@ # language governing permissions and limitations under the Apache License. # +# optional dependency - enables screenshots in some examples +find_package(PNG) +if (PNG_FOUND) + include_directories("${PNG_INCLUDE_DIRS}") + list(APPEND PLATFORM_LIBRARIES "${PNG_LIBRARIES}") + add_definitions(-DOPENSUBDIV_HAS_PNG) +endif() add_subdirectory(common) if (NOT NO_OPENGL) if (OPENGL_FOUND AND (GLEW_FOUND AND GLFW_FOUND) OR (APPLE AND GLFW_FOUND)) - # optional dependency - enables screenshots in some examples - find_package(PNG) - if (PNG_FOUND) - include_directories("${PNG_INCLUDE_DIRS}") - list(APPEND PLATFORM_LIBRARIES "${PNG_LIBRARIES}") - add_definitions(-DOPENSUBDIV_HAS_PNG) - endif() - - add_subdirectory(glViewer) add_subdirectory(glEvalLimit) add_subdirectory(glShareTopology)