Add FindJansson.cmake

Added find_package module for CMake which locates the Jansson libraries
and headers. This will make dependency checking easier and prevents build
failures due to missing dependencies.
This commit is contained in:
Markus Makela
2016-10-09 13:20:31 +03:00
parent e9f94dcd9d
commit 48b1583830
5 changed files with 34 additions and 12 deletions

16
cmake/FindJansson.cmake Normal file
View File

@ -0,0 +1,16 @@
# This CMake file locates the Jansson libraries and headers
#
# The following variables are set:
# JANSSON_FOUND - If the Avro C library was found
# JANSSON_LIBRARIES - Path to the static library
# JANSSON_INCLUDE_DIR - Path to Avro headers
find_path(JANSSON_INCLUDE_DIR jansson.h)
find_library(JANSSON_LIBRARIES NAMES libjansson.a libjansson.so)
if (JANSSON_INCLUDE_DIR AND JANSSON_LIBRARIES)
message(STATUS "Found Jansson: ${JANSSON_LIBRARIES}")
set(JANSSON_FOUND TRUE)
else()
message(STATUS "Could not find Jansson")
endif()