The MYSQL_ variables do point where they should, but the MySQL backend
doesn't build:

pfedor@Pawels-iMac:~/tmp/soci$ git clone https://github.com/SOCI/soci.git
Cloning into 'soci'...
remote: Counting objects: 7820, done.
remote: Compressing objects: 100% (2059/2059), done.
remote: Total 7820 (delta 5805), reused 7707 (delta 5701)
Receiving objects: 100% (7820/7820), 1.64 MiB | 568 KiB/s, done.
Resolving deltas: 100% (5805/5805), done.
pfedor@Pawels-iMac:~/tmp/soci$ mv soci/src/cmake/modules/FindMySQL.cmake
soci/src/cmake/modules/x.tmp
pfedor@Pawels-iMac:~/tmp/soci$ mkdir build
pfedor@Pawels-iMac:~/tmp/soci$ cd build
pfedor@Pawels-iMac:~/tmp/soci/build$ cmake -G "Unix Makefiles"
-DWITH_BOOST=OFF -DMYSQL_INCLUDE_DIR=/opt/local/include/mysql55/mysql/
-DMYSQL_LIBRARIES=/opt/local/lib/mysql55/mysql/libmysqlclient_r.dylib
../soci/src/
-- The C compiler identification is GNU 4.2.1
-- The CXX compiler identification is Clang 4.1.0
-- Checking whether C compiler has -isysroot
-- Checking whether C compiler has -isysroot - yes
-- Checking whether C compiler supports OSX deployment target flag
-- Checking whether C compiler supports OSX deployment target flag - yes
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Configuring SOCI:
-- SOCI_VERSION                             = 3.1.0
-- SOCI_ABI_VERSION                         = 3.1
-- SOCI_PLATFORM_NAME                       = x86
-- SOCI_COMPILER_NAME                       = gcc-4.2.1
-- SOCI_TESTS                               = ON
-- Looking for SOCI dependencies:
-- Boost: disabled, since WITH_BOOST=OFF
-- MySQL:
CMake Warning at cmake/dependencies/MySQL.cmake:3 (find_package):
  By not providing "FindMySQL.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "MySQL", but
  CMake did not find one.

  Could not find a package configuration file provided by "MySQL" with any
of
  the following names:

    MySQLConfig.cmake
    mysql-config.cmake

  Add the installation prefix of "MySQL" to CMAKE_PREFIX_PATH or set
  "MySQL_DIR" to a directory containing one of the above files.  If "MySQL"
  provides a separate development package or SDK, be sure it has been
  installed.
Call Stack (most recent call first):
  cmake/SociDependencies.cmake:75 (include)
  CMakeLists.txt:62 (include)


-- WARNING:
-- MySQL not found, some libraries or features will be disabled.
-- See the documentation for MySQL or manually set these variables:
-- MYSQL_INCLUDE_DIR                        =
/opt/local/include/mysql55/mysql/
-- MYSQL_LIBRARIES                          =
/opt/local/lib/mysql55/mysql/libmysqlclient_r.dylib
-- ODBC:
-- ODBC_INCLUDE_DIRECTORIES                 = /usr/include
-- ODBC_LIBRARIES                           = /usr/lib/libiodbc.dylib
-- Oracle:
-- WARNING:
-- Oracle not found, some libraries or features will be disabled.
-- See the documentation for Oracle or manually set these variables:
-- ORACLE_INCLUDE_DIR                       =
-- ORACLE_LIBRARIES                         =
-- PostgreSQL:
-- POSTGRESQL_INCLUDE_DIR                   = /usr/include
-- POSTGRESQL_LIBRARIES                     = /usr/lib/libpq.dylib
-- POSTGRESQL_VERSION                       = 9.1.4
-- SQLite3:
-- SQLITE3_INCLUDE_DIR                      = /usr/include
-- SQLITE3_LIBRARIES                        = /usr/lib/libsqlite3.dylib
-- Configuring SOCI core library:
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE
-- SOCI_CORE_TARGET                         = soci_core
-- SOCI_CORE_TARGET_OUTPUT_NAME             = soci_core
-- SOCI_CORE_DEPENDENCIES                   = /usr/lib/libdl.dylib
-- WITH_BOOST                               = OFF
-- COMPILE_DEFINITIONS                      = SOCI_ABI_VERSION="3.1"
HAVE_DL=1 SOCI_LIB_PREFIX="libsoci_" SOCI_LIB_SUFFIX=".dylib"
-- Configuring SOCI database backends:
CMake Warning at backends/CMakeLists.txt:6 (find_package):
  By not providing "FindMySQL.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "MySQL", but
  CMake did not find one.

  Could not find a package configuration file provided by "MySQL" with any
