[CMake] Help creating a module for detecting mysql-connector-c++
Ryan Pavlik
rpavlik at iastate.edu
Wed May 26 17:37:27 EDT 2010
On 05/26/2010 01:59 PM, Torri, Stephen CIV NSWCDD, W15 wrote:
> From: Ryan Pavlik [mailto:rpavlik at iastate.edu]
> Sent: Wed 5/26/2010 2:42 PM
> To: Torri, Stephen CIV NSWCDD, W15; cmake at cmake.org
> Subject: Re: [CMake] Help creating a module for detecting mysql-connector-c++
>
>
>
> Didn't test it, just ran it through my cleanup software and then tweaked
> it a bit by hand. Hopefully this should help - at the very least it
> will be more readable and standardized.
>
> With this, you should just be able to set a MYSQLCONNECTORCPP_ROOT_DIR
> and have it find the rest properly and automatically, marking as
> advanced when possible.
>
> Ryan
>
>
> ________________________________
>
> Would an example be like?
>
> IF(WIN32)
>
> set(MYSQLCONNECTORCPP_ROOT_DIR "C:");
>
> ELSE(WIN32)
>
> set(MYSQLCONNECTORCPP_ROOT_DIR "/");
>
> ENDIF(WIN32)
>
> find_package(MysqlConnectorCpp REQUIRED)
>
> Stephen
>
>
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
--
Ryan Pavlik
HCI Graduate Student
Virtual Reality Applications Center
Iowa State University
rpavlik at iastate.edu
http://academic.cleardefinition.com
More information about the CMake
mailing list