diff options
Diffstat (limited to 'project/cmake/modules/FindCWiid.cmake')
| -rw-r--r-- | project/cmake/modules/FindCWiid.cmake | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/project/cmake/modules/FindCWiid.cmake b/project/cmake/modules/FindCWiid.cmake new file mode 100644 index 0000000..88cfbef --- /dev/null +++ b/project/cmake/modules/FindCWiid.cmake | |||
| @@ -0,0 +1,44 @@ | |||
| 1 | #.rst: | ||
| 2 | # FindCWiid | ||
| 3 | # --------- | ||
| 4 | # Finds the CWiid library | ||
| 5 | # | ||
| 6 | # This will will define the following variables:: | ||
| 7 | # | ||
| 8 | # CWIID_FOUND - system has CWiid | ||
| 9 | # CWIID_INCLUDE_DIRS - the CWiid include directory | ||
| 10 | # CWIID_LIBRARIES - the CWiid libraries | ||
| 11 | # | ||
| 12 | # and the following imported targets:: | ||
| 13 | # | ||
| 14 | # CWiid::CWiid - The CWiid library | ||
| 15 | |||
| 16 | if(PKG_CONFIG_FOUND) | ||
| 17 | pkg_check_modules(PC_CWIID cwiid QUIET) | ||
| 18 | endif() | ||
| 19 | |||
| 20 | find_path(CWIID_INCLUDE_DIR NAMES cwiid.h | ||
| 21 | PATHS ${PC_CWIID_INCLUDEDIR}) | ||
| 22 | find_library(CWIID_LIBRARY NAMES cwiid | ||
| 23 | PATHS ${PC_CWIID_LIBDIR}) | ||
| 24 | |||
| 25 | set(CWIID_VERSION ${PC_CWIID_VERSION}) | ||
| 26 | |||
| 27 | include(FindPackageHandleStandardArgs) | ||
| 28 | find_package_handle_standard_args(CWIID | ||
| 29 | REQUIRED_VARS CWIID_LIBRARY CWIID_INCLUDE_DIR | ||
| 30 | VERSION_VAR CWIID_VERSION) | ||
| 31 | |||
| 32 | if(CWIID_FOUND) | ||
| 33 | set(CWIID_INCLUDE_DIRS ${CWIID_INCLUDE_DIR}) | ||
| 34 | set(CWIID_LIBRARIES ${CWIID_LIBRARY}) | ||
| 35 | |||
| 36 | if(NOT TARGET CWiid::CWiid) | ||
| 37 | add_library(CWiid::CWiid UNKNOWN IMPORTED) | ||
| 38 | set_target_properties(CWiid::CWiid PROPERTIES | ||
| 39 | IMPORTED_LOCATION "${CWIID_LIBRARY}" | ||
| 40 | INTERFACE_INCLUDE_DIRECTORIES "${CWIID_INCLUDE_DIR}") | ||
| 41 | endif() | ||
| 42 | endif() | ||
| 43 | |||
| 44 | mark_as_advanced(CWIID_INCLUDE_DIR CWIID_LIBRARY) | ||