of
  the following names:

    MySQLConfig.cmake
    mysql-config.cmake

  Add the installation prefix of "MySQL" to CMAKE_PREFIX_PATH or set
  "MySQL_DIR" to a directory containing one of the above files.  If "MySQL"
  provides a separate development package or SDK, be sure it has been
  installed.


-- Empty - SOCI backend skeleton for development of new backends
-- SOCI_EMPTY                               = ON
-- SOCI_EMPTY_TARGET                        = soci_empty
-- SOCI_EMPTY_TARGET_OUTPUT_NAME            = soci_empty
-- SOCI_EMPTY_HEADERS                       = soci-empty.h
-- COMPILE_DEFINITIONS                      = SOCI_ABI_VERSION="3.1"
-- SOCI_EMPTY_TEST_CONNSTR                  = dummy
added backend: empty
-- ODBC - SOCI backend for ODBC
-- SOCI_ODBC                                = ON
-- SOCI_ODBC_TARGET                         = soci_odbc
-- SOCI_ODBC_TARGET_OUTPUT_NAME             = soci_odbc
-- SOCI_ODBC_HEADERS                        = soci-odbc.h utility.h
-- COMPILE_DEFINITIONS                      = SOCI_ABI_VERSION="3.1"
HAVE_ODBC=1
-- SOCI_ODBC_TEST_ACCESS_CONNSTR            = test-access.dsn
-- SOCI_ODBC_TEST_POSTGRESQL_CONNSTR        = test-postgresql.dsn
added backend: odbc
-- PostgreSQL - SOCI backend for PostgreSQL database engine
-- SOCI_POSTGRESQL                          = ON
-- SOCI_POSTGRESQL_TARGET                   = soci_postgresql
-- SOCI_POSTGRESQL_TARGET_OUTPUT_NAME       = soci_postgresql
-- SOCI_POSTGRESQL_HEADERS                  = soci-postgresql.h common.h
-- COMPILE_DEFINITIONS                      = SOCI_ABI_VERSION="3.1"
HAVE_POSTGRESQL=1
-- SOCI_POSTGRESQL_TEST_CONNSTR             = dummy
added backend: postgresql
-- SQLite3 - SOCI backend for SQLite 3 database engine
-- SOCI_SQLITE3                             = ON
-- SOCI_SQLITE3_TARGET                      = soci_sqlite3
-- SOCI_SQLITE3_TARGET_OUTPUT_NAME          = soci_sqlite3
-- SOCI_SQLITE3_HEADERS                     = soci-sqlite3.h common.h
-- COMPILE_DEFINITIONS                      = SOCI_ABI_VERSION="3.1"
HAVE_SQLITE3=1
-- SOCI_SQLITE3_TEST_CONNSTR                = soci_test.db
added backend: sqlite3
-- 
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/pfedor/tmp/soci/build
pfedor@Pawels-iMac:~/tmp/soci/build$ make
Scanning dependencies of target soci_core
[  0%] Building CXX object
core/CMakeFiles/soci_core.dir/backend-loader.cpp.o
[  1%] Building CXX object core/CMakeFiles/soci_core.dir/blob.cpp.o

...

[100%] Building CXX object
backends/sqlite3/test/CMakeFiles/soci_sqlite3_test_static.dir/test-sqlite3.cpp.o
Linking CXX executable ../../../bin/soci_sqlite3_test_static
clang: warning: argument unused during compilation: '-ansi'
[100%] Built target soci_sqlite3_test_static
pfedor@Pawels-iMac:~/tmp/soci/build$ ls bin/
soci_empty_test soci_odbc_test_postgresql_static
soci_empty_test_static soci_postgresql_test
soci_odbc_test_access soci_postgresql_test_static
soci_odbc_test_access_static soci_sqlite3_test
soci_odbc_test_postgresql soci_sqlite3_test_static
pfedor@Pawels-iMac:~/tmp/soci/build$

Cheers,

Aleksander

On Sat, Oct 27, 2012 at 6:38 PM, Mateusz Loskot <[email protected]> wrote:

