fixed: gcc8 compile issues
[opensg.git] / CMake / FindNVidiaPerfSDK.cmake
blobb87a2ccfa119aaee9776a2c400dc0ab36960b417
1 # - Find collada dom libraries
2 # Find the collada dom libraries and headers
4 # This module specifies the following variables:
5 #  NVIDIAPERFSDK_INCLUDE_DIR
6 #  NVIDIAPERFSDK_LIBRARIES
7 #  NVIDIAPERFSDK_LIBRARY_DIRS
9 # Additionally the following more specialized variables are defined:
10 #  NVIDIAPERFSDK_LIBRARY_DEBUG        debug library
11 #  NVIDIAPERFSDK_LIBRARY_RELEASE      release library
13 #  You can control where this module attempts to locate libraries and headers:
14 #  NVIDIAPERFSDK_ROOT_DIR
15 #  NVIDIAPERFSDK_INCLUDE_DIR
16 #  NVIDIAPERFSDK_LIBRARY_DIR
19 # default include search paths
20 SET(__NVIDIAPERFSDK_INCLUDE_SEARCH_DIRS
21     ~/Library/Frameworks
22     /Library/Frameworks
23     /usr/local/include
24     /usr/local/include/colladadom
25     /usr/include
26     /usr/include/colladadom
27     /sw/include
28     /opt/local/include
29     /opt/local/include/colladadom
30     /opt/include
31     /opt/include/colladadom)
33 # default library search paths
34 SET(__NVIDIAPARFSDK_LIBRARY_SEARCH_DIRS
35     ~/Library/Frameworks
36     /Library/Frameworks
37     /usr/local/lib
38     /usr/local/lib64
39     /usr/lib
40     /usr/lib64
41     /sw/lib
42     /opt/local/lib
43     /opt/local/lib64
44     /opt/lib
45     /opt/lib64)
47 # handle NVIDIAPERFSDK_ROOT_DIR input variable
48 IF(NVIDIAPERFSDK_ROOT_DIR)
49     FILE(TO_CMAKE_PATH ${NVIDIAPERFSDK_ROOT_DIR} NVIDIAPERFSDK_ROOT_DIR)
51     SET(__NVIDIAPERFSDK_INCLUDE_SEARCH_DIRS "${NVIDIAPERFSDK_ROOT_DIR}/inc"
52                                             "${__NVIDIAPERFSDK_INCLUDE_SEARCH_DIRS}")
54     SET(__NVIDIAPERFSDK_LIBDIR_SUFFIX_IN "${CMAKE_SYSTEM_NAME}_${CMAKE_SYSTEM_PROCESSOR}")
56     STRING(TOLOWER ${__NVIDIAPERFSDK_LIBDIR_SUFFIX_IN} __NVIDIAPERFSDK_LIBDIR_SUFFIX)
58     SET(__NVIDIAPERFSDK_LIBRARY_SEARCH_DIRS "${NVIDIAPERFSDK_ROOT_DIR}/lib/${__NVIDIAPERFSDK_LIBDIR_SUFFIX}"
59                                             "${__NVIDIAPERFSDK_LIBRARY_SEARCH_DIRS}")
60 ENDIF(NVIDIAPERFSDK_ROOT_DIR)
62 # handle NVIDIAPERFSDK_INCLUDE_DIR input variable
63 IF(NVIDIAPERFSDK_INCLUDE_DIR)
64     FILE(TO_CMAKE_PATH ${NVIDIAPERFSDK_INCLUDE_DIR} NVIDIAPERFSDK_INCLUDE_DIR)
65     SET(__NVIDIAPERFSDK_INCLUDE_SEARCH_DIRS "${NVIDIAPERFSDK_INCLUDE_DIR}"
66                                             "${__NVIDIAPERFSDK_INCLUDE_SEARCH_DIRS}")
67 ENDIF(NVIDIAPERFSDK_INCLUDE_DIR)
69 # handle NVIDIAPERFSDK_LIBRARY_DIR input variable
70 IF(NVIDIAPERFSDK_LIBRARY_DIR)
71     FILE(TO_CMAKE_PATH ${NVIDIAPERFSDK_LIBRARY_DIR} NVIDIAPERFSDK_LIBRARY_DIR)
72     SET(__NVIDIAPERFSDK_LIBRARY_SEARCH_DIRS "${NVIDIAPERFSDK_LIBRARY_DIR}"
73                                             "${__NVIDIAPERFSDK_LIBRARY_SEARCH_DIRS}")
74 ENDIF(NVIDIAPERFSDK_LIBRARY_DIR)
77 # locate headers
78 FIND_PATH(NVIDIAPERFSDK_INCLUDE_DIR NVPerfSDK.h
79     PATHS ${__NVIDIAPERFSDK_INCLUDE_SEARCH_DIRS})
82 # locate libraries
83 FIND_LIBRARY(NVIDIAPERFSDK_LIBRARY_RELEASE
84     NAMES NVPerfSDK
85     PATHS ${__NVIDIAPERFSDK_LIBRARY_SEARCH_DIRS})
87 FIND_LIBRARY(NVIDIAPERFSDK_LIBRARY_DEBUG
88     NAMES NVPerfSDK-d
89     PATHS ${__NVIDIAPERFSDK_LIBRARY_SEARCH_DIRS})
92 # handle the QUIETLY and REQUIRED arguments and set NVIDIAPERFSDK_FOUND to TRUE if 
93 # all listed variables are TRUE
94 INCLUDE(FindPackageHandleStandardArgs)
95 FIND_PACKAGE_HANDLE_STANDARD_ARGS(NVIDIAPERFSDK DEFAULT_MSG NVIDIAPERFSDK_LIBRARY_RELEASE
96                                                             NVIDIAPERFSDK_INCLUDE_DIR)
98 # set output variables
99 IF(NVIDIAPERFSDK_FOUND)
100     SET(NVIDIAPERFSDK_LIBRARIES "${NVIDIAPERFSDK_LIBRARY_RELEASE}")
101 ENDIF(NVIDIAPERFSDK_FOUND)