File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # - Try to find the O2 Common package include dirs and libraries
2+ # Author: Barthelemy von Haller
3+ #
4+ # This script will set the following variables:
5+ # Common_FOUND - System has Common
6+ # Common_INCLUDE_DIRS - The Common include directories
7+ # Common_LIBRARIES - The libraries needed to use Common
8+ # Common_DEFINITIONS - Compiler switches required for using Common
9+ #
10+ # This script can use the following variables:
11+ # Common_ROOT - Installation root to tell this module where to look. (it tries LD_LIBRARY_PATH otherwise)
12+
13+ # Init
14+ include (FindPackageHandleStandardArgs )
15+
16+ # find includes
17+ find_path (COMMON_INCLUDE_DIR Timer.h
18+ HINTS ${Common_ROOT} /include ENV LD_LIBRARY_PATH PATH_SUFFIXES "../include/Common" "../../include/Common" )
19+ # Remove the final "Common"
20+ get_filename_component (COMMON_INCLUDE_DIR ${COMMON_INCLUDE_DIR} DIRECTORY )
21+ set (Common_INCLUDE_DIRS ${COMMON_INCLUDE_DIR} )
22+
23+ # find library
24+ find_library (COMMON_LIBRARY NAMES Common HINTS ${Common_ROOT} /lib ENV LD_LIBRARY_PATH )
25+ set (Common_LIBRARIES ${COMMON_LIBRARY} )
26+
27+ # handle the QUIETLY and REQUIRED arguments and set COMMON_FOUND to TRUE
28+ # if all listed variables are TRUE
29+ find_package_handle_standard_args (Common "Common could not be found. Install package Common or set Common_ROOT to its root installation directory."
30+ COMMON_LIBRARY COMMON_INCLUDE_DIR)
31+
32+ if (${COMMON_FOUND} )
33+ message (STATUS "Common found : ${Common_LIBRARIES} " )
34+ endif ()
35+
36+ mark_as_advanced (COMMON_INCLUDE_DIR COMMON_LIBRARY )
Original file line number Diff line number Diff line change 1+ # - Find mysqlclient
2+ # Find the native MySQL includes and library
3+ #
4+ # MYSQL_INCLUDE_DIRS - where to find mysql.h, etc.
5+ # MYSQL_LIBRARIES - List of libraries when using MySQL.
6+ # MYSQL_FOUND - True if MySQL found.
7+
8+ # MYSQL_PATH_SUFFIXES - by default it includes "mysql". Set it if you want to force extra suffixes to be used.
9+
10+ if (NOT MYSQL_PATH_SUFFIXES)
11+ set (MYSQL_PATH_SUFFIXES "" "mysql" )
12+ endif ()
13+
14+ FIND_PATH (MYSQL_INCLUDE_DIRS mysql.h
15+ /usr/local/include/mysql
16+ /usr/include/mysql
17+ )
18+
19+ SET (MYSQL_NAMES mysqlclient mysqlclient_r)
20+ FIND_LIBRARY (MYSQL_LIBRARY
21+ NAMES ${MYSQL_NAMES}
22+ PATHS /usr/lib /usr/lib64 /usr/local/lib
23+ PATH_SUFFIXES ${MYSQL_PATH_SUFFIXES}
24+ )
25+
26+ IF (MYSQL_INCLUDE_DIRS AND MYSQL_LIBRARY)
27+ SET (MYSQL_FOUND TRUE )
28+ SET ( MYSQL_LIBRARIES ${MYSQL_LIBRARY} )
29+ ELSE (MYSQL_INCLUDE_DIRS AND MYSQL_LIBRARY )
30+ SET (MYSQL_FOUND FALSE )
31+ UNSET (MYSQL_LIBRARIES CACHE )
32+ UNSET (MYSQL_INCLUDE_DIRS CACHE )
33+ ENDIF (MYSQL_INCLUDE_DIRS AND MYSQL_LIBRARY )
34+
35+ IF (MYSQL_FOUND)
36+ MESSAGE (STATUS "Found MySQL: ${MYSQL_LIBRARY} " )
37+ ELSE (MYSQL_FOUND )
38+ IF (MYSQL_FIND_REQUIRED)
39+ MESSAGE (STATUS "Looked for MySQL libraries named ${MYSQL_NAMES} ." )
40+ MESSAGE (FATAL_ERROR "Could NOT find MySQL library" )
41+ ENDIF (MYSQL_FIND_REQUIRED )
42+ ENDIF (MYSQL_FOUND )
43+
44+ MARK_AS_ADVANCED (
45+ MYSQL_LIBRARY
46+ MYSQL_INCLUDE_DIRS
47+ )
You can’t perform that action at this time.
0 commit comments