[CMake] Help creating a module for detecting mysql-connector-c++

Torri, Stephen CIV NSWCDD, W15 stephen.torri at navy.mil
Thu May 27 16:29:47 EDT 2010


> From: Ryan Pavlik [mailto:rpavlik at iastate.edu]
> Sent: Wed 5/26/2010 5:37 PM
> To: Torri, Stephen CIV NSWCDD, W15; cmake at 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


More information about the CMake mailing list