SOCI, ODBC, CMake and windows 7

I'm trying to configure SOCI under windows with ODBC.
The core works but odbc doesn't. The problem is the it can't find soci-backend.h

CMake tells me:

ODBC not found, some libraries or features will be disabled. 
See the documentation for ODBC or manually set these variables: 
ODBC_INCLUDE_DIR                         = C:/MinGW/include 
ODBC_LIBRARIES                           = ODBC_LIBRARY-NOTFOUND 

while the documentation says:

WITH_ODBC 	boolean 	Should CMake try to detect ODBC libraries. On Unix systems, CMake tries to find unixODBC or iODBC implementations.
ODBC_INCLUDE_DIRECTORIES 	string 	Path to ODBC implementation include directories where CMake should look for sql.h header.
ODBC_LIBRARIES 	string 	Full paths to libraries to link SOCI against to enable the backend support.
SOCI_ODBC 	boolean 	Requests to build ODBC backend. Automatically switched on, if WITH_ODBC is set to ON.
SOCI_ODBC_TEST_{database}_CONNSTR 	string 	ODBC Data Source Name (DSN) or ODBC File Data Source Name (FILEDSN) to test database: Microsoft Access (.mdb), Microsoft SQL Server, MySQL, PostgreSQL or any other ODBC SQL data source. {database} is placeholder for name of database driver ACCESS, MYSQL, POSTGRESQL, etc. See ODBC backend refernece for details. Example: -DSOCI_ODBC_TEST_POSTGRESQL_CONNSTR="FILEDSN=/home/mloskot/dev/soci/_git/build/test-postgresql.dsn"



Even when I set ODBC_INCLUDE_DIR, ODBC_INCLUDE_DIRECTORIES, and ODBC_LIBRARIES to the correct path in system environment CMake ignores it and uses 'C:/MinGW/include'

So how could I convince CMake that ODBC exists?
They are not environment variables, they are command line definitions:

cmake -DODBC_INCLUDE_DIR=C:/your/path
Yes, you're right, but I'm using the cmake-gui where you do this with the button 'Add Entry'.
By the way: ODBC_INCLUDE_DIR is the right entry not ODBC_INCLUDE_DIRECTORIES

Unfortunately there are more problems:

find_package for ODBC doesn't work (i guess there is no such package)
'test' doesn't work (I want to use sqlite which is not one of the test cases)

after fixing all this it actually does compile but not link (they forget a checkmark the inherited libs)

anyway, thaks for your response!
Topic archived. No new replies allowed.