# Find NvidiaCg # # This module defines # NvidiaCg_FOUND # NvidiaCg_INCLUDE_DIRS # NvidiaCg_LIBRARIES # # Copyright (c) 2012 I-maginer # # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the Free Software # Foundation; either version 2 of the License, or (at your option) any later # version. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License along with # this program; if not, write to the Free Software Foundation, Inc., 59 Temple # Place - Suite 330, Boston, MA 02111-1307, USA, or go to # http://www.gnu.org/copyleft/lesser.txt # # On a new cmake run, we do not need to be verbose IF(NvidiaCg_INCLUDE_DIR AND NvidiaCg_LIBRARY) SET(NvidiaCg_FIND_QUIETLY TRUE) ENDIF() # If CG_INC_PATH was defined in the environment, use it. if (NOT "$ENV{CG_INC_PATH}" STREQUAL "") set(NvidiaCg_INCLUDE_SEARCH_DIRS $ENV{CG_INC_PATH}) endif() # If CG_LIB_PATH was defined in the environment, use it. if (NOT "$ENV{CG_LIB_PATH}" STREQUAL "") set(NvidiaCg_LIBRARY_SEARCH_DIRS $ENV{CG_LIB_PATH}) endif() # log message IF (NOT NvidiaCg_FIND_QUIETLY) MESSAGE(STATUS "Checking for Nvidia Cg SDK") ENDIF() # Search for header files FIND_PATH(NvidiaCg_INCLUDE_DIR Cg/cgGL.h PATHS ${NvidiaCg_INCLUDE_SEARCH_DIRS}) # Search for libraries files FIND_LIBRARY(NvidiaCg_LIBRARY cg PATHS ${NvidiaCg_LIBRARY_SEARCH_DIRS}) FIND_LIBRARY(NvidiaCgGL_LIBRARY cgGL PATHS ${NvidiaCg_LIBRARY_SEARCH_DIRS}) # Configure libraries SET(NvidiaCg_INCLUDE_DIRS ${NvidiaCg_INCLUDE_DIR} CACHE STRING "Directory containing Nvidia Cg SDK header files") SET(NvidiaCg_LIBRARIES ${NvidiaCg_LIBRARY} ${NvidiaCgGL_LIBRARY} CACHE STRING "Nvidia Cg SDK libraries files") # Hide those variables in GUI SET(NvidiaCg_INCLUDE_DIR ${NvidiaCg_INCLUDE_DIR} CACHE INTERNAL "") SET(NvidiaCg_LIBRARY ${NvidiaCg_LIBRARY} CACHE INTERNAL "") SET(NvidiaCgGL_LIBRARY ${NvidiaCgGL_LIBRARY} CACHE INTERNAL "") IF(NvidiaCg_INCLUDE_DIRS AND NvidiaCg_LIBRARY AND NvidiaCgGL_LIBRARY) SET(NvidiaCg_FOUND TRUE) ENDIF() # log find result IF(NvidiaCg_FOUND) IF(NOT NvidiaCg_FIND_QUIETLY) MESSAGE(STATUS " libraries: ${NvidiaCg_LIBRARIES}") MESSAGE(STATUS " includes: ${NvidiaCg_INCLUDE_DIRS}") ENDIF() ELSE(NvidiaCg_FOUND) IF(NOT NvidiaCg_LIBRARIES) MESSAGE(STATUS, "NvidiaCg SDK library files could not be found") ENDIF() IF(NOT NvidiaCg_INCLUDE_DIRS) MESSAGE(STATUS "NvidiaCg SDK include files could not be found") ENDIF() ENDIF(NvidiaCg_FOUND)