> On 27 October 2012 13:08, Mateusz Loskot <[email protected]> wrote:
> > On 27 October 2012 05:03, Pawel Aleksander Fedorynski <[email protected]>
> wrote:
> >>
> >> BTW: Either something's wrong with the cmake scripts or I don't know
> how to
> >> use it.  I have mysql installed in a somewhat weird place.  I tried the
> >> following:
> >>
> >> cmake -G "Unix Makefiles" -DWITH_BOOST=OFF
> >> -DMYSQL_INCLUDE_DIR=/opt/local/include/mysql55/mysql/
> >> -DMYSQL_LIBRARIES=/opt/local/lib/mysql55/mysql/libmysqlclient_r.dylib
> >> ../soci/src/
> >>
> >> and it didn't work: MYSQL_INCLUDE_DIR was found correctly but
> >> MYSQL_LIBRARIES was listed as not found:
> >>
> >> -- MySQL:
> >> -- WARNING:
> >> -- MySQL not found, some libraries or features will be disabled.
> >> -- See the documentation for MySQL or manually set these variables:
> >> -- MYSQL_INCLUDE_DIR                     =
> /opt/local/include/mysql55/mysql
> >> -- MYSQL_LIBRARIES                          = MYSQL_LIBRARY-NOTFOUND
> >> [...]
> >
> > Yes, there may be a problem indeed.
> > This weekend, I'm working on CMake config improvements,
> > so hoping to  get it fixed.
>
> Paweł,
>
> Can you make a quick test?
>
> 1. Go to src/cmake/modules
> 2. Rename FindMySQL.cmake to a non-cmake module, e.g. mv FindMySQL.cmake
> x.tmp
> 3. Run your cmake command again
>
> You will see some warnings, but the MYSQL_* variables should now
> point to your custom locations.
> For example:
>
> $ cmake -DWITH_BOOST=OFF -DSOCI_EMPTY=OFF -DSOCI_ODBC=OFF
> -DSOCI_POSTGRESQL=OFF -DSOCI_SQLITE3=OFF
> -DMYSQL_INCLUDE_DIR=/opt/mysql-5.0.96-linux-x86_64-glibc23/include
>
> -DMYSQL_LIBRARIES=/opt/mysql-5.0.96-linux-x86_64-glibc23/lib/libmysqlclient_r.a
> ../soci/src
> -- Configuring SOCI:
> -- SOCI_VERSION                             = 3.1.0
> -- SOCI_ABI_VERSION                      = 3.1
> -- SOCI_PLATFORM_NAME               = x64
> -- SOCI_COMPILER_NAME                = gcc-4.7.2
> -- SOCI_TESTS                               = ON
> -- Looking for SOCI dependencies:
> -- Boost: disabled, since WITH_BOOST=OFF
> -- MySQL:
> CMake Warning at cmake/dependencies/MySQL.cmake:3 (find_package):
>   By not providing "FindMySQL.cmake" in CMAKE_MODULE_PATH this project has
>   asked CMake to find a package configuration file provided by "MySQL", but
>   CMake did not find one.
>
>   Could not find a package configuration file provided by "MySQL" with any
> of
>   the following names:
>
>     MySQLConfig.cmake
>     mysql-config.cmake
>
>   Add the installation prefix of "MySQL" to CMAKE_PREFIX_PATH or set
>   "MySQL_DIR" to a directory containing one of the above files.  If "MySQL"
>   provides a separate development package or SDK, be sure it has been
>   installed.
> Call Stack (most recent call first):
>   cmake/SociDependencies.cmake:75 (include)
>   CMakeLists.txt:62 (include)
>
>
> -- WARNING:
> -- MySQL not found, some libraries or features will be disabled.
> -- See the documentation for MySQL or manually set these variables:
> -- MYSQL_INCLUDE_DIR                     =
> /opt/mysql-5.0.96-linux-x86_64-glibc23/include
> -- MYSQL_LIBRARIES                          =
> /opt/mysql-5.0.96-linux-x86_64-glibc23/lib/libmysqlclient_r.a
>
>
> In /opt/mysql-5.0.96-linux-x86_64-glibc23, I have the generic binaries
> downloaded from MySQL website.
> If this fix works, we may simply give up on using custom FindMySQL.cmake
> and rely on the one provided by CMake distribution.
>
>
> Best regards,
> --
> Mateusz Loskot, http://mateusz.loskot.net
>
>
> ------------------------------------------------------------------------------
> WINDOWS 8 is here.
> Millions of people.  Your app in 30 days.
> Visit The Windows 8 Center at Sourceforge for all your go to resources.
> http://windows8center.sourceforge.net/
> join-generation-app-and-make-money-coding-fast/
> _______________________________________________
> Soci-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/soci-users
>
------------------------------------------------------------------------------
WINDOWS 8 is here. 
Millions of people.  Your app in 30 days.
Visit The Windows 8 Center at Sourceforge for all your go to resources.
http://windows8center.sourceforge.net/
join-generation-app-and-make-money-coding-fast/
_______________________________________________
Soci-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/soci-users

Reply via email to