source: trunk/FACT++/cmake/FindHighlight.cmake@ 20022

Last change on this file since 20022 was 19977, checked in by tbretz, 4 years ago
Make proper use of PATH_SUFFIXES
File size: 789 bytes
Line 
1# Try to find the package via pkg-config
2PKG_CHECK_MODULES(HIGHLIGHT source-highlight QUIET)
3
4# Try to locate the package in the default path
5# and in the path provided by pkg-config
6FIND_PATH(HIGHLIGHT_INCLUDE_DIR NAMES sourcehighlight.h PATHS ${HIGHLIGHT_INCLUDE_DIRS} PATH_SUFFIXES srchilite)
7FIND_LIBRARY(HIGHLIGHT_LIBRARY NAMES source-highlight PATHS ${HIGHLIGHT_LIBRARY_DIRS})
8
9# Check if LIBARARY and INCLUDE_DIR is set
10# Print a message otherwise
11FIND_PACKAGE_HANDLE_STANDARD_ARGS(Highlight DEFAULT_MSG HIGHLIGHT_LIBRARY HIGHLIGHT_INCLUDE_DIR)
12
13# Mark those variables to be displayed as 'advanced' in the GUI
14IF(HIGHLIGHT_FOUND)
15 MARK_AS_ADVANCED(HIGHLIGHT_LIBRARY HIGHLIGHT_INCLUDE_DIR)
16ELSE()
17 UNSET(HIGHLIGHT_LIBRARY CACHE)
18 UNSET(HIGHLIGHT_INCLUDE_DIR CACHE)
19ENDIF()
Note: See TracBrowser for help on using the repository browser.