- highlight goals updated less than 5 minutes ago
[buliscores] / qjson / cmake / modules / FindQJSON.cmake
1 # Find QJSON - JSON handling library for Qt
2 #
3 # This module defines
4 #  QJSON_FOUND - whether the qsjon library was found
5 #  QJSON_LIBRARIES - the qjson library
6 #  QJSON_INCLUDE_DIR - the include path of the qjson library
7 #
8
9 if (QJSON_INCLUDE_DIR AND QJSON_LIBRARIES)
10
11   # Already in cache
12   set (QJSON_FOUND TRUE)
13
14 else (QJSON_INCLUDE_DIR AND QJSON_LIBRARIES)
15
16   if (NOT WIN32)
17     # use pkg-config to get the values of QJSON_INCLUDE_DIRS
18     # and QJSON_LIBRARY_DIRS to add as hints to the find commands.
19     include (FindPkgConfig)
20     pkg_check_modules (PC_QJSON QJson>=0.5)
21   endif (NOT WIN32)
22
23   find_library (QJSON_LIBRARIES
24     NAMES
25     qjson
26     PATHS
27     ${PC_QJSON_LIBRARY_DIRS}
28     ${LIB_INSTALL_DIR}
29     ${KDE4_LIB_DIR}
30   )
31
32   find_path (QJSON_INCLUDE_DIR
33     NAMES
34     qjson/parser.h
35     PATHS
36     ${PC_QJSON_INCLUDE_DIRS}
37     ${INCLUDE_INSTALL_DIR}
38     ${KDE4_INCLUDE_DIR}
39   )
40
41   include(FindPackageHandleStandardArgs)
42   find_package_handle_standard_args(QJSON DEFAULT_MSG QJSON_LIBRARIES QJSON_INCLUDE_DIR)
43
44 endif (QJSON_INCLUDE_DIR AND QJSON_LIBRARIES)