Findexprtk.cmake 1.33 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
################################################################################
#
# CMake script for finding ExprTk.
# The default CMake search process is used to locate files.
#
# This script creates the following variables:
#  EXPRTK_FOUND: Boolean that indicates if the package was found
#  EXPRTK_INCLUDE_DIRS: Paths to the necessary header files
#
################################################################################

# Find headers and libraries
FIND_PATH(
    EXPRTK_INCLUDE_DIR
    NAMES
        exprtk.hpp
    HINTS
	$ENV{EXPRTK_INCLUDE_DIR}
        $ENV{EXPRTK_ROOT}
        ${EXPRTK_ROOT}
    PATHS
        /home
        /usr/local
        /usr
        /opt/local
26
        external_dependencies/exprtk
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
    PATH_SUFFIXES
        include
)
# Set EXPRTK_FOUND honoring the QUIET and REQUIRED arguments
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(
    ExprTk
    "ExprTk was NOT found!"
    EXPRTK_INCLUDE_DIR)

# Output variables
IF(EXPRTK_FOUND)
    # Include dirs
    SET(EXPRTK_INCLUDE_DIRS ${EXPRTK_INCLUDE_DIR})
ELSE()
42
    MESSAGE(FATAL_ERROR "Set, please, the environmental variable EXPRTK_INCLUDE_DIR to the folder, where 'exprtk.hpp' is located...")
43 44 45 46 47 48
ENDIF(EXPRTK_FOUND)

# Advanced options for not cluttering the cmake UIs:
MARK_AS_ADVANCED(EXPRTK_INCLUDE_DIR)

include_directories(${EXPRTK_INCLUDE_DIRS})