On 05/26/2010 01:49 PM, Torri, Stephen CIV NSWCDD, W15 wrote:
From: Ryan Pavlik [mailto:[email protected]]
Sent: Wed 5/26/2010 2:42 PM
To: Torri, Stephen CIV NSWCDD, W15; [email protected]
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
What software are you using to clean up a CMakeLists.txt file? Thanks for the
help.
Stephen
It's "cmake-bulk-decrufter" - software I wrote that parses the CMake
file into a parse tree in Python, optionally applies modifications to it
(such as "lowercase commands" "loose loop constructs" etc) using the
visitor pattern, then re-serializes it out to a (nicely-indented) cmake
file. Instead of overwriting your file, because you might want to
hand-tweak its cleanups, it opens your choice of merge programs with the
original and the cleaned up version both for reference. (In your case,
I took the output and modified it by hand further, making it match the
style of the de-facto standard module style - look at
http://github.com/rpavlik/wiimote-head-tracker-gui to see more of my
modules)
It's internal only for right now, but if there's interest I might be
able to release it. (If it were completely up to me, I would, but I
wrote it in the course of my work, so I have to check first.) I
personally have found it tremendously useful in improving my ability to
understand and work with other peoples' CMake code, especially those who
started by copying outdated or sloppy examples (which is a lot).
Ryan
--
Ryan Pavlik
HCI Graduate Student
Virtual Reality Applications Center
Iowa State University
[email protected]
http://academic.cleardefinition.com
_______________________________________________
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