From 0cfca89da2e984530e293a9632c069aaba4ef96a Mon Sep 17 00:00:00 2001 From: Pavel Krajcevski Date: Tue, 24 Sep 2013 17:44:11 -0400 Subject: [PATCH] Add default for PVRTexLib on linux --- CMakeModules/FindPVRTexLib.cmake | 41 ++++++++++++++++++++++++-------- 1 file changed, 31 insertions(+), 10 deletions(-) diff --git a/CMakeModules/FindPVRTexLib.cmake b/CMakeModules/FindPVRTexLib.cmake index b837860..f2da742 100644 --- a/CMakeModules/FindPVRTexLib.cmake +++ b/CMakeModules/FindPVRTexLib.cmake @@ -56,30 +56,51 @@ # PVRTEXLIB_LIBRARIES - The libraries needed to use PVRTexLib IF (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + SET( PVRTEXLIB_ROOT "/Applications/Imagination/PowerVR/GraphicsSDK/PVRTexTool/Library" ) find_path( PVRTEXLIB_INCLUDE_DIR PVRTexture.h - PATHS "/Applications/Imagination/PowerVR/GraphicsSDK/PVRTexTool/Library/Include" + PATHS ${PVRTEXLIB_ROOT}/Include ) find_library(PVRTEXLIB_LIB PVRTexLib - PATHS "/Applications/Imagination/PowerVR/GraphicsSDK/PVRTexTool/Library/OSX_x86/Static" - "/Applications/Imagination/PowerVR/GraphicsSDK/PVRTexTool/Library/OSX_x86/Dynamic" + PATHS ${PVRTEXLIB_ROOT}/OSX_x86/Static + ${PVRTEXLIB_ROOT}/OSX_x86/Dynamic ) -ELSEIF(MSVC) +ELSEIF (${CMAKE_SYSTEM_NAME} MATCHES "Linux") + SET( PVRTEXLIB_ROOT "/opt/Imagination/PowerVR/GraphicsSDK/PVRTexTool/Library" ) find_path( PVRTEXLIB_INCLUDE_DIR PVRTexture.h - PATHS "C:/Imagination/PowerVR/GraphicsSDK/PVRTexTool/Library/Include" + PATHS ${PVRTEXLIB_ROOT}/Include + ) + + IF(${CMAKE_SIZEOF_VOID_P} EQUAL 8) + find_library(PVRTEXLIB_LIB PVRTexLib + PATHS ${PVRTEXLIB_ROOT}/Linux_x86_64/Static + ${PVRTEXLIB_ROOT}/Linux_x86_64/Dynamic + ) + ELSE() + find_library(PVRTEXLIB_LIB PVRTexLib + PATHS ${PVRTEXLIB_ROOT}/Linux_x86_32/Static + ${PVRTEXLIB_ROOT}/Linux_x86_32/Dynamic + ) + ENDIF() + +ELSEIF(MSVC) + SET( PVRTEXLIB_ROOT "C:/Imagination/PowerVR/GraphicsSDK/PVRTexTool/Library" ) + find_path( + PVRTEXLIB_INCLUDE_DIR PVRTexture.h + PATHS ${PVRTEXLIB_ROOT}/Include ) IF(${CMAKE_GENERATOR} MATCHES Win64) find_library(PVRTEXLIB_LIB PVRTexLib - PATHS "C:/Imagination/PowerVR/GraphicsSDK/PVRTexTool/Library/Windows_x86_64/Static" - "C:/Imagination/PowerVR/GraphicsSDK/PVRTexTool/Library/Windows_x86_64/Dynamic" + PATHS ${PVRTEXLIB_ROOT}/Windows_x86_64/Static + ${PVRTEXLIB_ROOT}/Windows_x86_64/Dynamic ) ELSE() find_library(PVRTEXLIB_LIB PVRTexLib - PATHS "C:/Imagination/PowerVR/GraphicsSDK/PVRTexTool/Library/Windows_x86_32/Static" - "C:/Imagination/PowerVR/GraphicsSDK/PVRTexTool/Library/Windows_x86_32/Dynamic" + PATHS ${PVRTEXLIB_ROOT}/Windows_x86_32/Static + ${PVRTEXLIB_ROOT}/Windows_x86_32/Dynamic ) ENDIF() ENDIF() @@ -93,4 +114,4 @@ include(FindPackageHandleStandardArgs) find_package_handle_standard_args(PVRTexLib DEFAULT_MSG PVRTEXLIB_LIB PVRTEXLIB_INCLUDE_DIR) -mark_as_advanced(PVRTEXLIB_INCLUDE_DIR PVRTEXLIB_LIB ) +mark_as_advanced( PVRTEXLIB_ROOT PVRTEXLIB_INCLUDE_DIR PVRTEXLIB_LIB )