| 7 | | |
| | 9 | # INVENTOR_SOWIN_LIBRARY, the SoWin library - window binding library for Inventor |
| | 10 | # INVENTOR_SOWIN_LIBRARY, the SoWin debug library |
| | 11 | # INVENTOR_SOXT_LIBRARY, the SoXt library - window binding library for Inventor |
| | 12 | # INVENTOR_SOXT_LIBRARY, the SoXt debug library |
| | 13 | # |
| | 14 | |
| | 15 | |
| | 16 | # |
| | 17 | # Inventor |
| | 18 | # |
| | 19 | # notes: |
| | 20 | # - Coin is honored over SGI Inventor |
| | 21 | # - Coin is detected by coin-config script, COINDIR environment variable, |
| | 22 | # and finally standard system locations are searched |
| | 23 | # - SGI Inventor is searched at standard system locations only |
| | 24 | # |
| | 25 | |
| | 26 | # coin-config tells much of Coin instalation (if present) |
| | 27 | execute_process (COMMAND coin-config --prefix |
| | 28 | OUTPUT_VARIABLE COIN_PREFIX |
| | 29 | OUTPUT_STRIP_TRAILING_WHITESPACE) |
| | 30 | |
| | 31 | # try to find Inventor includes (priority paths) |
| | 32 | FIND_PATH(INVENTOR_INCLUDE_DIR Inventor/So.h |
| | 33 | ${COIN_PREFIX}/include |
| | 34 | $ENV{COINDIR}/include |
| | 35 | NO_DEFAULT_PATH |
| | 36 | ) |
| | 37 | |
| | 38 | # try to find Inventor includes (regular paths) |
| 27 | | $ENV{COINDIR}/lib |
| 28 | | ) |
| 29 | | IF(NOT INVENTOR_LIBRARY) |
| 30 | | # If we can't find libCoin try libInventor |
| 31 | | FIND_LIBRARY(INVENTOR_LIBRARY |
| 32 | | NAMES Inventor |
| 33 | | PATHS |
| 34 | | /usr/local/lib |
| 35 | | /usr/lib |
| 36 | | /sw/lib |
| 37 | | /opt/local/lib |
| 38 | | /opt/csw/lib |
| 39 | | /opt/lib |
| 40 | | ) |
| 41 | | ENDIF(NOT INVENTOR_LIBRARY) |
| 42 | | |
| | 56 | ) |
| | 57 | |
| | 58 | # try to find Coin release lib (priority paths) |
| | 59 | FIND_LIBRARY(INVENTOR_LIBRARY_RELEASE |
| | 60 | NAMES coin5 coin4 coin3 coin2 coin1 Coin |
| | 61 | PATHS ${COIN_PREFIX}/lib |
| | 62 | $ENV{COINDIR}/lib |
| | 63 | NO_DEFAULT_PATH |
| | 64 | ) |
| | 65 | |
| | 66 | # try to find Coin release lib (regular paths) |
| | 67 | FIND_LIBRARY(INVENTOR_LIBRARY_RELEASE |
| | 68 | NAMES coin5 coin4 coin3 coin2 coin1 Coin |
| | 69 | PATHS ${INVENTOR_LIB_SEARCH_PATH} |
| | 70 | ) |
| | 71 | |
| | 72 | # try to find SGI Inventor lib |
| | 73 | FIND_LIBRARY(INVENTOR_LIBRARY_RELEASE |
| | 74 | NAMES Inventor |
| | 75 | PATHS ${INVENTOR_LIB_SEARCH_PATH} |
| | 76 | ) |
| | 77 | |
| | 78 | # try to find Coin debug lib (priority paths) |
| 44 | | NAMES coin2d |
| 45 | | PATHS |
| 46 | | /usr/local/lib |
| 47 | | /usr/lib |
| 48 | | /sw/lib |
| 49 | | /opt/local/lib |
| 50 | | /opt/csw/lib |
| 51 | | /opt/lib |
| 52 | | $ENV{COINDIR}/lib |
| 53 | | ) |
| 54 | | IF(NOT INVENTOR_LIBRARY_DEBUG) |
| 55 | | IF(INVENTOR_LIBRARY) |
| 56 | | SET(INVENTOR_LIBRARY_DEBUG ${INVENTOR_LIBRARY}) |
| 57 | | ENDIF(INVENTOR_LIBRARY) |
| 58 | | ENDIF(NOT INVENTOR_LIBRARY_DEBUG) |
| 59 | | |
| | 80 | NAMES coin5d coin4d coin3d coin2d coin1d |
| | 81 | PATHS ${COIN_PREFIX}/lib |
| | 82 | $ENV{COINDIR}/lib |
| | 83 | NO_DEFAULT_PATH |
| | 84 | ) |
| | 85 | |
| | 86 | # try to find Coin debug lib (regular paths) |
| | 87 | FIND_LIBRARY(INVENTOR_LIBRARY_DEBUG |
| | 88 | NAMES coin5d coin4d coin3d coin2d coin1d |
| | 89 | PATHS ${INVENTOR_LIB_SEARCH_PATH} |
| | 90 | ) |
| | 91 | |
| | 92 | # set release to debug if only debug found |
| | 93 | IF(NOT INVENTOR_LIBRARY_RELEASE AND INVENTOR_LIBRARY_DEBUG) |
| | 94 | SET(INVENTOR_LIBRARY_RELEASE ${INVENTOR_LIBRARY_DEBUG}) |
| | 95 | ENDIF(NOT INVENTOR_LIBRARY_RELEASE AND INVENTOR_LIBRARY_DEBUG) |
| | 96 | |
| | 97 | # set debug to release (if only release found) |
| | 98 | IF(NOT INVENTOR_LIBRARY_DEBUG AND INVENTOR_LIBRARY_RELEASE) |
| | 99 | SET(INVENTOR_LIBRARY_DEBUG ${INVENTOR_LIBRARY_RELEASE}) |
| | 100 | ENDIF(NOT INVENTOR_LIBRARY_DEBUG AND INVENTOR_LIBRARY_RELEASE) |
| | 101 | |
| | 102 | # INVENTOR_LIBRARY |
| | 103 | IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) |
| | 104 | SET(INVENTOR_LIBRARY |
| | 105 | optimized ${INVENTOR_LIBRARY_RELEASE} |
| | 106 | debug ${INVENTOR_LIBRARY_DEBUG}) |
| | 107 | ELSE(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) |
| | 108 | SET(INVENTOR_LIBRARY |
| | 109 | ${INVENTOR_LIBRARY_RELEASE}) |
| | 110 | ENDIF(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) |
| | 111 | |
| | 112 | # set INVENTOR_FOUND appropriately |
| | 117 | |
| | 118 | |
| | 119 | # |
| | 120 | # SoWin |
| | 121 | # |
| | 122 | # notes: SoWin is searched by COINDIR environment variable |
| | 123 | # (as expected to be located at Windows platform) |
| | 124 | |
| | 125 | # try to find SoWin lib (priority paths) |
| | 126 | FIND_LIBRARY(INVENTOR_SOWIN_LIBRARY |
| | 127 | NAMES sowin1 |
| | 128 | PATHS $ENV{COINDIR}/lib |
| | 129 | NO_DEFAULT_PATH |
| | 130 | ) |
| | 131 | |
| | 132 | # try to find SoWin lib (regular paths) |
| | 133 | FIND_LIBRARY(INVENTOR_SOWIN_LIBRARY |
| | 134 | NAMES sowin1 |
| | 135 | PATHS ${INVENTOR_LIB_SEARCH_PATH} |
| | 136 | ) |
| | 137 | |
| | 138 | # try to find SoWin debug lib (priority paths) |
| | 139 | FIND_LIBRARY(INVENTOR_SOWIN_LIBRARY_DEBUG |
| | 140 | NAMES sowin1d |
| | 141 | PATHS $ENV{COINDIR}/lib |
| | 142 | NO_DEFAULT_PATH |
| | 143 | ) |
| | 144 | |
| | 145 | # try to find SoWin debug lib (regular paths) |
| | 146 | FIND_LIBRARY(INVENTOR_SOWIN_LIBRARY_DEBUG |
| | 147 | NAMES sowin1d |
| | 148 | PATHS ${INVENTOR_LIB_SEARCH_PATH} |
| | 149 | ) |
| | 150 | |
| | 151 | # SoWin debug library defaults to non-debug lib |
| | 152 | IF(NOT INVENTOR_SOWIN_LIBRARY_DEBUG) |
| | 153 | IF(INVENTOR_SOWIN_LIBRARY) |
| | 154 | SET(INVENTOR_SOWIN_LIBRARY_DEBUG INVENTOR_SOWIN_LIBRARY) |
| | 155 | ENDIF(INVENTOR_SOWIN_LIBRARY) |
| | 156 | ENDIF(NOT INVENTOR_SOWIN_LIBRARY_DEBUG) |
| | 157 | |
| | 158 | |
| | 159 | # |
| | 160 | # SoXt |
| | 161 | # |
| | 162 | # notes: |
| | 163 | # - SoXt is detected by soxt-config script (as expected by |
| | 164 | # Coin's SoXt on Linux/Unix) and on standard system locations |
| | 165 | # - SGI's InventorXt support is missing now |
| | 166 | # |
| | 167 | |
| | 168 | # soxt-config tells much of SoXt instalation (if present) |
| | 169 | execute_process (COMMAND soxt-config --prefix |
| | 170 | OUTPUT_VARIABLE SOXT_PREFIX |
| | 171 | OUTPUT_STRIP_TRAILING_WHITESPACE) |
| | 172 | |
| | 173 | # try to find SoXt lib (priority paths) |
| | 174 | FIND_LIBRARY(INVENTOR_SOXT_LIBRARY |
| | 175 | NAMES soxt1 SoXt |
| | 176 | PATHS ${SOXT_PREFIX}/lib |
| | 177 | $ENV{COINDIR}/lib |
| | 178 | NO_DEFAULT_PATH |
| | 179 | ) |
| | 180 | |
| | 181 | # try to find SoXt lib (regular paths) |
| | 182 | FIND_LIBRARY(INVENTOR_SOXT_LIBRARY |
| | 183 | NAMES soxt1 SoXt |
| | 184 | PATHS ${INVENTOR_LIB_SEARCH_PATH} |
| | 185 | ) |
| | 186 | |
| | 187 | # try to find SoXt debug lib (priority paths) |
| | 188 | FIND_LIBRARY(INVENTOR_SOXT_LIBRARY_DEBUG |
| | 189 | NAMES soxt1d |
| | 190 | PATHS ${SOXT_PREFIX}/lib |
| | 191 | $ENV{COINDIR}/lib |
| | 192 | NO_DEFAULT_PATH |
| | 193 | ) |
| | 194 | |
| | 195 | # try to find SoXt debug lib (regular paths) |
| | 196 | FIND_LIBRARY(INVENTOR_SOXT_LIBRARY_DEBUG |
| | 197 | NAMES soxt1d |
| | 198 | PATHS ${INVENTOR_LIB_SEARCH_PATH} |
| | 199 | ) |
| | 200 | |
| | 201 | # SoXt debug library defaults to non-debug lib |
| | 202 | IF(NOT INVENTOR_SOXT_LIBRARY_DEBUG) |
| | 203 | IF(INVENTOR_SOXT_LIBRARY) |
| | 204 | SET(INVENTOR_SOXT_LIBRARY_DEBUG INVENTOR_SOXT_LIBRARY) |
| | 205 | ENDIF(INVENTOR_SOXT_LIBRARY) |
| | 206 | ENDIF(NOT INVENTOR_SOXT_LIBRARY_DEBUG) |