]> granicus.if.org Git - icinga2/commitdiff
Add more include/library paths for MySQL and PostgreSQL 5934/head
authorGunnar Beutner <gunnar.beutner@icinga.com>
Wed, 3 Jan 2018 00:05:23 +0000 (01:05 +0100)
committerGunnar Beutner <gunnar.beutner@icinga.com>
Wed, 3 Jan 2018 00:11:54 +0000 (01:11 +0100)
third-party/cmake/FindMySQL.cmake
third-party/cmake/FindPostgreSQL.cmake

index 0814211223d90865fe660c37b41328f4f77281d0..60c23afd5d0bf418a92d60f5c843d9ddd636c727 100644 (file)
@@ -28,6 +28,8 @@
 ##########################################################################
 
 
+FILE(GLOB _macports_include_dirs /opt/local/include/mysql*/mysql)
+
 #-------------- FIND MYSQL_INCLUDE_DIR ------------------
 FIND_PATH(MYSQL_INCLUDE_DIR mysql.h
   $ENV{MYSQL_INCLUDE_DIR}
@@ -40,9 +42,12 @@ FIND_PATH(MYSQL_INCLUDE_DIR mysql.h
   /opt/local/include/mysql5
   /usr/local/mysql/include
   /usr/local/mysql/include/mysql
+  ${_macports_include_dirs}
   $ENV{ProgramFiles}/MySQL/*/include
   $ENV{SystemDrive}/MySQL/*/include)
 
+UNSET(_macports_include_dirs)
+
 #----------------- FIND MYSQL_LIB_DIR -------------------
 IF (WIN32)
   SET(MYSQL_CLIENT_LIBS libmysql)
@@ -70,6 +75,9 @@ IF (WIN32)
     $ENV{SystemDrive}/MySQL/*/lib/${libsuffixDist})
 ELSE (WIN32)
   SET(MYSQL_CLIENT_LIBS mysqlclient)
+
+  FILE(GLOB _macports_lib_dirs /opt/local/lib/mysql*/mysql)
+
   FIND_LIBRARY(MYSQL_LIB NAMES mysqlclient
     PATHS
     $ENV{MYSQL_DIR}/libmysql_r/.libs
@@ -82,7 +90,10 @@ ELSE (WIN32)
     /opt/local/mysql5/lib
     /opt/local/lib/mysql5/mysql
     /opt/mysql/mysql/lib/mysql
-    /opt/mysql/lib/mysql)
+    /opt/mysql/lib/mysql
+    ${_macports_lib_dirs})
+
+  UNSET(_macports_lib_dirs)
 ENDIF (WIN32)
 
 IF(MYSQL_LIB)
index d32246671c05999c12c3450609b32f8247e68318..4d213d26a471f7aeb7327d9e4359674cf30f682f 100644 (file)
@@ -112,6 +112,8 @@ if ( WIN32 )
   foreach (suffix ${PostgreSQL_KNOWN_VERSIONS} )
     set(PostgreSQL_ADDITIONAL_SEARCH_PATHS ${PostgreSQL_ADDITIONAL_SEARCH_PATHS} "C:/Program Files/PostgreSQL/${suffix}" )
   endforeach()
+else()
+  set(PostgreSQL_ADDITIONAL_SEARCH_PATHS ${PostgreSQL_ADDITIONAL_SEARCH_PATHS} "/Library/PostgreSQL/*")
 endif()
 set( PostgreSQL_ROOT_DIRECTORIES
    ENV PostgreSQL_ROOT