# - Find trackd # Find the trackd library. # # This module defines: # trackd_FOUND - if false, you cannot use trackd. # trackd_DEFINITIONS - compile- and link-definitions for trackd # trackd_INCLUDE_DIR - the directory in which you can find trackdAPI_CC.h # trackd_INCLUDE_DIRS - the same as trackd_INCLUDE_DIR # trackd_LIBRARY - the full path of libtrackd # trackd_LIBRARIES - the full path of libtrackd + names of libraries linked against # trackd_LIBRARY_DIR - the directory containing libtrackd # trackd_LIBRARY_DIRS - the library directories needed for trackd_LIBRARIES # trackd_FRAMEWORKS - the frameworks needed for trackd (needed on MAC systems) # # To aid in the detection_process, you can set the following variables: # trackd_ROOT_DIR - give a hint, which directory to use (=install prefix of trackd) # if this is not set, the environment variable trackd_ROOT_DIR is used, if available. # # Examples: # set ( trackd_ROOT_DIR /usr/local ) # ############################################################################### # The following variables are used internally and unset after use: ############################################################################### # CHANGES: # - 14.10.2009 (rlander): created ############################################################################### # default paths for trackd_ROOT_DIR set (trackd_DEFAULT_PATHS /usr/local/trackdAPI CACHE INTERNAL "Default paths for trackd_ROOT_DIR") # check for CMAKE 24 version if (CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION EQUAL 4) set (CMAKE_VERSION_24 TRUE) endif (CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION EQUAL 4) #make cache-entry: set ( trackd_ROOT_DIR ${trackd_ROOT_DIR} CACHE PATH "Install prefix of the trackd library") # honor environment variables: if ( NOT trackd_ROOT_DIR ) set ( trackd_ROOT_DIR $ENV{trackd_ROOT_DIR} ) endif ( NOT trackd_ROOT_DIR ) ############################################################################### # find trackd itself: ############################################################################### # try to find the root directory (if not set): if ( NOT trackd_ROOT_DIR ) # CMAKE 2.4.x compatibility if ( CMAKE_VERSION_24 ) find_path( trackd_FIND_ROOT_DIR NAMES include/trackdAPI_CC.h PATHS ${trackd_DEFAULT_PATHS} DOC "Helper for finding trackd_ROOT_DIR") else ( CMAKE_VERSION_24 ) find_path( trackd_FIND_ROOT_DIR NAMES include/trackdAPI_CC.h HINTS ${trackd_DEFAULT_PATHS} DOC "Helper for finding trackd_ROOT_DIR") endif ( CMAKE_VERSION_24 ) if ( trackd_FIND_ROOT_DIR ) set (trackd_ROOT_DIR ${trackd_FIND_ROOT_DIR} CACHE PATH "Install prefix of the trackd library" FORCE) endif ( trackd_FIND_ROOT_DIR ) MARK_AS_ADVANCED ( trackd_FIND_ROOT_DIR ) endif ( NOT trackd_ROOT_DIR ) # try to find the include directory: # CMAKE 2.4.x compatibility if ( CMAKE_VERSION_24 ) find_path( trackd_INCLUDE_DIR NAMES trackdAPI_CC.h PATHS ${trackd_ROOT_DIR}/include DOC "The directory in which you can find trackdAPI_CC.h" ) else ( CMAKE_VERSION_24 ) find_path( trackd_INCLUDE_DIR NAMES trackdAPI_CC.h HINTS ${trackd_ROOT_DIR}/include DOC "The directory in which you can find trackdAPI_CC.h" ) endif ( CMAKE_VERSION_24 ) # try to find the library: # CMAKE 2.4.x compatibility if ( CMAKE_VERSION_24 ) find_library( trackd_LIBRARY NAMES trackdAPI_CC PATHS ${trackd_ROOT_DIR}/lib DOC "The directory in which you can find libtrackdAPI_CC.so") else ( CMAKE_VERSION_24 ) find_library( trackd_LIBRARY NAMES trackdAPI_CC HINTS ${trackd_ROOT_DIR}/lib DOC "The directory in which you can find libtrackdAPI_CC.so") endif ( CMAKE_VERSION_24 ) # set the library directory: get_filename_component(trackd_LIBRARY_DIR ${trackd_LIBRARY} PATH ) MARK_AS_ADVANCED ( trackd_INCLUDE_DIR trackd_LIBRARY trackd_LIBRARY_DIR ) # unmark when include-dir or library was not found within root dir if ( trackd_ROOT_DIR AND NOT trackd_INCLUDE_DIR ) MARK_AS_ADVANCED ( CLEAR trackd_INCLUDE_DIR ) endif ( trackd_ROOT_DIR AND NOT trackd_INCLUDE_DIR ) if ( trackd_ROOT_DIR AND NOT trackd_LIBRARY ) MARK_AS_ADVANCED ( CLEAR trackd_LIBRARY ) endif ( trackd_ROOT_DIR AND NOT trackd_LIBRARY ) ############################################################################### # set default stuff: ############################################################################### # handle the QUIETLY and REQUIRED arguments and set trackd_FOUND to TRUE if # all listed variables are TRUE # CMAKE 2.4.x support if ( NOT CMAKE_VERSION_24 ) include( FindPackageHandleStandardArgs OPTIONAL RESULT_VARIABLE FindPackageHandleStandardsArgs_INCLUDED ) endif ( NOT CMAKE_VERSION_24 ) if ( FindPackageHandleStandardsArgs_INCLUDED ) FIND_PACKAGE_HANDLE_STANDARD_ARGS(trackd DEFAULT_MSG trackd_LIBRARY trackd_INCLUDE_DIR) else ( FindPackageHandleStandardsArgs_INCLUDED ) set ( trackd_FOUND TRUE ) if ( NOT trackd_LIBRARY ) message( FATAL_ERROR "Unable to find trackd_LIBRARY! Please set the correct trackd_ROOT_DIR to the prefix of your trackd installation!") set ( TRACKD_FOUND FALSE ) endif ( NOT trackd_LIBRARY ) if ( NOT trackd_INCLUDE_DIR ) message( FATAL_ERROR "Unable to find trackd_INCLUDE_DIR! Please set the correct trackd_ROOT_DIR to the place of your trackd installation!") set ( TRACKD_FOUND FALSE ) endif ( NOT trackd_INCLUDE_DIR ) endif ( FindPackageHandleStandardsArgs_INCLUDED ) if ( TRACKD_FOUND ) set ( trackd_FOUND true ) # FIND_PACKAGE_HANDLE_STANDARD_ARGS only sets TRACKD_FOUND set ( trackd_INCLUDE_DIRS ${trackd_INCLUDE_DIR} ) set ( trackd_LIBRARIES ${trackd_LIBRARY} ) set ( trackd_LIBRARY_DIRS ${trackd_LIBRARY_DIR} ) endif (TRACKD_FOUND ) ############################################################################### # Add compile-flags and definitions: ############################################################################### MARK_AS_ADVANCED( trackd_FOUND trackd_DEFINITIONS trackd_INCLUDE_DIR trackd_INCLUDE_DIRS trackd_LIBRARY trackd_LIBRARIES trackd_LIBRARY_DIR trackd_LIBRARY_DIRS trackd_FRAMEWORKS )