tFindJansson.cmake - pism - [fork] customized build of PISM, the parallel ice sheet model (tillflux branch)
(HTM) git clone git://src.adamsgaard.dk/pism
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) LICENSE
---
tFindJansson.cmake (1281B)
---
1 # Copyright (C) 2014 Johannes Schauer <j.schauer@email.de>
2 #
3 # Permission is hereby granted, free of charge, to any person obtaining a copy
4 # of this software and associated documentation files (the "Software"), to deal
5 # in the Software without restriction, including without limitation the rights
6 # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 # copies of the Software, and to permit persons to whom the Software is
8 # furnished to do so, subject to the following conditions:
9 #
10 # The above copyright notice and this permission notice shall be included in
11 # all copies or substantial portions of the Software.
12
13 find_path(JANSSON_INCLUDE_DIRS NAMES "jansson.h")
14 find_library(JANSSON_LIBRARIES NAMES "jansson")
15 mark_as_advanced(JANSSON_INCLUDE_DIRS JANSSON_LIBRARIES)
16
17 if (JANSSON_INCLUDE_DIRS)
18 file(STRINGS "${JANSSON_INCLUDE_DIRS}/jansson.h" jansson_version_str REGEX "^#define[\t ]+JANSSON_VERSION[\t ]+\".*\"")
19 string(REGEX REPLACE "^#define[\t ]+JANSSON_VERSION[\t ]+\"([^\"]*)\".*" "\\1" JANSSON_VERSION_STRING "${jansson_version_str}")
20 unset(jansson_version_str)
21 endif()
22
23 include(FindPackageHandleStandardArgs)
24 find_package_handle_standard_args(Jansson
25 REQUIRED_VARS JANSSON_LIBRARIES JANSSON_INCLUDE_DIRS
26 VERSION_VAR JANSSON_VERSION_STRING)