Guys,
I'm taking a stab at moving application/knemo to CMake. I'm new to cmake, but given a reasonable outline of what to do, I'll bet I can slog through it. knemo seems small enough to serve as a good package to learn with.
What I need to know is "What is the basic outline for moving an existing kde module to cmake?
I can figure out I need a knemo/cmake directory with modules/TDEMacros.cmake and a CMakeLists.txt, but after that I'm a bit lost.
I have taken Serghei's kdewebdev CMakeLists.txt and I'm trying to cannibalize it. I think most everything will work. There are additional line I don't think I'll need in knemo since there are not any sub-packages like quanta. Can I just delete the following?:
option( BUILD_QUANTA "Build quanta" ${BUILD_ALL} ) option( BUILD_KFILEREPLACE "Build kfilereplace" ${BUILD_ALL} )
if( BUILD_QUANTA ) add_subdirectory( lib ) endif( )
tde_conditional_add_subdirectory( BUILD_QUANTA quanta )
If I don't have subdirectories like quanta and I can just remove those lines, that gets me started... But then the question becomes "what else to I need to change in the knemo/cmake... directory?
Here is my first run and the errors I got. I'll put my comments/questions in the errors:
CMake Error at CMakeLists.txt:60 (include): include could not find load file:
ConfigureChecks.cmake
## I get it, I need a ConfigureChecks.cmake. Can I just copy one? What kind of ## changes can I expect to need to make?
CMake Error: File /home/david/tbld/applications/knemo/config.h.cmake does not exist. CMake Error at CMakeLists.txt:87 (configure_file): configure_file Problem configuring file
## Same issue, I know I'll need a config.h.cmake, what would be a good one to copy?
That's about where I am on my cmake/knemo journey. If somebody has an outline to get me going on the cmake conversions, I don't mind helping move the smaller apps to cmake.
On Mon, Feb 21, 2011 at 3:12 AM, David C. Rankin drankinatty@suddenlinkmail.com wrote:
Guys,
I'm taking a stab at moving application/knemo to CMake. I'm new to cmake, but given a reasonable outline of what to do, I'll bet I can slog through it. knemo seems small enough to serve as a good package to learn with.
<snip>
Serghei started a cmake conversion scrapbook (with macros to help speed things up) on the wiki at http://trinity.pearsoncomputing.net/wiki/bin/view/Developers/CMakeConversion... -- I'm not sure if this is completely finished, I'm not familiar with cmake either, but it should at least help get things started. I remember him saying on IRC that you'll likely have to do some manual editing, but hopefully his stuff will at least get you to where you need to be to finish it off.
On 02/20/2011 09:20 PM, Kristopher Gamrat wrote:
On Mon, Feb 21, 2011 at 3:12 AM, David C. Rankin drankinatty@suddenlinkmail.com wrote:
Guys,
I'm taking a stab at moving application/knemo to CMake. I'm new to cmake, but given a reasonable outline of what to do, I'll bet I can slog through it. knemo seems small enough to serve as a good package to learn with.
<snip>
Serghei started a cmake conversion scrapbook (with macros to help speed things up) on the wiki at http://trinity.pearsoncomputing.net/wiki/bin/view/Developers/CMakeConversion... -- I'm not sure if this is completely finished, I'm not familiar with cmake either, but it should at least help get things started. I remember him saying on IRC that you'll likely have to do some manual editing, but hopefully his stuff will at least get you to where you need to be to finish it off.
Hey - Great! I'll go give it a look over. I've made progress. Most of the files just needed to be present (they were empty in kdewebdev), I'm down to the 'make install' error:
-- checking for 'Qt' -- Performing Test HAVE_PATCHED_QT3 -- Performing Test HAVE_PATCHED_QT3 - Success -- found patched Qt, version 3.3.8 -- checking for one of the modules 'TQt' -- checking for 'TDE' -- found 'TDE', version 3.5.13 -- Configuring done -- Generating done -- Build files have been written to: /home/david/tbld/applications/knemo/src /usr/bin/cmake -H/home/david/tbld/applications/knemo -B/home/david/tbld/applications/knemo/src --check-build-system CMakeFiles/Makefile.cmake 0 /usr/bin/cmake -E cmake_progress_start /home/david/tbld/applications/knemo/src/CMakeFiles /home/david/tbld/applications/knemo/src/CMakeFiles/progress.marks make -f CMakeFiles/Makefile2 all make[1]: Entering directory `/home/david/tbld/applications/knemo/src' make[1]: Nothing to be done for `all'. make[1]: Leaving directory `/home/david/tbld/applications/knemo/src' /usr/bin/cmake -E cmake_progress_start /home/david/tbld/applications/knemo/src/CMakeFiles 0 make: *** No rule to make target `install'. Stop.
No rule to make target 'install'? Seems easy enough to solve. I'll go read. If you have a quick suggestion, let me know. Thanks!
On Feb 20, 2011, at 22:34, "David C. Rankin" drankinatty@suddenlinkmail.com wrote:
On 02/20/2011 09:20 PM, Kristopher Gamrat wrote:
On Mon, Feb 21, 2011 at 3:12 AM, David C. Rankin drankinatty@suddenlinkmail.com wrote:
Guys,
I'm taking a stab at moving application/knemo to CMake. I'm new to cmake, but given a reasonable outline of what to do, I'll bet I can slog through it. knemo seems small enough to serve as a good package to learn with.
<snip>
Serghei started a cmake conversion scrapbook (with macros to help speed things up) on the wiki at http://trinity.pearsoncomputing.net/wiki/bin/view/Developers/CMakeConversion... -- I'm not sure if this is completely finished, I'm not familiar with cmake either, but it should at least help get things started. I remember him saying on IRC that you'll likely have to do some manual editing, but hopefully his stuff will at least get you to where you need to be to finish it off.
Hey - Great! I'll go give it a look over. I've made progress. Most of the files just needed to be present (they were empty in kdewebdev), I'm down to the 'make install' error:
-- checking for 'Qt' -- Performing Test HAVE_PATCHED_QT3 -- Performing Test HAVE_PATCHED_QT3 - Success -- found patched Qt, version 3.3.8 -- checking for one of the modules 'TQt' -- checking for 'TDE' -- found 'TDE', version 3.5.13 -- Configuring done -- Generating done -- Build files have been written to: /home/david/tbld/applications/knemo/src /usr/bin/cmake -H/home/david/tbld/applications/knemo -B/home/david/tbld/applications/knemo/src --check-build-system CMakeFiles/Makefile.cmake 0 /usr/bin/cmake -E cmake_progress_start /home/david/tbld/applications/knemo/src/CMakeFiles /home/david/tbld/applications/knemo/src/CMakeFiles/progress.marks make -f CMakeFiles/Makefile2 all make[1]: Entering directory `/home/david/tbld/applications/knemo/src' make[1]: Nothing to be done for `all'. make[1]: Leaving directory `/home/david/tbld/applications/knemo/src' /usr/bin/cmake -E cmake_progress_start /home/david/tbld/applications/knemo/src/CMakeFiles 0 make: *** No rule to make target `install'. Stop.
No rule to make target 'install'? Seems easy enough to solve. I'll go read. If you have a quick suggestion, let me know. Thanks!
Hi,
Please join us on IRC for more discussion on this topic. irc://irc.freenode.net/#trinity-desktop
On 02/20/2011 09:20 PM, Kristopher Gamrat wrote:
On Mon, Feb 21, 2011 at 3:12 AM, David C. Rankin drankinatty@suddenlinkmail.com wrote:
Guys,
I'm taking a stab at moving application/knemo to CMake. I'm new to cmake, but given a reasonable outline of what to do, I'll bet I can slog through it. knemo seems small enough to serve as a good package to learn with.
<snip>
Serghei started a cmake conversion scrapbook (with macros to help speed things up) on the wiki at http://trinity.pearsoncomputing.net/wiki/bin/view/Developers/CMakeConversion... -- I'm not sure if this is completely finished, I'm not familiar with cmake either, but it should at least help get things started. I remember him saying on IRC that you'll likely have to do some manual editing, but hopefully his stuff will at least get you to where you need to be to finish it off.
That's a good reference, but I need to know where the pieces go before I pick the pieces to figure out what to put in there.
To try and gain a better mental picture of what I'm trying to do, I'm trying to visualize what I need in the knemo directory structure. Here is a stab at visualizing what will be needed -- where. knemo has a simple dir structure in the source:
knemo admin src common kcm knemod translations
Let me know if what I have below is pointing in the right direction or just put '<del>' if not needed or '<add: what's needed>' inline below. That would really help me paint a picture of where I'm trying to go:
knemo | |- CMakeLists.txt |- config.h |- config.h.cmake |- \cmake | - modules (stuff I'll pick through later) |- \src | - kcm | -CMakeLists.txt? | - knemod | -CMakeLists.txt? |- \translations | -CMakeLists.txt?
('?' above shows files I think I need to create)
I'll look through the cmake/modules and patch that up later. First I want to get an outline what I need, then I can read the CMake stuff to find out what goes inside the files after I figure out which files I need :)
Ideally, what I want to do it some up with a "HelloWorld.tde.cmake" directory structure and template CMakeLists.txt that would look something like this:
trinity-app | |- CMakeLists.txt |- cmake | - modules (TDE stuff you need here) |- src |- - put the code here with framework of cmake stuff needed
If I can get a handle on where I need to get to, then I can work backwards (learning as I go) and fill in the gaps. (reverse engineer it for lack of better words ;-)
What I also need is a 'recipe' -- a few hard-&-fast rules for TDE CMakeLists.txt
Something like:
In the top CMakeLists.txt, you will need:
- required checks:
-- project( <name> )
-- include( CheckCXXSourceCompiles ) -- include( CheckFunctionExists ) -- include( CheckIncludeFileCXX ) -- include( CheckStructHasMember ) -- include( CheckSymbolExists ) -- include( CheckTypeSize ) -- include( FindPkgConfig )
-- set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" ) -- include( TDEMacros )
-- include( TDESetupPaths ) -- tde_setup_paths( )
- for each modules subdirectory in the packages a:
-- option( BUILD_<NAME> "Build <name>" ${BUILD_ALL} ) -- tde_conditional_add_subdirectory( BUILD_<NAME> <name> )
- then continue with:
# in between option() and tde_conditional_add_subdirectory() -- include( ConfigureChecks.cmake )
-- configure_file( config.h.cmake config.h @ONLY )
In each module subdirectory CMakeLists.txt you will need:
-- ???
I apologize if this is all basic stuff, but I don't know cmake. To help Trinity move things to cmake, I need to learn. You can't learn the tde specific stuff from google: 'cmake tutorial'. If I can get it sorted out, then I can add it to the wiki so others can follow my rabbit-trail and help move modules as well. (at least that's my plan)
If we can come up with a coherent 'recipe' for moving modules to cmake, I'm more than happy to write the wiki. From #trinity-desktop on freenode, I take it samelian is the goto guy on the CMakeLists.txt. It seems if we can put a bit of effort into coming up with this recipe, then we can multiply by tenfold the number of monkeys typing the recipe into a keyboard for other trinity-modules.
What say the experts on putting some type of recipe together?
On Mon, Feb 21, 2011 at 9:11 PM, David C. Rankin drankinatty@suddenlinkmail.com wrote: <snip>
I apologize if this is all basic stuff, but I don't know cmake. To help Trinity move things to cmake, I need to learn.
<snip>
Don't apologize, we all need to start somewhere. Stupid questions don't come from beginners, they come from experts. A question that is simple and obvious to an expert would be stupid coming from an expert, but isn't stupid at all from a beginner, so ask away and don't feel stupid in the least! (just don't ask me, I know nuthin'! ;-) )
If we can come up with a coherent 'recipe' for moving modules to cmake, I'm more than happy to write the wiki. From #trinity-desktop on freenode, I take it samelian is the goto guy on the CMakeLists.txt. It seems if we can put a bit of effort into coming up with this recipe, then we can multiply by tenfold the number of monkeys typing the recipe into a keyboard for other trinity-modules.
"More than happy sounds like a dangerous mental condition. 'We had to put Dave in the mental home... he was more than happy.'" --George Carlin
(NOT picking on David lol, George actually used the name "Dave" in the above quote, look up George Carlin Everyday Expressions on youtube)
What say the experts on putting some type of recipe together?
I think that's what Samelian was working on with that link. With just two devs (one of which doesn't know much about cmake), it could take awhile to get the "recipe" together. We also need to keep in mind that each package is going to have some specific options that won't work in all packages... some options might work in a few packages, or maybe just one, so the person doing each specific package would need to figure out those.
On 02/21/2011 08:29 PM, Kristopher Gamrat wrote:
On Mon, Feb 21, 2011 at 9:11 PM, David C. Rankin drankinatty@suddenlinkmail.com wrote:
<snip>
"More than happy sounds like a dangerous mental condition. 'We had to put Dave in the mental home... he was more than happy.'" --George Carlin
<snip>
I escaped ... :p
I think that's what Samelian was working on with that link. With just two devs (one of which doesn't know much about cmake), it could take awhile to get the "recipe" together. We also need to keep in mind that each package is going to have some specific options that won't work in all packages... some options might work in a few packages, or maybe just one, so the person doing each specific package would need to figure out those.
Yes, your 100% correct on the individual module specific needs. That's why I was thinking along the lines of a 'minimal cmake recipe' that you could then dig into the configure.in/(other files) for the individual modules and then plug it into the top-level CMakeLists.txt or in the CMakeLists.txt|cmake/modules/(whatever) files for the subdirs.
I'll go to trinity-desktop on freenode and see if I can get an answer to the question:
"If I were going to look at the cmake setup for an existing trinity module that I could use as a quasi-template to adapt to other modules that need to be ported --> Which existing Trinity module would provide a good reference to use?"
If I can get an answer to that, then I can feel confident that I'm looking in the right place.
It's kind of a twist on the old adage, "it doesn't matter how fast you can run -- if you're running in the wrong direction, you will never make it to the finish line" :)