On 05/27/2010 03:29 PM, Torri, Stephen CIV NSWCDD, W15 wrote:
From: Ryan Pavlik [mailto:rpav...@iastate.edu]
Sent: Wed 5/26/2010 5:37 PM
To: Torri, Stephen CIV NSWCDD, W15; cmake@cmake.org
Subject: Re: [CMake] Help creating a module for detecting mysql-connector-c++

No, the "ROOT_DIR" variables are to be set by the user at configure time
- let's say you installed something into a weird directory, you'd like
to be able to tell it where to find it.  You wouldn't generally set it
in your cmakelists.txt, except if you know a relative location (for
example, there is no PARTB_ROOT_DIR set, but it's always bundled with
PARTA, and you have a PARTA_ROOT_DIR, you might consider setting
PARTB_ROOT_DIR to be the value of PARTA_ROOT_DIR)
Ryan,

Ok. I see that its now an entry in the cmake-gui. What I filled in the file with the 
directory where mysql-connector-c++ is installed but I could not figure out why it failed 
to find it.  The headers are found in "C:\Program Files\MySQL\MySQL Connector C++ 
1.0.5\include\cppconn" so I changed the find_path for the include to be:

         find_path(MYSQLCONNECTORCPP_INCLUDE_DIR
                 NAMES
                 mysql_connection.h
                 PATHS
                 "cppconn"
                 HINTS
                 ${MYSQLCONNECTORCPP_ROOT_DIR}
                 PATH_SUFFIXES
                 include)

Where I think I am getting confused is how this command is expanded. In 
particular I would like to follow what is doing by running this module in some 
sort of debug mode. That is print out the paths it looked into to find the 
target header.

Stephen

If you (and others, in general) use it this way:
#include <mysql_connection.h>
then this is what you want:

        find_path(MYSQLCONNECTORCPP_INCLUDE_DIR
                NAMES
                mysql_connection.h
                PATHS
                HINTS
                ${MYSQLCONNECTORCPP_ROOT_DIR}
                PATH_SUFFIXES
                include
                include/cppcon)

but if you use it this way:
#include <cppcon/mysql_connection.h>
then you want

find_path(MYSQLCONNECTORCPP_INCLUDE_DIR
                NAMES
                cppcon/mysql_connection.h
                PATHS
                HINTS
                ${MYSQLCONNECTORCPP_ROOT_DIR}
                PATH_SUFFIXES
                include)


Ryan

--
Ryan Pavlik
HCI Graduate Student
Virtual Reality Applications Center
Iowa State University

rpav...@iastate.edu
http://academic.cleardefinition.com
Internal VRAC/HCI Site: http://tinyurl.com/rpavlik

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to