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

Last change on this file since 19952 was 19885, checked in by tbretz, 5 years ago
Allow the use of HIGHLIGHT_LIBRARY even if it was not found.
File size: 775 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 srchilite/sourcehighlight.h PATHS ${HIGHLIGHT_INCLUDE_DIRS})
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.