svn commit: r466798 - head/databases/soci/files

Adriaan de Groot adridg at FreeBSD.org
Sun Apr 8 12:33:02 UTC 2018


Author: adridg
Date: Sun Apr  8 12:33:01 2018
New Revision: 466798
URL: https://svnweb.freebsd.org/changeset/ports/466798

Log:
  Pre-emptively fix databases/soci for CMake 3.11.
  
  With CMake 3.11, configure fails with this error:
  
    CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
    Please set them or make sure they are set and tested correctly in the CMake files:
    MYSQL_EMBEDDED_LIBRARIES
        linked by target "cmTC_ec547" in directory /wrkdirs/usr/ports/databases/soci/work/soci-3.2.2/CMakeFiles/CMakeTmp
  
    CMake Error at /usr/local/share/cmake/Modules/CheckIncludeFile.cmake:60 (try_compile):
      Failed to configure test project build system.
    Call Stack (most recent call first):
      /usr/local/share/cmake/Modules/FindThreads.cmake:121 (CHECK_INCLUDE_FILE)
      core/CMakeLists.txt:17 (include)
  
  The underlying issue is that the test for MySQL embedded leaks the
  library into CMAKE_REQUIRED_LIBRARIES, which are then picked up in
  other feature tests. If the library wasn't found (which is normal,
  it's not a dependency in the port) then those later tests fail.
  CMake 3.11 is somehow stricter about this than CMake 3.10.
  
  No PORTREVISION bump because it's a pre-emptive build fix and nothing
  changes on the port.
  
  Approved by:	tcberner (mentor, implicit)

Added:
  head/databases/soci/files/patch-cmake_modules_FindMySQL.cmake   (contents, props changed)

Added: head/databases/soci/files/patch-cmake_modules_FindMySQL.cmake
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/databases/soci/files/patch-cmake_modules_FindMySQL.cmake	Sun Apr  8 12:33:01 2018	(r466798)
@@ -0,0 +1,14 @@
+Prevent CMAKE_REQUIRED_LIBRARIES from leaking out of this module.
+If the embedded libs are not found, we don't want to have the
+not-found libraries required by other modules.
+
+--- cmake/modules/FindMySQL.cmake.orig	2013-08-21 22:40:11 UTC
++++ cmake/modules/FindMySQL.cmake
+@@ -119,6 +119,7 @@ endif(MYSQL_EMBEDDED_LIBRARIES)
+ set( CMAKE_REQUIRED_INCLUDES ${MYSQL_INCLUDE_DIR} )
+ set( CMAKE_REQUIRED_LIBRARIES ${MYSQL_EMBEDDED_LIBRARIES} )
+ check_cxx_source_compiles( "#include <mysql.h>\nint main() { int i = MYSQL_OPT_USE_EMBEDDED_CONNECTION; }" HAVE_MYSQL_OPT_EMBEDDED_CONNECTION )
++unset( CMAKE_REQUIRED_LIBRARIES )
+ 
+ if(MYSQL_INCLUDE_DIR AND MYSQL_LIBRARIES)
+    set(MYSQL_FOUND TRUE)


More information about the svn-ports-head mailing list