Re: maco_optional_find_package magic
On Friday 13 March 2009, Jeff Mitchell wrote: Can someone clue me in as to how macro_optional_find_package manages to not have the configure abort (at the end) if the package isn't found? I thought it might be something in KDE4Defaults, but didn't find it in there either. I need to do a check before I add the KDE4 includes/find_package, so I can't use the macro (because I can't rely on KDE4 being installed)...but The file MacroOptionalFindPackage.cmake can be used completely independent from the rest of KDE, there is nothing in it which depends on anything KDE-related. So you could just copy that file into your project and use it. If you use it with the keyword REQUIRED, it will also fail with FATAL_ERROR if the package is not found. The one thing it does additionally compared to plain FIND_PACKAGE() is that it automatically provides an option WITH_name_of_the_package, which you can disable, then it will not even try to search for the package. Alex ___ Kde-buildsystem mailing list Kde-buildsystem@kde.org https://mail.kde.org/mailman/listinfo/kde-buildsystem
Re: maco_optional_find_package magic
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Christian Ehrlicher wrote: The one thing it does additionally compared to plain FIND_PACKAGE() is that it automatically provides an option WITH_name_of_the_package, which you can disable, then it will not even try to search for the package. Okay, let me restate my question, since it was totally ignored. When macro_optional_find_package is used, if a package is not found, CMake finishes configuring and writes build files. If you simply use find_package, even if you are *not* using REQUIRED, if a package is not found, CMake finishes configuring but does *not* write build files, saying that an error had occurred. Which package do you mean? Looks like it's broken as this should not happen. If you don't mind, here's a CMakeLists.txt and the corresponding FindTaglibExtras.cmake...can you see if you can spot why this might be happening? http://websvn.kde.org/trunk/extragear/multimedia/amarok/CMakeLists.txt?revision=938768view=markup http://websvn.kde.org/trunk/extragear/multimedia/amarok/cmake/modules/FindTaglibExtras.cmake?revision=938775view=markup Note that in FindTaglibExtras.cmake I've expanded some macros and pasted them in here...this is on purpose, and not really worth getting into in this forum, but I can't rely on the normal macro versions. Thanks, Jeff -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) iEYEARECAAYFAkm6pYUACgkQANYdqNCuGCXE0ACgvN1YDsMYR8TyZfU6rLDsrBrX mcgAoM/uDsZPWRlbebVL+IGqby5eW6zg =aF2S -END PGP SIGNATURE- ___ Kde-buildsystem mailing list Kde-buildsystem@kde.org https://mail.kde.org/mailman/listinfo/kde-buildsystem
Re: maco_optional_find_package magic
On Friday 13 March 2009, Jeff Mitchell wrote: ... If you don't mind, here's a CMakeLists.txt and the corresponding FindTaglibExtras.cmake...can you see if you can spot why this might be happening? http://websvn.kde.org/trunk/extragear/multimedia/amarok/CMakeLists.txt?revi sion=938768view=markup http://websvn.kde.org/trunk/extragear/multimedia/amarok/cmake/modules/FindT aglibExtras.cmake?revision=938775view=markup Note that in FindTaglibExtras.cmake I've expanded some macros and pasted them in here...this is on purpose, and not really worth getting into in this forum, Yes, it is. FindPackageHandleStandardArgs.cmake comes with cmake and should be usable. Please let us know which problems you have with it. Beside that, it looks quite ok (the expanded macros don't make reading it easier). I'd suggest you add some debug output using message(STATUS ...) to see what's going on. Or you replace the two FATAL_ERROR with STATUS to see why it's failing. You can also run cmake with the --trace option, then you will see each cmake command which is executed. Or the --debug-output, which tells to for each line cmake prints, where it comes from and the cmake call stack. Alex ___ Kde-buildsystem mailing list Kde-buildsystem@kde.org https://mail.kde.org/mailman/listinfo/kde-buildsystem
Re: maco_optional_find_package magic
Alexander Neundorf schrieb: On Friday 13 March 2009, Jeff Mitchell wrote: ... If you don't mind, here's a CMakeLists.txt and the corresponding FindTaglibExtras.cmake...can you see if you can spot why this might be happening? http://websvn.kde.org/trunk/extragear/multimedia/amarok/CMakeLists.txt?revi sion=938768view=markup http://websvn.kde.org/trunk/extragear/multimedia/amarok/cmake/modules/FindT aglibExtras.cmake?revision=938775view=markup Note that in FindTaglibExtras.cmake I've expanded some macros and pasted them in here...this is on purpose, and not really worth getting into in this forum, Yes, it is. FindPackageHandleStandardArgs.cmake comes with cmake and should be usable. Please let us know which problems you have with it. Beside that, it looks quite ok (the expanded macros don't make reading it easier). I'd suggest you add some debug output using message(STATUS ...) to see what's going on. Or you replace the two FATAL_ERROR with STATUS to see why it's failing. Shouldn't it be TaglibExtras_FIND_REQUIRED and not Taglib-Extras_FIND_REQUIRED ? Christian ___ Kde-buildsystem mailing list Kde-buildsystem@kde.org https://mail.kde.org/mailman/listinfo/kde-buildsystem
Re: maco_optional_find_package magic
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Alexander Neundorf wrote: On Friday 13 March 2009, Jeff Mitchell wrote: ... If you don't mind, here's a CMakeLists.txt and the corresponding FindTaglibExtras.cmake...can you see if you can spot why this might be happening? http://websvn.kde.org/trunk/extragear/multimedia/amarok/CMakeLists.txt?revi sion=938768view=markup http://websvn.kde.org/trunk/extragear/multimedia/amarok/cmake/modules/FindT aglibExtras.cmake?revision=938775view=markup Note that in FindTaglibExtras.cmake I've expanded some macros and pasted them in here...this is on purpose, and not really worth getting into in this forum, Yes, it is. FindPackageHandleStandardArgs.cmake comes with cmake and should be usable. Please let us know which problems you have with it. Ah, ok. It was the other macro that I think came from kdelibs. I'll try your suggestions out. Thanks, Jeff -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) iEYEARECAAYFAkm6zeIACgkQANYdqNCuGCXpCQCfU7idlf+3J1nYrjzbLMnr3isi c7cAnjVcZaChUsHiCoJwKrahnBXNYP8N =M7hQ -END PGP SIGNATURE- ___ Kde-buildsystem mailing list Kde-buildsystem@kde.org https://mail.kde.org/mailman/listinfo/kde-buildsystem
Re: maco_optional_find_package magic
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Jeff Mitchell wrote: Alexander Neundorf wrote: On Friday 13 March 2009, Jeff Mitchell wrote: ... If you don't mind, here's a CMakeLists.txt and the corresponding FindTaglibExtras.cmake...can you see if you can spot why this might be happening? Thanks for all your help. Doing some message output made me figure out where the problem was coming from. The issue was mainly me not understanding the error I was seeing. I thought that the issue was that CMake wasn't finding a variable that it wanted to find in its module...but the problem was a big fat AND at the end of that statement: AND I was using those variables in other CMakeLists.txt files without appropriate _FOUND checks to guard it. (I had thought they would simply just default to an empty string and not cause a problem, but apparently this is not the case). Thanks again, Jeff -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) iEYEARECAAYFAkm61SgACgkQANYdqNCuGCWXxACg3hqfBf2tb/HVGicuTQXpcVb+ 9yIAn3BYlrpdlqqpoKtVc7o2ycXsBa5L =QqC3 -END PGP SIGNATURE- ___ Kde-buildsystem mailing list Kde-buildsystem@kde.org https://mail.kde.org/mailman/listinfo/kde-buildsystem
maco_optional_find_package magic
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Can someone clue me in as to how macro_optional_find_package manages to not have the configure abort (at the end) if the package isn't found? I thought it might be something in KDE4Defaults, but didn't find it in there either. I need to do a check before I add the KDE4 includes/find_package, so I can't use the macro (because I can't rely on KDE4 being installed)...but if I take the macro's code and paste it into my CMakeLists.txt, it doesn't behave the same (I'm not using REQUIRED). Thanks, Jeff -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkm5qwkACgkQANYdqNCuGCV/fACeJQvTzhE5VFZxdv8M/4BBKYmj wKUAnR4ZLwk9qdtxZZdNIMDcPGclOrZK =Ph4d -END PGP SIGNATURE- ___ Kde-buildsystem mailing list Kde-buildsystem@kde.org https://mail.kde.org/mailman/listinfo/kde-buildsystem