1 # libConfuse is a configuration file parser library
2 # available at http://www.nongnu.org/confuse/
4 # The module defines the following variables:
5 # CONFUSE_FOUND - the system has Confuse
6 # CONFUSE_INCLUDE_DIR - where to find confuse.h
7 # CONFUSE_INCLUDE_DIRS - confuse includes
8 # CONFUSE_LIBRARY - where to find the Confuse library
9 # CONFUSE_LIBRARIES - additional libraries
10 # CONFUSE_ROOT_DIR - root dir (ex. /usr/local)
12 #=============================================================================
13 # Copyright 2010-2013, Julien Schueller
14 # All rights reserved.
16 # Redistribution and use in source and binary forms, with or without
17 # modification, are permitted provided that the following conditions are met:
19 # 1. Redistributions of source code must retain the above copyright notice, this
20 # list of conditions and the following disclaimer.
21 # 2. Redistributions in binary form must reproduce the above copyright notice,
22 # this list of conditions and the following disclaimer in the documentation
23 # and/or other materials provided with the distribution.
25 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
26 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
27 # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
28 # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
29 # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
30 # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
31 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
32 # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
34 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 # The views and conclusions contained in the software and documentation are those
37 # of the authors and should not be interpreted as representing official policies,
38 # either expressed or implied, of the FreeBSD Project.
39 #=============================================================================
42 find_path ( CONFUSE_INCLUDE_DIR
46 set ( CONFUSE_INCLUDE_DIRS ${CONFUSE_INCLUDE_DIR} )
48 find_library ( CONFUSE_LIBRARY
52 set ( CONFUSE_LIBRARIES ${CONFUSE_LIBRARY} )
55 # try to guess root dir from include dir
56 if ( CONFUSE_INCLUDE_DIR )
57 string ( REGEX REPLACE "(.*)/include.*" "\\1" CONFUSE_ROOT_DIR ${CONFUSE_INCLUDE_DIR} )
58 # try to guess root dir from library dir
59 elseif ( CONFUSE_LIBRARY )
60 string ( REGEX REPLACE "(.*)/lib[/|32|64].*" "\\1" CONFUSE_ROOT_DIR ${CONFUSE_LIBRARY} )
64 # handle the QUIETLY and REQUIRED arguments
65 include ( FindPackageHandleStandardArgs )
66 find_package_handle_standard_args( Confuse DEFAULT_MSG CONFUSE_LIBRARY CONFUSE_INCLUDE_DIR )