[CMake] Set output path without additional Debug/Release at the end
Dear CMake users, I would like to set the output path of my library to C:/name1/Debug/name2/ (debug configuration) and C:/name1/Release/name2/ (release configuration). If I use SET(LIBRARY_OUTPUT_PATH D:/name1/${CMAKE_CFG_INTDIR}/name2/) an additional Debug / Release is added at the end of the path (--> C:/name1/Debug/name2/Debug). Is there any way *not to add an additional* Debug / Release at the end? Thanks, Andreas ___ 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
Re: [CMake] How to link against a .dll with cmake?
On 25.07.10 00:57:14, John Drescher wrote: > > mingw can link using a .dll > > > > I do not have much mingw experience but I have around 15 of windows > and Visual Studio experience. With Visual Studio you absolutely do not > link your application with .dlls. You use import libs with a .lib > extension the same way you do with a static lib. This import lib is > not a static lib however its much smaller. During the application load > process .dlls linked using import libraries are automatically loaded. > This is not the only way to use .dlls you can use them also without > linking but there is much more work in that. Same goes for mingw, but it has a way of extracting the import library from a .dll, see http://www.stats.uwo.ca/faculty/murdoch/software/compilingDLLs/existingDLL.html Andreas -- You are fairminded, just and loving. ___ 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
Re: [CMake] [VS gen] Multiple configurations code
On 26.07.10 22:24:11, Olaf van der Spek wrote: > On Mon, Jul 26, 2010 at 10:12 PM, David Cole wrote: > >> Is there a problem with multiple configures / build trees? > > > > No, not at all. We do this all the time. But again, I thought from your > > questions that you were trying to do it all in one build tree. > > I'm not familiar with the term build tree. That seems to be your problem here. The so-called "source tree" is the project folder on your disk containing the actual source files and the CMakeLists.txt files. The build-tree on the other hand is the folder in which you run cmake to generate the build files (Makefiles or whatever). > Let's describe what I'd like: > I've got a single CMakeLists.txt for a lib named "xbt". I've got xbt.h > and xbt.cpp. I'm using VS (2010). > With a few simple commands, I should be able to build and package all > possible configurations of this lib. > In the ideal case, this would be cmake ., nmake ... or similar. The usual way with Makefiles is to: mkdir x64_release cd x64_release cmake .. nmake mkdir x64_debug cd x64_debug cmake .. nmake mkdir x86_debug cd x86_debug cmake .. nmake So the various build-tree's for the configurations are separate subdirs inside your source-tree (you can also put them completely outside of your source-tree). So there's only 1 set of source/cmake files, but multiple sets of makefiles/buildfiles. Andreas -- Someone whom you reject today, will reject you tomorrow. ___ 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
Re: [CMake] Does the echo command use the system shell?
On 29.07.10 08:37:36, Michael Wild wrote: > > On 29. Jul, 2010, at 6:37 , Óscar Fuentes wrote: > > > Michael Wild writes: > > > > [snip] > > > >> Perhaps you need to tell us what it is that you are trying to achieve, > >> because I suspect that you are over-thinking things and that there is > >> a much simpler solution. E.g. what should buildobj.h contain > >> (semantically, not the exact strings), and why is it only known at > >> build time? > > > > I "solved" this specific instance with configure_file. It is not as > > convenient as the original add_custom_command method but it works. > > > > What really concerns me is the general problem: a CMake command that > > acts on a platform-dependent way when the existence of those "-E" > > commands are motivated, precisely, for the cross-platform nature of > > CMake. Maybe I should file a bug report and see how it fares. > > The problem is, CMake has to go through the system shell. Of course, CMake > could write the command to a file and then invoke a custom interpreter from > the system shell, but that would probably be very inefficient and would > require CMake to implement a full shell language. And then CMake would be > required to decide which semantics to implement (probably POSIX) and then > Windows-only people would be angry... No it doesn't. CMake only needs to implement the commands it wants to support. Thats actually what happens right now already (see cmake.cxx), the commands for -E are all implemented in C++ code (including echo, copy and others) Andreas -- Good day to deal with people in high places; particularly lonely stewardesses. ___ 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
Re: [CMake] Does the echo command use the system shell?
On 28.07.10 19:19:08, Óscar Fuentes wrote: > For creating a file at build time with a content like this: > > #define foo "bar" > > I use this on Linux: > > add_custom_command(OUTPUT buildobj.h > COMMAND ${CMAKE_COMMAND} -E echo "\\#define foo \\\"bar\\\"" > > buildobj.h > ) > > but that doesn't work on Windows, because it outpus: > > \#define foo "bar" > > Removing the backslashes before `#' fixes the problem on Windows, but > then breaks the Linux build. > > This looks as if `echo' was using the system shell for doing the job, > because the escapes works differently on each system. Its not, see cmake.cxx line 1064, it simply prints out the string to stdout. So possibly the error is in add_custom_command, i.e. that one might require the platform-specific quoting. Andreas -- You display the wonderful traits of charm and courtesy. ___ 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
Re: [CMake] Does the echo command use the system shell?
On 29.07.10 09:15:51, Michael Wild wrote: > On 29. Jul, 2010, at 8:51 , Andreas Pakulat wrote: > > On 29.07.10 08:37:36, Michael Wild wrote: > >> > >> On 29. Jul, 2010, at 6:37 , Óscar Fuentes wrote: > >> > >>> Michael Wild writes: > >>> > >>> [snip] > >>> > >>>> Perhaps you need to tell us what it is that you are trying to achieve, > >>>> because I suspect that you are over-thinking things and that there is > >>>> a much simpler solution. E.g. what should buildobj.h contain > >>>> (semantically, not the exact strings), and why is it only known at > >>>> build time? > >>> > >>> I "solved" this specific instance with configure_file. It is not as > >>> convenient as the original add_custom_command method but it works. > >>> > >>> What really concerns me is the general problem: a CMake command that > >>> acts on a platform-dependent way when the existence of those "-E" > >>> commands are motivated, precisely, for the cross-platform nature of > >>> CMake. Maybe I should file a bug report and see how it fares. > >> > >> The problem is, CMake has to go through the system shell. Of course, CMake > >> could write the command to a file and then invoke a custom interpreter > >> from the system shell, but that would probably be very inefficient and > >> would require CMake to implement a full shell language. And then CMake > >> would be required to decide which semantics to implement (probably POSIX) > >> and then Windows-only people would be angry... > > > > No it doesn't. CMake only needs to implement the commands it wants to > > support. Thats actually what happens right now already (see cmake.cxx), > > the commands for -E are all implemented in C++ code (including echo, > > copy and others) > > But CMake only provides a useful, cross-platform, set of > "shell-commands", but it is not a shell replacement. The cmake command is > still invoked through the shell. With GNU Make, CMake could generate > Makefile's that contain "SHELL=$(CMAKE_COMMAND)" instructions, but I > don't think this is possible for Nmake, MSVC or Xcode. Are you saying that the generated buildsystem files do something like: $(SHELL) -c cmake -E Instead of having just cmake -E ... I'd expect the latter to not go through a shell, but being run directly as subprocess of the build tool. Andreas -- Don't feed the bats tonight. ___ 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
Re: [CMake] Does the echo command use the system shell?
On 28.07.10 19:19:08, Óscar Fuentes wrote: > For creating a file at build time with a content like this: > > #define foo "bar" > > I use this on Linux: > > add_custom_command(OUTPUT buildobj.h > COMMAND ${CMAKE_COMMAND} -E echo "\\#define foo \\\"bar\\\"" > > buildobj.h > ) > > but that doesn't work on Windows, because it outpus: > > \#define foo "bar" > > Removing the backslashes before `#' fixes the problem on Windows, but > then breaks the Linux build. Just tried your example here on Linux+Windows and your problem has nothing to do with the echo command not being cross-platform, its a simple matter of not escaping/quoting the command call as necessary. The following custom-command works on all platforms equally: add_custom_command( OUTPUT build.h COMMAND cmake -E echo \"\#define FOO 1\" >build.h ) You need to escape the # (with a single \) as its the comment-character in CMake files. Then you also need to quote the " once to make sure they are part of the actual command invocation. Now if you want to put a string literal into the mix it would be add_custom_command( OUTPUT build.h COMMAND cmake -E echo \"\#define FOO \\"bar\\"\" >build.h ) You can easily see your mistake by running (n)make VERBOSE=1 to see the actual cmake -E execution. Andreas -- Your analyst has you mixed up with another patient. Don't believe a thing he tells you. ___ 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
[CMake] Dependency bug in cmake with a custom-command
Hi, we're currently hitting what looks like a dependency problem with CMake and a custom-command. Unfortunately I couldn't reproduce this so far with a small example and it also only happens with one of the targets we're building in kdevplatform. This code was recently added, but looks the same as another plugin cmake-code and cpp-code wise. Ok, so here's the deal: We're using a KDE macro to run Qt's uic on our .ui files and add the generated header filename into a cmake variable. This cmake variable is then passed onto a add_library call (through another macro). Now when running make in a freshly created builddir using -j3 or so, the rule for generating the ui_xxx.h header is not executed before trying to compile the file that uses the header... I'm using CMake 2.8.2 here currently (or rather current HEAD of the release branch) This problem is only reproduceable after a make clean, once I hit the error and do another make -j3 run, the dependencies are proper and hence the generation is done. I've noticed that after the first failing run the depend.make and depend.internal files suddenly exist/have content. So it seems that cmake generates this info 'too late' and hence doesn't generate the ui-header early enough. Whats a bit strange though is that apparently in other plugins this stuff works. One more info: I'm seeing the 'Scanning dependencies of target kdevpatchreview' message a lot later than the error when using -k with make. And at that point I also see the 'Generating ui_xxx.h' message. Andreas -- Good news from afar can bring you a welcome visitor. ___ 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
Re: [CMake] Dependency bug in cmake with a custom-command
On 05.08.10 17:05:46, David Cole wrote: > On Thu, Aug 5, 2010 at 2:29 PM, Andreas Pakulat wrote: > > we're currently hitting what looks like a dependency problem with CMake > > and a custom-command. Unfortunately I couldn't reproduce this so far > > with a small example and it also only happens with one of the targets > > we're building in kdevplatform. This code was recently added, but looks > > the same as another plugin cmake-code and cpp-code wise. > > > > Ok, so here's the deal: We're using a KDE macro to run Qt's uic on our > > .ui files and add the generated header filename into a cmake variable. > > This cmake variable is then passed onto a add_library call (through > > another macro). Now when running make in a freshly created builddir > > using -j3 or so, the rule for generating the ui_xxx.h header is not > > executed before trying to compile the file that uses the header... > > > > I'm using CMake 2.8.2 here currently (or rather current HEAD of the > > release branch) > > > > This problem is only reproduceable after a make clean, once I hit the > > error and do another make -j3 run, the dependencies are proper and hence > > the generation is done. > > > > I've noticed that after the first failing run the depend.make and > > depend.internal files suddenly exist/have content. So it seems that > > cmake generates this info 'too late' and hence doesn't generate the > > ui-header early enough. Whats a bit strange though is that apparently in > > other plugins this stuff works. > > > > One more info: I'm seeing the 'Scanning dependencies of target > > kdevpatchreview' message a lot later than the error when using -k with > > make. And at that point I also see the 'Generating ui_xxx.h' message. > > So, you say it "looks the same" as other plugins that do not demonstrate the > problem... but there must be some differences. > > What are the differences? Sure, this is the plugin that breaks: http://gitorious.org/kdevelop/kdevplatform/blobs/master/plugins/reviewboard/CMakeLists.txt These two seem to work fine (but that might also just be by accident because they happen to be compiled 'later' and hence their dependency scanning was done already): http://gitorious.org/kdevelop/kdevplatform/blobs/master/plugins/projectmanagerview/CMakeLists.txt http://gitorious.org/kdevelop/kdevplatform/blobs/master/plugins/subversion/CMakeLists.txt > There are lots of folks doing Qt stuff with CMake, and I do not recall > hearing of anything like this recently. I'd think it should work, so there > must be some small difference in your CMakeLists.txt file (or something it > includes) that is triggering this issue. The plugins are all on the same 'level', adding CMAKE_CURRENT_BINARY_DIR to the include_directories didn't help. > Let us know more details... easier to help when looking at code or cmake > output. I'm attaching the make-log, verbose version would probably need uploading somewhere (let me know if you'd like to see that). As I said, if I run make with -k I later on see the dependency-scanning for the kdevreviewboard target and immediately afterwards the generation of the ui_reviewpatch.h file. Andreas -- Fine day to work off excess energy. Steal something heavy. log.gz Description: Binary data ___ 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
Re: [CMake] Dependency bug in cmake with a custom-command
On 10.08.10 09:04:34, Brad King wrote: > On 08/05/2010 05:33 PM, Andreas Pakulat wrote: > > Sure, this is the plugin that breaks: > > http://gitorious.org/kdevelop/kdevplatform/blobs/master/plugins/reviewboard/CMakeLists.txt > > Do you have KDE4_ENABLE_FINAL enabled? No. Just running cmake ../ without further options. Andreas -- Your reasoning is excellent -- it's only your basic assumptions that are wrong. ___ 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
Re: [CMake] Dependency bug in cmake with a custom-command
On 11.08.10 16:07:21, Brad King wrote: > On 08/05/2010 02:29 PM, Andreas Pakulat wrote: > > One more info: I'm seeing the 'Scanning dependencies of target > > kdevpatchreview' message a lot later than the error when using -k with > > make. And at that point I also see the 'Generating ui_xxx.h' message. > [snip] > On 08/11/2010 03:46 PM, Andreas Pakulat wrote: > > On 11.08.10 11:08:22, Brad King wrote: > >> Please send me (off list) the whole CMakeFiles directory > > > > Here you go, I did: > > > > cmake -DCMAKE_INSTALL_PREFIX=$HOME/kdevelop-split ../ > > > > make -j3, waited for it to fail due to not-generated ui-header > > > > make, wait until completely done > > > > Even after the first run, build.make contains this: > > plugins/reviewboard/ui_reviewpatch.h: ../plugins/reviewboard/reviewpatch.ui > ... rule to run uic ... > > plugins/reviewboard/CMakeFiles/kdevreviewboard.dir/depend: > plugins/reviewboard/ui_reviewpatch.h > ... rule to scan dependencies of kdevreviewboard ... > > This is what causes the header to be generated before dependencies > are scanned (as you observed in the quote above). I do not think > anything in the kdereviewboard target can compile before the above > steps run. > > What source file is it compiling when it fails to find the header? reviewpatchdialog.cpp which has #include "ui_reviewpatch.h" > In what target is its object file? kdevreviewboard is the target with the .cpp: set(kdevreviewboard_PART_SRCS reviewboardplugin.cpp reviewpatchdialog.cpp reviewboardjobs.cpp ) kde4_add_ui_files(kdevreviewboard_PART_SRCS reviewpatch.ui) kde4_add_plugin(kdevreviewboard ${kdevreviewboard_PART_SRCS}) Andreas -- Your step will soil many countries. ___ 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
Re: [CMake] Dependency bug in cmake with a custom-command
On 13.08.10 14:09:21, Brad King wrote: > On 08/11/2010 07:04 PM, Andreas Pakulat wrote: > > On 11.08.10 16:07:21, Brad King wrote: > >> This is what causes the header to be generated before dependencies > >> are scanned (as you observed in the quote above). I do not think > >> anything in the kdereviewboard target can compile before the above > >> steps run. > >> > >> What source file is it compiling when it fails to find the header? > > > > reviewpatchdialog.cpp which has #include "ui_reviewpatch.h" > > > >> In what target is its object file? > > > > kdevreviewboard is the target with the .cpp: > > I'd like to try to reproduce this. What projects do I need to clone? Just this: git://gitorious.org/kdevelop/kdevplatform.git Andreas -- You are dishonest, but never to the point of hurting a friend. ___ 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
Re: [CMake] Doesn't "make -k" work with CMake?
On 16.08.10 14:06:21, Johan Holmberg wrote: > I have been working on porting some applications built with CMake, and > initially I get a lot of compile errors. Maybe you should fix them? Usually compile-errors that occur on the first make call, but not subsequent ones are indications for lack of dependencies between certain files/targets. > I work on Linux and have been using the Makefile:s generated by CMake to > build, using "make -k" at the top build directory. > > I assumed the the "-k" flag would take care of building "as much as > possible" globally in my whole build tree. It does, but a file can only be compiled when all its dependencies are being fulfilled. Which might not be the case for you, e.g. if app A depends on lib B, the generated Makefile's won't be starting to compile A before B is completely build. > And can I get the same effect as "make -k" in some other way? You are getting the effect of make -k, its just that make won't build anything whose dependencies are not built/fulfilled yet. > I have now switched to trying to use "make -i", but as far as I > understand it does *too much*, e.g. trying to link a program where > some object files failed (maybe I can live with that ...). Instead of trying to workaround you should be fixing the reasons for the initial compile errors. Then there's no reason to worry about wether -i works by accident or not. Andreas -- Exercise caution in your daily affairs. ___ 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
Re: [CMake] Dependency bug in cmake with a custom-command
On 17.08.10 14:53:02, Brad King wrote: > On 08/11/2010 07:04 PM, Andreas Pakulat wrote: > > On 11.08.10 16:07:21, Brad King wrote: > >> What source file is it compiling when it fails to find the header? > > > > reviewpatchdialog.cpp which has #include "ui_reviewpatch.h" > > > >> In what target is its object file? > > > > kdevreviewboard is the target with the .cpp: > > I reproduced the problem. It is *not* kdevreviewboard that is > building when the problem occurs, it is reviewboardtest, which > also includes that c++ source file: Oh, seems my cmake-debug-skills need some upgrading :) I didn't spot that, thanks for spending your time. > The source file is being compiled in a target that does not > wait for the header to be generated before compiling. We can > add a dependency on the target the does provide the header. > The patch below fixes the problem. Instead I've added the kde4_add_ui_files to the test-target too, so it doesn't need a dependency onto the plugin target (somehow I don't like that, can't explain rationally why though). Andreas -- Another good night not to sleep in a eucalyptus tree. ___ 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
Re: [CMake] Dependency bug in cmake with a custom-command
On 19.08.10 09:26:26, Brad King wrote: > On 08/18/2010 01:01 AM, Andreas Pakulat wrote: > > On 17.08.10 14:53:02, Brad King wrote: > >> The source file is being compiled in a target that does not > >> wait for the header to be generated before compiling. We can > >> add a dependency on the target the does provide the header. > > > > Instead I've added the kde4_add_ui_files to the test-target too, so it > > doesn't need a dependency onto the plugin target (somehow I don't like > > that, can't explain rationally why though). > > This may cause the ui files to be generated twice, possibly conflicting > if the rules happen to run in parallel. If they have different output > directories then that is okay. If they are going to the same place it > will be a problem. They have different output directories. In the case of the same output dirs that will definetly produce problems (though not for 'everybody' as it seems), we had that with another kdevelop plugin which runs a parser-generator and there where two targets (one custom-target one normal) that both depended onto the generated files. This produced build-erros when running make -j, but not for everybody and not reliably... Andreas -- You will have a long and boring life. ___ 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
[CMake] link-interface-libs not empty (or auto-filled)
Hi, I've got a small problem here, I'm building an installing a static library which links (among other things) against QtCore. I'm also using the cmake install(TARGETS .. EXPORT) stuff to export a Target.cmake file with the library as imported target. Last but not least this lib has some deps in its public API and hence I'm using LINK_INTERFACE_LIBRARIES to add those. Unfortunately for some reason QtCore is also added which I'd like to avoid (as it creates a dependency upon an absolute path to Qt in the installed stuff). I've already tried setting the target property to "", but its still added automatically by cmake. Anybody knows of something in cmake that would explain this? Andreas -- You should emulate your heros, but don't carry it too far. Especially if they are dead. ___ 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
Re: [CMake] makefile to CMakeLists.txt, possible?
On 02.09.10 17:02:02, Diablo 666 wrote: > > > I think what Andreas meant is that he expects IDE's to use CMake > > as their native build system and auto-generate the CMake code. > > Exactly. AFAIK KDevelop 4 is actually building cmake files. It doesn't, it tries to help you write them and even suggests changes when you create classes or rename files. But it doesn't generate them from ground up or completely manages them in some GUI. > But I didn't see a working version of it, yet :( http://download.kde.org/download.php?url=stable/kdevelop/4.0.2/src/ In a day or to (until then replace 4.0.2 with 4.0.1). Andreas -- You will be awarded some great honor. ___ 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
[CMake] User-accessible hook on internal cmake_check_build_system target?
Hello all, as part of http://vcproj2cmake.sf.net , I've got some "rebuilder" targets registered which - upon starting a build - automatically re-run vcproj2cmake on the .vcproj files in case they got updated and thus need to have a new conversion run to CMakeLists.txt files. Problem is: a) the rebuilder targets aren't specifically the first targets to be executed b) how to abort ongoing Makefile build execution since we know we just re-converted things into new CMakeLists.txt files and shouldn't continue with old content? a) there's the CMake-internal(?) cmake_check_build_system target which gets executed right at "all" target, since it needs to launch a new configure run in case CMakeLists.txt files changed since last make run. I'd like to have a hook target to make sure that a "rebuilder" target happens right at the very beginning of a non-target make execution (or, perhaps I'd want it so that nothing _else_ gets executed before the rebuilder target has finished execution). ((ok, I could perhaps just make all my vcproj2cmake-registered project targets depend on their specific rebuilder target)) add_dependencies(all cmakelists_PROJECT_rebuilder) (or probably better using the ALL keyword during cmakelists_PROJECT_rebuilder creation) perhaps doesn't fully cut it. b) how to actively (and "successfully") fail-abort after successful conversion of .vcproj hierarchy to CMakeLists.txt files, to make sure that CMake won't continue executing the current (i.e., old) iteration? Or, even better, would it be possible to have a way to tell CMake to re-start everything right in this live CMake instance? (likely not since this probably is a generator-dependent issue, not under control of CMake itself) Or well, ideally there would be a way to have a nice clean chain between starting CMake execution, realizing that vcproj2cmake needs to process an update, _then_ realizing that CMakeLists.txt changed and starting a configure run, and then continuing with make execution. IOW, I simply need to find a way to have my vcproj2cmake rebuild step cleanly registered _right before_ the cmake_check_build_system step. Any clever ideas? Currently using 2.6.4 mostly, but that's certainly not a limiting issue. Thanks, Andreas Mohr ___ 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
Re: [CMake] creation of cxx in QT4 gui
On 14.09.10 09:37:29, e...@cs.bgu.ac.il wrote: > > hello. > I have a question, I'm assuming that QT4_WRAP_CPP is creating the cxx files, > on a project of mine, I have 3 classes, two of them have a ui file, all > headers are in GUI_HPP list, when I print the content of the variable, I see > the two headers that have a ui file, when I run it via QT4_WRAP_CPP I get 3 > cxx files for the one class that doesn't have a ui file. > afaiu, that file doesn't need a cxx file, my question is, why is that > happening? how can I solve it? Check the cmake documentation, QT4_WRAP_CPP is not for .ui files, its for generating moc code which is necessary for any file having a QObject derived class. Generating the code from .ui files is done with QT4_WRAP_UI and generates only a .h file. Also that generated header doesn't need to be moc'ed as it has no QObject class in it. Andreas -- You will give someone a piece of your mind, which you can ill afford. ___ 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
Re: [CMake] add_dependency on a custom target
On 15.09.10 12:34:43, Nick Davidson wrote: > Dear List, > > I'm using a file glob to extract a list of xml files to pass to a custom > target to generate > a pot file with getttext, most of the heavy lifting is handled by a > Macro. > > include(FindMsgfmt) > macro (MakePot BIN_NAME CPP_SOURCES XML_SOURCES) > set(CPP_SRCS ${CPP_SOURCES}) > set(XML_SRCS ${XML_SOURCES}) > set(POT_FILE ${BIN_NAME}.pot) > if (XGETTEXT_FOUND) > message(STATUS "Adding Target Potfile: ${POT_FILE}") > if (XML_SRCS) > add_custom_target(${POT_FILE} ALL > COMMAND ${XGETTEXT_EXECUTABLE} --language=C++ --force-po > -kN_ -kNN_:1,2 -o > ${POT_FILE} ${CPP_SRCS} > COMMAND ${XGETTEXT_EXECUTABLE} --language=Glade --force-po > -j -o > ${POT_FILE} ${XML_SRCS} ) > else (XML_SRCS) add_custom_target(${POT_FILE} ALL > COMMAND ${XGETTEXT_EXECUTABLE} --language=C++ --force-po > -kN_ -kNN_:1,2 -o > ${POT_FILE} ${CPP_SRCS}) > endif(XML_SRCS) > add_dependencies(${POT_FILE} ${XML_SOURCES} ${CPP_SRCS}) > else (XGETTEXT_FOUND) > message(STATUS "Cannot find xgettext") > endif(XGETTEXT_FOUND) > endmacro (MakePot POT_NAME) > > The only problem is, if the list of xml files changes (e.g. a deletion) > the cmake > cache doesn't get regenerated and thus the xml files are not reglobbed > and so the > custom command fails. > > Any suggestions? Don't use a glob (list the files individually) or remember to touch the cmakelists.txt file after adding new files. I don't think there's a way to have cmake re-run when calling just make within cmakelists.txt. Andreas -- You will be imprisoned for contributing your time and skill to a bank robbery. ___ 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
Re: [CMake] add_custom_target dependency list issue
On 26.09.10 21:31:20, Szilárd Páll wrote: > I figured out something that makes me even more puzzled. The following > does _not_ work as expected:: > > set(DEPS "dep1 dep2 dep3") > add_dependencies(foo bar > ${DEPS}) > > Target "foo" gets only dependent on bar and not dep1,2,3. On the other > hand, manually listing the latter instead of using the DEPS variable > works as well as adding them one-by-one in a loop (where also a > variables is used). > > This seems to be _extremely_counterintuitive! Is there some sort of > CMake black-magic or basic rule that I don't know of? No black magic, just cmake's rules about variable contents. Basically CMake has only 1 type of variable value, thats a string. What you created above is a string variable "DEPS" with the value "dep1 dep2 dep3", i.e. a single string consisting of 3 words separated by spaces. Some strings are considered to be a list if you use a cmake command that expects a list, these strings need to separate each list entry with a semicolon.If you use set(DEPS dep1 dep2 dep3) then CMake will create DEPS as a string containing a list with those 3 words. What should also work is set(DEPS "dep1;dep2;dep3") as that should create a list in the variable DEPS. The CMake Manual under the set() command also explains this. Andreas -- Your motives for doing whatever good deed you may have in mind will be misinterpreted by somebody. ___ 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
Re: [CMake] Fwd: Removing overkill linking
es, which is useful, of course, when > > you want to know which libraries are needed. However, 'ldd' gives you a > > false impression w.r.t. overlinking. > > > > Hi Marcel. > > Thanks for the reply. I was relying on dpkg-shlibs which was throwing > the warnings about unnecessary linking. I've just gone back now and > checked the binary with readelf -d, and this too is showing the links > to unneeded libraries. > > I have tried a number of different configurations, but I just cant > find examples of how to correctly use LINK_INTERFACE_LIBRARIES with an > executable - rather than a library. Here is my most recent attempt: > > http://pastebin.com/JdVPvYim > > = > [...] > # > # Include & build > # > include_directories (. ${DBUS_INCLUDE_DIRS} > ${DBUS-GLIB_INCLUDE_DIRS} ${GLADE_INCLUDE_DIRS} ${GTK2_INCLUDE_DIRS} > ${HAL_INCLUDE_DIRS}) > add_executable(galinette callbacks.c callbacks.h > galinette-gtk.c galinette_gtk.glade galinette-gtk.h hal.c hal.h > main.c) > add_dependencies (galinette libgalinette) > target_link_libraries (galinette LINK_INTERFACE_LIBRARIES libgalinette > ${DBUS_LIBRARIES} ${DBUS-GLIB_LIBRARIES} ${GLADE_LIBRARIES} > ${GTK2_LIBRARIES} ${HAL_LIBRARIES}) > [...] > ===== > > But this just seems to lose all the linking altogether. > > I cant seem to find any projects that use LINK_INTERFACE_LIBRARIES to > control linking with regard to "executables" rather than libraries. Thats because a link-interface for an executable doesn't make the slightest sense. The link-interface in cmake for a library target foo, defines which libraries should automatically get into the linker-call when linking some other target against foo. As one doesn't (except in very very rare cases) link against executable, there's no point in defining a link-interface. To reduce excessive linking for libraries, you need to set the target-property "LINK_INTERFACE_LIBRARIES" to an empty string and afterwards use target-link-libraries( foo LINK_INTERFACE_LIBRARIES ) with those libs which are present in the public API of foo. Of course all this only works as long as you're inside a cmake project or if using imported cmake targets. Otherwise you have to rely on the responsive FindXYZ.cmake files not adding additional, unnecessary libs to the linker line (or whatever the find-module uses, like pkg-config files). Andreas -- You will live to see your grandchildren. ___ 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
Re: [CMake] how to get cmake and custom qt widget to work?
On 05.10.10 20:59:27, e...@cs.bgu.ac.il wrote: > > hello. > I have a cmake+qt4 project, I needed to extend a certain gui item to suit my > needs, I've been able to insert it into qtcreator and incorporate it into the > project's gui, now when I run compilation, I get this: > /home/dagg/workspace/OSSM/src/GUI/ui_TrainingActivityManager.h:29:28: error: > qstringspinbox.h: No such file or directory > > the relevant part of > /home/dagg/workspace/OSSM/src/GUI/ui_TrainingActivityManager.h is this: This file is generated by uic from TrainingActivityManager.ui. If you've used qstringspinbox.hpp, then you need to put that into the .ui file, so that uic picks it up and generates the right header code. Or you rename your header file to .h. How you tell uic to generate an include with .hpp depends on wether this is a designer plugin or just using the promoting-feature in Qt designer. The Qt docs will have details on how to set the proper header filename. Also make sure that the directory containing the header is in the list of include-dirs by using include_directories() in cmake. Andreas -- Cheer Up! Things are getting worse at a slower rate. ___ 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
Re: [CMake] What does find_package(COMPONENTS) do? and
On 06.10.10 22:47:15, Stephen Kelly wrote: > Hi, > > The documentation says > > > A package-specific list of components may be listed after the REQUIRED > > option or after the COMPONENTS option if no REQUIRED option is given. > > http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:find_package > > But it doesn't say why you would want to do that. At first I thought it was > to specify that only the components specified would be used to fill cmake > variables. However, find_package(Qt COMPONENTS QtCore) also results in > ${QT_QTGUI_LIBRARY} being defined for example. So then I thought maybe the > semantic is that if one of the components can not be found, the find_package > fails. So I tried find_package(Qt REQUIRED QtCore QtDoesNotExist) which > works without error. > > What am I missing? > > The reason I ask is that I finally figured out why the tests in my library > needed to be linked to QtGui, even though it only uses QtCore. > > The reason is that find_package(Qt) causes QT_GUI_LIB to be defined. Which > in turn causes QTEST_MAIN to be defined to expand to use QApplication > instead of QCoreApplication as it is if QT_GUI_LIB is not defined. > > http://qt.gitorious.org/qt/qt/blobs/4.7/src/testlib/qtest.h > > find_package(Qt REQUIRED QtCore QtScript) does not cause QT_GUI_LIB to be > defined. However, some of my targets do need QtGui, so I should specify it, > right? > > So if I do specify it I'll end up having QT_GUI_LIB defined when building my > unit tests. I could remove_definitions(-DQT_GUI_LIB), but apart from being a > BadHack(tm), it causes my unit tests which *do* require QtGui to fail at > runtime because they create QWidgets and by undeffing QT_GUI_LIB I build > them to use QCoreApplication instead of QApplication (Not allowed in Qt), so > the tests fail at runtime. > > http://gitorious.org/grantlee/grantlee/blobs/0.1/tests/CMakeLists.txt > > Is there a solution to all this? What is the point of COMPONENTS if it has > no effect on what I can include or link to? Is it possible to link some of > my tests to QtGui but not all of them and still have them all pass? Do I > need to just link my core tests to QtGui and use QApplication and quit my > complaining? > > The only way I can see to satisfy all requirements is attached. Is that > acceptable or is there a better way? You could just use 2 find_package calls in two different subdirs. One for the case of core-libs+core-tests and the other has gui-libs+gui-tests. Unless I misunderstood something... Andreas -- Excellent day for putting Slinkies on an escalator. ___ 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
Re: [CMake] Is there a tool pretty much like cmake for Java?
On Sunday 22 August 2010 22:11:28 Alexander Neundorf wrote: > CMake "supports" Java, but that support is ... needs some work, there are > some issues (I think this had to do with the location of the compiled > files and the java packages or something). > I assume patches to improve the situation would be accepted :-) Hi, I'm currently helping a project written in Java and C to improve the build system. I've already improved the Java .cmake files and got some stuff compiling. As soon as more of the projects builds and the file are in a state to be used by other I will post them. My current problem is with javah (C header file generator). This generator works on the class files. The class files aren't in CMAKE_CURRENT_BINARY_DIR they are located in: ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/.dir///foobar.class So my current problem is how to point the generator there ... > Alex Cheers, -- andreas ___ 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
Re: [CMake] Is there a tool pretty much like cmake for Java?
On Thursday 07 October 2010 16:45:49 Andreas Schneider wrote: > My current problem is with javah (C header file generator). This generator > works on the class files. The class files aren't in > CMAKE_CURRENT_BINARY_DIR they are located in: > > ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/.dir///foo > bar.class > > So my current problem is how to point the generator there ... In the language information file, this is so is there something like CMAKE_CURRENT_OBJECT_DIR? -- andreas ___ 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
Re: [CMake] Is there a tool pretty much like cmake for Java?
On Thursday 07 October 2010 18:57:50 Bill Hoffman wrote: > The java support was broken a while ago when we re-organized the build > trees. I don't have much time to work on this, but I would like to get > it fixed. The best approach might be a pure custom command approach. Hi Bill, with some modifications, the Java support works just fine. I just have some minor issues which I need to address. > We could model it after the scons java support which is quite simple. I > am thinking of adding a module for java building into the Modules > directory as java does not really fit our language type that well. First I tought about doing that, but getting it to work in CMake made more sense do me. I is especally easier to work with CMake functions cause auf the dependencies then doing everything with Modules which provide functions for the Java language. Here are my modifications to the Java files: http://git.cynapses.org/users/asn/pki.git/tree/cmake/Modules?h=cmake This is still work in progress but it works just fine atm. The only thing is that is is ugly to get the OBJECT_DIR :) > -Bill -- andreas ___ 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
Re: [CMake] Is there a tool pretty much like cmake for Java?
On Thursday 07 October 2010 21:32:51 Bill Hoffman wrote: > The other issue is VS builds. At one point, I had some magic, cmake > language to custom command converter thing going for this, but I am > thinking it might be broken. If we did a pure custom-command version, > it would work in the IDE's (Xcode and VS) with no problem. Right now, > your stuff will likely only work with makefiles. I see your point. So you want a UseJava.cmake file which provides functions like: add_jar add_jni_headers I think if you do it like that you will loose some nice features like add_definitions include_directories Or is it possible to use them? If you can guide me a bit I would implement it. At the moment it looks much harder to use functions with custom commands to me. -- andreas ___ 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
Re: [CMake] Is there a tool pretty much like cmake for Java?
On Thursday 07 October 2010 21:32:51 Bill Hoffman wrote: > The other issue is VS builds. At one point, I had some magic, cmake > language to custom command converter thing going for this, but I am > thinking it might be broken. If we did a pure custom-command version, > it would work in the IDE's (Xcode and VS) with no problem. Right now, > your stuff will likely only work with makefiles. > > -Bill I hit several problems using a custom command version. a) add_jar(osutil_java ${osutil_java_SRCS}) set_target_properties(osutil_java PROPERTIES OUTPUT_NAME osutil) doesn't work for me. get_target_property(FOO osutil_java OUTPUT_NAME) is empty. b) I can't use osutil_java in another CMakeLists.txt as a dependency. Here is my function add_jar() http://git.cynapses.org/users/asn/pki.git/tree/cmake/Modules/UseJava.cmake?h=cmake -- andreas ___ 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
Re: [CMake] how to define current working directory of command line tool
On 10.10.10 21:41:05, Jochen Wilhelmy wrote: > >>Hi! > >> > >>Is it possible to define the current working directory of a command line > >>tool > >>that is built with cmake? since the build is usually out-of-source I have > >>to set the current working directory in the ide, e.g visual studio or > >>xcode. more convenient would be to set it in cmake. > > > >Do you mean in add_custom_command()/add_custom_target() ? > >Both have an optional WORKING_DIRECTORY argument. > no, i mean add_executable. when I build and start the directory I'd > like to set the > working directory that the executable is started in. add_executable doesn't run any executable, hence setting a working-dir doesn't make any sense. What exactly are you trying to achieve? Andreas -- Be careful! Is it classified? ___ 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
Re: [CMake] how to define current working directory of command line tool
On 11.10.10 10:07:58, Jochen Wilhelmy wrote: > Hi! > >>>>Is it possible to define the current working directory of a command line > >>>>tool > >>>>that is built with cmake? since the build is usually out-of-source I have > >>>>to set the current working directory in the ide, e.g visual studio or > >>>>xcode. more convenient would be to set it in cmake. > >>>> > >>>Do you mean in add_custom_command()/add_custom_target() ? > >>>Both have an optional WORKING_DIRECTORY argument. > >>> > >>no, i mean add_executable. when I build and start the directory I'd like to > >>set the > >>working directory that the executable is started in. > >> > >>-Jochen > >I think that you have a misconception with respect to the concept of > >"working directory". > > > >In a Unix-style environment, the "working directory" is determined by the > >"shell" command line interpreter. The actual value is determined only at > >execution-time. It is not something "built-in" to the executable. > No, I mean this very unix-style working directory. Of course this is > only a debug setting, i.e. it does not influence the > build result. But if I write a command line tool, e.g. a copy, then > I have some test files to copy and need some arguments > for the copy tool to tell it which files to copy. Therefore it is > possible to set the working directory and command line > arguments in an ide (visual studio or xcode). For xcode there is > even the effect that after cmake runs the current > setting is lost which is not the case for visual studio since these > settings are stored in a separate file. CMake is not concerned with running your apps, its only concerned with building the code (or rather generating something which can build the code). So no, there's no way of setting a working-dir for the targets you build. Andreas -- Day of inquiry. You will be subpoenaed. ___ 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
Re: [CMake] Is there a tool pretty much like cmake for Java?
On Friday 15 October 2010 23:13:41 Michał Czuczman wrote: > I use CMake for building a multi-platform multi-language project where > for most parts it fits very well. However, one part of the project is > written in Java, with some native implementations. So it would be great > to have a nice Java support in CMake. Using another build system just > for that part adds one to many build-time dependency. > > The pitfalls I've encountered in CMake Java support were: > > * All objects are always rebuilt. > * The generated JAR file is polluted with build system CMake files. > > This is why I would like to contribute to the great CMake project and > have a nice simple Java support. Hi, this is my current implementation of Java support. It allows you to compile java files and add resources to it. http://git.cynapses.org/users/asn/pki.git/tree/cmake/Modules/UseJava.cmake?h=cmake set(java_SRCS wurst.java brot.java wurstbrot.properties ) set(CMAKE_JAVA_INCLUDE_PATH gurke.jar) add_jar(wurstbrot ${java_SRCS}) Cheers, -- andreas ___ 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
Re: [CMake] Is there a tool pretty much like cmake for Java?
On Friday 15 October 2010 23:13:41 Michał Czuczman wrote: > I use CMake for building a multi-platform multi-language project where > for most parts it fits very well. However, one part of the project is > written in Java, with some native implementations. So it would be great > to have a nice Java support in CMake. Using another build system just > for that part adds one to many build-time dependency. > > The pitfalls I've encountered in CMake Java support were: > > * All objects are always rebuilt. The target is always considered as outdated, I don't know how to change this. > * The generated JAR file is polluted with build system CMake files. > I think I have an idea how to fix this. I will implement it. > This is why I would like to contribute to the great CMake project and > have a nice simple Java support. Cheers, -- andreas ___ 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
Re: [CMake] Is there a tool pretty much like cmake for Java?
On Saturday 16 October 2010 12:13:02 Andreas Schneider wrote: > On Friday 15 October 2010 23:13:41 Michał Czuczman wrote: > > I use CMake for building a multi-platform multi-language project where > > for most parts it fits very well. However, one part of the project is > > written in Java, with some native implementations. So it would be great > > to have a nice Java support in CMake. Using another build system just > > for that part adds one to many build-time dependency. > > > > The pitfalls I've encountered in CMake Java support were: > > * All objects are always rebuilt. > > The target is always considered as outdated, I don't know how to change > this. > > > * The generated JAR file is polluted with build system CMake files. > > I think I have an idea how to fix this. I will implement it. > Done, you need these two files: http://git.cynapses.org/users/asn/pki.git/tree/cmake/Modules/UseJava.cmake?h=cmake http://git.cynapses.org/users/asn/pki.git/tree/cmake/Modules/JavaClassFilelist.cmake?h=cmake Cheers, -- andreas ___ 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
Re: [CMake] FIND_PATH+FIND_LIBRARY+CMAKE_INCLUDE_PATH usage...
On 18.10.10 14:29:04, JIA Pei wrote: > Sorry for my entry level question: > > I understand to thoroughly grasp how CMake is working, I need to buy > "Mastering CMake". > However, is there any free CMake documentation on the Internet for us to > learn? Sure: www.cmake.org -> Help, there's the Documentation which pretty thoroughly discusses all commands and most variables and shipped modules. The FAQ and Wiki contain some extra information. On *nix systems you can just do "man cmake" to open the cmake documentation. > By the way, how to use FIND_PATH and FIND_LIBRARY together > with CMAKE_INCLUDE_PATH? What exactly are you trying to do? Andreas -- Are you sure the back door is locked? ___ 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
Re: [CMake] Inconsistent lib dependancie/name for libnames with dots
On 23.10.10 14:01:04, Bastian Moldenhauer wrote: > I think I found a bug in cmake, but since I am a bloody beginner with cmake > don't hit me when I am wrong. Either you're wrong or your posted sample is :) > If I add a library using add_library(.) and the name of the lib contains a > dot cmake will produce some wrong dependencies or use a wrong lib output > name. > > How to reproduce: > > 1. Create a folder "b" > > 2. Put a file "b.c" in "b" > > 3. Create a cmakelist with this content in "b" > > FILE(GLOB src "*.c") > > ADD_LIBRARY(b ${src}) Note that this line above creates a target called 'b' which will build a library called "b.lib". > 4. Create a folder "e" > > 5. Put a file "e.c" in "e" > > 6. Create a cmakelist with this content in "e" > > FILE(GLOB src "*.c") > > ADD_EXECUTABLE(e ${src}) > > TARGET_LINK_LIBRARIES(e b.b) This tries to link the target e against a target named 'b.b'. But this target doesn't exist. Hence cmake assumes this is the name of a library provided outside of the project and append ".lib" to it. > 7. In the parentfolder of "e" and "b" place a cmaklist with this > content > > cmake_minimum_required(VERSION 2.8) > > project(Prj) > > add_subdirectory(b) > > add_subdirectory(e) > > > > Result: > > If you do the above and let cmake create the project files (vs2010 and > vs2008 in my case) cmake will create a solution that want work. The reason > is pretty simple. The executable will be dependent on a lib called b.b.lib > which is correct. But the lib will never be created because project b.b will > create a lib which is named "b.lib". If you want to create a library called 'b.b' you should pass that as target name to add_library. At least on unix this creates a correct dependency. Andreas -- You will be audited by the Internal Revenue Service. ___ 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
Re: [CMake] Inconsistent lib dependancie/name for libnames with dots
On 23.10.10 16:45:16, Bastian Moldenhauer wrote: > >On 23.10.10 14:01:04, Bastian Moldenhauer wrote: > >> ADD_LIBRARY(b ${src}) > > >Note that this line above creates a target called 'b' which will build a > library called "b.lib". > > I undersand that. Just use this line instead: > ADD_LIBRARY(b.b ${src}) I actually did already do that and as I said it works with Unix makefiles here. I don't have a way to verify with a VS generator currently, but if the deps are not setup properly there that does sound like something you should file in cmake's bugtracker. Andreas -- Your own qualities will help prevent your advancement in the world. ___ 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
Re: [CMake] Converting a large C++-Project to CMake
Hi, On Sat, Oct 30, 2010 at 12:00:03PM -0400, cmake-requ...@cmake.org wrote: > Message: 1 > Date: Sat, 30 Oct 2010 13:54:23 +0200 > From: Benjamin King > Subject: [CMake] Converting a large C++-Project to CMake > To: cmake@cmake.org > Message-ID: <4ccc076f.6040...@web.de> > Content-Type: text/plain; charset=ISO-8859-15; format=flowed > > Hello, > > I'm working on a ~1.5Mio LOC C++ project and our buildsystem is a "me too" ;) > hodgepodge of handcrafted Makefiles, shell scripts and qmake projects. > I tried to convert a subset to CMake and it looks very promising so far. > > One important part of our development workflow is this: > 1) User 'nightly' builds versions of the project every night on several > development servers. > 2) A developer is coming to the office in the morning, and > copies/hardlinks the nightly build to his home dir and probably patches > uncommited changes from yesterday into the newly copied build. > > Our build is taking ages (almost a three hours on the fastest of our > servers) and it would be really painful if everybody needed to rebuild > everything for himself in the morning. 3 hours sounds quite excessively long. On a bog-standard workstation (i.e., definitely _not_ "on the fastest of our servers"), a (single-core) build here takes around 2 hours, however a (partial) Linux CMake build is finished within 25(!) minutes (make -j3) on a Core 2 Duo. And this with some projects thrown in to the mix (of around 40 projects total) that are _heavily_ templated i.e. rather more painful to build. > According to the FAQ, CMake does not support copying build trees around. Yep, and I'd think that that's a pretty hard condition. One really shouldn't try to bend things to work with specific build tree data on multiple machines I'd think. That's just not the way that CMake is supposed to be used. I'd much rather suggest cutting down on rogue include file overhead (check gcc -E to analyze amount to process on each file, and to see which file gets included most often and/or in the most painful way). This is a suitable way to decrease build pains in the case of possibly more "chaotic" build trees (I once managed to get it down from almost 3 hours to around 1:25 or so). If however this doesn't cut it for you (i.e., tree size is a wee bit too large for this to be feasible within office times), then you should probably find a way to split sub projects into proper, cleanly interfaced, external projects to be used for one large build project as needed. I.e., keep most parts as external dependencies (to be updated every couple weeks/months when the "other" teams have a new achievement to offer). And mainly work on the one CMake project (i.e., "your" project) which then makes use of the other external projects. Related CMake mechanisms here probably are ExternalProject_Add() or Imported Targets. Or, another way to achieve reduced build times might be things like distcc, icecc, ccache. On my side, I'm currently working on a flat CMake project space (and as said above this is working sufficiently well), however I might eventually change this to split off some suitable parts. HTH, coming from someone with possibly rather similar conditions. Andreas Mohr ___ 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
Re: [CMake] Linking Boost on Linux on 64bit host and 32bit target
On 03.11.10 17:57:10, Knox, Kent wrote: > Hello all~ > > I'm going to follow up on my email from last week with more information. I > don't believe that find_package( Boost ) is behaving properly in my case, and > I need help with either a proper solution or a workaround. > > I'm using Cmake 2.8.2, on a 64bit Ubuntu linux host, trying to compile a > 32bit package with boost. > > I have manually downloaded and compiled boost 1.44 into my home directory, > ~/sdk/boost_1_44_0. The system also has boost 1.40 installed using a package > manager into /usr/lib. > > I manually invoke cmake with this command line: > ~/bin/cmake-2.8.2-Linux-i386/bin/cmake -G "Unix Makefiles" -D > BOOST_ROOT=~/sdk/boost_1_44_0 -D > BOOST_LIBRARYDIR=~/sdk/boost_1_44_0/stage/lib -D > ATISTREAMSDKROOT=/usr/src/ati/ati-stream-sdk-v2.2-lnx64 -D BUILD64=OFF -D > CMAKE_BUILD_TYPE=Debug ../../code > > Notice that I explicitly set BOOST_ROOT and BOOST_LIBRARYDIR, and the debug > output seems to confirm my settings. > At my link step, I get: > > /usr/bin/c++ -m32 -g CMakeFiles/clAmd.Client.dir/clAmd.client.cpp.o > CMakeFiles/clAmd.Client.dir/clAmd.openCL.cpp.o > CMakeFiles/clAmd.Client.dir/clAmd.statisticalTimer.cpp.o > CMakeFiles/clAmd.Client.dir/stdafx.cpp.o -o clAmd.Client-0.5.1 -rdynamic > -L/usr/src/ati/ati-stream-sdk-v2.2-lnx64/lib/x86 > ../library/libclAmd.Runtime.so.0.5.1 -Wl,-Bstatic -lboost_program_options-mt > -Wl,-Bdynamic -lOpenCL > -Wl,-rpath,/usr/src/ati/ati-stream-sdk-v2.2-lnx64/lib/x86:/home/kknox/code/clTest/trunk/clFFT/bin/linux32/library: > /usr/bin/ld: skipping incompatible > /usr/lib/gcc/x86_64-linux-gnu/4.4.1/../../../libboost_program_options-mt.a > when searching for -lboost_program_options-mt > /usr/bin/ld: skipping incompatible /usr/lib/libboost_program_options-mt.a > when searching for -lboost_program_options-mt > /usr/bin/ld: cannot find -lboost_program_options-mt > > Notice, that the link step does NOT use the paths that I specified, but > instead uses '-Wl,-Bstatic -lboost_program_options-mt', which is using the > boost that is installed in /usr/lib. This is a problem because it is the > wrong bitness. Did you try to print out the value of Boost_LIBRARIES? Does that contain the proper absolute path to the boost library? Are you actually using that variable for your target_link_libraries call? The make-output looks like either the variable doesn't get the right value which shouldn't happen as its set using find_library or you're not using the variable but instead simply pass "program_options" to the target_link_libraries call. Oh and whats the value of Boost_program_options_LIBRARY? Andreas -- You never know how many friends you have until you rent a house on the beach. ___ 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
Re: [CMake] CMake 2.8.3 available for download
On 04.11.10 10:28:57, Micha Renner wrote: > Am Donnerstag, den 04.11.2010, 08:38 +0100 schrieb Eric Noulard: > > 2010/11/4 Micha Renner : > > > Unpacking cmake-2.8.3.tar.gz, cmake-2.8.3-Linux-i386.tar.gz results in > > > the following error message of the archive manager: > > > gzip: stdin: not in gzip format > > > tar: Child returned status 1 > > > tar: Error is not recoverable: exiting now > > > > Those are ok for me. > > Don't you have a download issue ? (which may be uncompressing on the fly)? > I don't think so. Firefox downloads the file and starts File Roller > then. Well, given the experiment with wget does work I do think you have a download-issue (or FileRoller has an issue). Try comparing the md5sum of the file downloaded via Firefox and the one downloaded from wget. Is that the same? If so its File Roller, otherwise its Firefox. FWIW, the md5sum of the linux-i386 tar.gz is: 1b1459fe8f6b6d250c7c56bec1b45c89 Andreas -- A visit to a strange place will bring fresh work. ___ 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
Re: [CMake] Bug fix requests for the *next* release of CMake...
On 05.11.10 09:36:39, Michael Jackson wrote: > I have an idea for a feature that might help resolve some of the > "Find***" issues. I would like to see CMake implement some sort of > "Software Update" mechanism where you could tell CMake to check a > central server for any updated FindXXX.cmake files and then download > them into the cmake installation directory. This would alleviate some > issues (cough ** FindBoost.cmake *** cough) where a critical fix gets > implemented but a user has to either compile from HEAD or wait for the > *next* release, which might be 3 months away. I would venture to guess > that most of the tweaks to the FindXXX.cmake files are CMake Major > version independent. This would be a nice way to push out small updates > that don't actually require a full recompile or newer version of CMake to > be installed. But it'll only work on Windows and/or MacOSX. On Linux the average user won't have write access to the location of the modules. So in addition cmake will have to implement a way to also look into the users home-folder or something like that. Andreas -- People are beginning to notice you. Try dressing before you leave the house. ___ 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
Re: [CMake] Is there a tool pretty much like cmake for Java?
On Monday, November 01, 2010 17:18:53 Michał Czuczman wrote: > On 10/22/2010 10:58 PM, Ben Boeckel wrote: > > On Fri, Oct 22, 2010 at 04:45:42PM -0400, Ben Boeckel forgot to attach > > files > > > > Actually attaching things now. > > > > --Ben > > This is still not a perfect solution. > > > 1. The script guesses output class file names only from source file > names. So one cannot have definitions of multiple classes within a > single file, nor use nested classes. This is a major issue for me. That's why I introduced a script to search for class files creating relative paths and writing it to a file! Ben removed it. I will look at the changes in ~4 weeks and will propose a new version. > 2. The generated jar file has class files stored with absolute paths > instead of paths relative to the _CLASS_DIR. But this is probably > easy to fix. That was already working just fine, see above. -- andreas ___ 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
Re: [CMake] Is there a tool pretty much like cmake for Java?
On Monday, November 01, 2010 17:18:53 Michał Czuczman wrote: > On 10/22/2010 10:58 PM, Ben Boeckel wrote: > > On Fri, Oct 22, 2010 at 04:45:42PM -0400, Ben Boeckel forgot to attach > > files > > > > Actually attaching things now. > > > > --Ben > > This is still not a perfect solution. > > > 1. The script guesses output class file names only from source file > names. So one cannot have definitions of multiple classes within a > single file, nor use nested classes. This is a major issue for me. That's why I introduced a script to search for class files creating relative paths and writing it to a file! Ben removed it. I will look at the changes in ~4 weeks and will propose a new version. > 2. The generated jar file has class files stored with absolute paths > instead of paths relative to the _CLASS_DIR. But this is probably > easy to fix. That was already working just fine, see above. -- andreas ___ 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
Re: [CMake] How to force the configure step to start over
Hi, On Tue, Nov 02, 2010 at 06:03:57PM -0400, cmake-requ...@cmake.org wrote: > Message: 4 > Date: Tue, 2 Nov 2010 14:45:35 -0400 > From: David Cole > Subject: Re: [CMake] How to force the configure step to start over > To: tmp > Cc: cmake@cmake.org > Message-ID: > > Content-Type: text/plain; charset=ISO-8859-1 > > Elminate the circularity. You'll drive yourself mad. > > :-) Sounds just about right :) However back to the question itself: to force a re-configure, one could "cmake -E touch" the CMAKE_CURRENT_LIST_FILE, somehow during target building or some such. This is quite certainly not the most direct (nor elegant!) way to force a reconfiguration (any ideas how to force it directly?), but in some situations such a reconfiguration might help. Andreas Mohr ___ 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
Re: [CMake] Solution folder property does not work for external projects in cmake 2.8.3
On Thu, Nov 04, 2010 at 09:28:57AM -0400, cmake-requ...@cmake.org wrote: > Message: 1 > Date: Thu, 4 Nov 2010 06:10:24 -0400 > From: David Cole > Subject: Re: [CMake] Solution folder property does not work for > external projects in cmake 2.8.3 > To: Jens Auer > Cc: cmake@cmake.org > Message-ID: > > Content-Type: text/plain; charset=ISO-8859-1 > Presently, if the generated FOLDER structure is incorrect, our > automated testing will not currently catch an error of that sort. Does > anybody have a good idea for how to verify the correctness of the > generated solution file? Right now it requires manual inspection of > the VS GUI to determine whether the result is correct or not. xmllint, I suppose. And if it needs to have more than basic XML element structure consistency checks, then it's probably possible to use --dtdvalid on a DTD (as hopefully published for VS2005/08/10 etc.). Unless that's still not precise enough for full validation of all content. Obviously this should best be made a mandatory post-build step prior to release. HTH, Andreas Mohr ___ 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
Re: [CMake] CPack general question and example
On Mon, Nov 15, 2010 at 05:57:04PM -0500, cmake-requ...@cmake.org wrote: > Message: 2 > Date: Mon, 15 Nov 2010 16:37:05 -0500 > From: David Doria > Subject: [CMake] CPack general question and example > To: cmake@cmake.org > Message-ID: > > Content-Type: text/plain; charset=ISO-8859-1 > > I just heard about CPack and started playing with it. I tried to make > an RPM of a simple VTK program: > > http://www.cmake.org/Wiki/CMake/CPackExample > > When I run 'make package', I get an error: > > CPack Error: Problem copying the package: > /home/doriad/CPackTest/bin/_CPack_Packages/Linux/RPM/DistanceBetweenPoints-0.1.1-Linux.rpm > to /home/doriad/CPackTest/bin/DistanceBetweenPoints-0.1.1-Linux.rpm > CPack Error: Error when generating package: DistanceBetweenPoints > make: *** [package] Error 1 Yup, IIRC you forgot to set some CPack RPM path-/file-related variable, causing the base path to be incorrect, but I currently don't remember which one. This is a rather stupid indirect error case with a very confusing error result and thus should be improved properly in CPack if possible. I can send you my (satisfyingly working) CPack RPM setup off-list if wanted. Andreas Mohr ___ 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
Re: [CMake] Forcing 'out-of-source' build
Hi, On Sat, Nov 27, 2010 at 01:11:06AM -0500, cmake-requ...@cmake.org wrote: > Message: 5 > Date: Fri, 26 Nov 2010 15:55:55 -0600 > From: j s > Subject: Re: [CMake] Forcing 'out-of-source' build > To: Eric Noulard > I'd recommend this: > touch CMakeCache.txt > touch CMakeFiles > > Check said files into your revision control system. ... _and make sure to document that intent within their content_ (perhaps confined to CMakeCache.txt, since that is a .txt file compatible with Windows expectations). And add a simple "see CMakeCache.txt" to CMakeFiles. (not that anyone unclever enough would ever happen to read these files before getting rid of them in sub-seconds, but...) > The fact that it can't create a directory alone makes cmake freak out almost > immediately. Interesting variant - seems like there are a hundred ways to Rome ;) Andreas Mohr ___ 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
Re: [CMake] find_package with ###Config.cmake
On 03.12.10 07:11:23, Micha Renner wrote: > There is a small library "TLib" which is installed like this > > Install the project... > -- Install configuration: "Debug" > -- Installing: /usr/local/lib/libTLibd.so > -- Installing: /usr/local/lib/TLib/TLibExport.cmake > -- Installing: /usr/local/lib/TLib/TLibExport-debug.cmake > -- Installing: /usr/local/include/TLib/cmFile.h > -- Installing: /usr/local/lib/TLib/TLIBConfig.cmake > -- Installing: /usr/local/lib/TLib/TLIBConfigVersion.cmake > > The CMakeLists file for the application program has the following line > to find the library > > FIND_PACKAGE(TLIB) > > This works, surprisingly, very good. No CMAKE_MODULE_PATH, no TLIB_DIR > in this case. > > But... > > If I call FIND_PACKAGE with version: > FIND_PACKAGE(TLIB 1.3) > > I get the std-warning: > - > CMake Warning at TestDLL/CMakeLists.txt:20 (FIND_PACKAGE): > Could not find module FindTLIB.cmake or a configuration file for > package > TLIB. > > Adjust CMAKE_MODULE_PATH or TLIB_DIR... > - > > > Why can't CMake find the TLIBConfig file, if FIND_PACKAGE is called with > version and TLIB_DIR is not set? The problem might not be finding the Config file, but rather that the ConfigVersion file doesn't set the VERSION_COMPATIBLE or VERSION_EXACT variables. Or maybe it even sets the VERSION_UNSUITABLE to indicate that the installed version of TLib doesn't match the version you request. Unfortunately cmake currently cannot seem to distinguish between these two cases (non-matching version vs. no config-file found), hence it produces the same message in both cases. Andreas -- Don't you feel more like you do now than you did when you came in? ___ 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
Re: [CMake] find_package with ###Config.cmake
On 03.12.10 15:19:38, Micha Renner wrote: > > > Meanwhile, with 2.8.3 to be exact, the warning message issued by CMake > > if a version file is found but the requested version doesn't suit is: > > > > Could not find a configuration file for package "..." that is compatible > > with requested version "...". > > > > The following configuration files were considered but not accepted: > > > > ..., version: ... > > > > So, Micha, which CMake version do you use? If it's not 2.8.3 could you > > give that a try and report the message if the problem still persists? > > Additionally, the _CONSIDERED_{CONFIGS,VERSIONS} variables > > would be of special interest, see dfe9c95. > > > On Linux, I use 2.8.0, what to be is the problem. > > So I switched to a Windows machine, which has 2.8.3. The warning I > mentioned above disappeared. > > But a call of > FIND_PACKAGE(TLIB 1.3) > results in this message: > > CMake Error at TestDLL/CMakeLists.txt:19 (FIND_PACKAGE): > Could not find a configuration file for package "TLIB" that is > compatible > with requested version "1.3". > > The following configuration files were considered but not accepted: > > C:/usr/local/lib/TLib/TLIBConfig.cmake, version: 1.3 > > > -- TLIB_CONSIDERED_VERSIONS: 1.3 > -- TLIB_CONSIDERED_CONFIGS: C:/usr/local/lib/TLib/TLIBConfig.cmake > > Since my knowledge is based on "CMake 2.6 Notes", there are some more > questions. > > The ###ConfigVersion.cmake is still necessary? Yes. > If so, ###ConfigVersion.cmake should have at least the following > content? Can you try using VERSION_(EQUAL|GREATER|LESS) instead of just EQUAL and please also try wether setting the variables (PACKAGE_VERSION_XXX) to TRUE rather than 1 changes anything. In worst case you'll have to add some message() output to the Version file to see why its not setting the variables correctly. Andreas -- Blow it out your ear. ___ 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
Re: [CMake] Creating CMakeLists files from Solutions, Projects and Makefiles
Hi, On Tue, Dec 07, 2010 at 02:25:18PM -0500, cmake-requ...@cmake.org wrote: > Message: 4 > Date: Tue, 7 Dec 2010 13:14:19 -0600 > From: Paul Dean > Subject: [CMake] Creating CMakeLists files from Solutions,Projects > and Makefiles > I've been using CMAKE for a few years now and I absolutley LOVE it. > It makes my life as a programmer so much easier to be able to generate > project files on any platform. > > What hurts is doing the reverse. I can't count how many hours I've spent > converting Solutions, Projects and Makefiles into CmakeLists files. > > I think if CMAKE could generate CMakeLists files from Solutions, Projects and > Makefiles, it would be the ULTIMATE make system. http://sourceforge.net/projects/vcproj2cmake/ ? OK, it's not integrated, it's got its sizeable share of warts considering its current sorta-pre-beta status (I've currently got lots of notes for improvements in the near future though), but... it might just help after all, you know ;) > Just think. Any time you run into some sorcecode that does not have a > CMakeFile, you could generate it from the Makefile or Project. "some sorcecode" == 2MLOC on my side of the fence. It's working ok so far. Andreas Mohr ___ 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
Re: [CMake] Creating CMakeLists files from Solutions, Projects and Makefiles
On 07.12.10 14:31:56, John Drescher wrote: > On Tue, Dec 7, 2010 at 2:14 PM, Paul Dean wrote: > > I've been using CMAKE for a few years now and I absolutley LOVE it. > > It makes my life as a programmer so much easier to be able to generate > > project files on any platform. > > > > What hurts is doing the reverse. I can't count how many hours I've spent > > converting Solutions, Projects and Makefiles into CmakeLists files. > > > > I think if CMAKE could generate CMakeLists files from Solutions, Projects > > and Makefiles, it would be the ULTIMATE make system. > > Just think. Any time you run into some sorcecode that does not have a > > CMakeFile, you could generate it from the Makefile or Project. > > > > I can't imagine any programmer that would not love that ability. I think it > > would be something great to add to CMAKE. > > What are everyones thoughts on that? > > > > I would love to see a working QMake to CMake converter. And I mean one > that works for complicated QMake projects not just a simple executable > with a few headers and a few source files. If I recollect my lessons in computer-theory correctly from university, then this is not possible for the "general case". The problem is that QMake's language is very close to a general-purpose programming language, in particular it supports loops and conditions. This (again IIRC) makes it impossible for a program to decide wether two qmake projects or a qmake and a cmake project are semantically equal. It might be possible to do a "bit-by-bit" conversion of qmake project files to cmake, but I doubt the resulting cmake project is very useful except for pure building. Maintaining those cmake-files is not going to be easy or fun, nor would they match what a cmake developer would write if he set up stuff "from scratch" for cmake to build the project. And without the goal of switching from qmake to cmake, I don't see any point in doing a conversion in the first place - after all qmake can build the project on all interesting platforms already (else it would've been replaced). And that doesn't even consider a configure-script which I think most larger qmake projects have (like Qt itself). Andreas -- You are as I am with You. ___ 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
Re: [CMake] Creating CMakeLists files from Solutions, Projects and Makefiles
On 07.12.10 13:14:19, Paul Dean wrote: > > I've been using CMAKE for a few years now and I absolutley LOVE it. > It makes my life as a programmer so much easier to be able to generate > project files on any platform. > > What hurts is doing the reverse. I can't count how many hours I've spent > converting Solutions, Projects and Makefiles into CmakeLists files. > > I think if CMAKE could generate CMakeLists files from Solutions, Projects and > Makefiles, it would be the ULTIMATE make system. > Just think. Any time you run into some sorcecode that does not have a > CMakeFile, you could generate it from the Makefile or Project. > > I can't imagine any programmer that would not love that ability. I think it > would be something great to add to CMAKE. > What are everyones thoughts on that? See my answer to John, basically I doubt this is actually possible, except for very static project-files like may VS solutions are. For Makefile's or other build-tools like qmake its not going to work as they allow arbitrary commands to be executed at any point. You may be able to convert the files on a syntactic level, but that doesn't guarantee you they're semantically equivalent. And I bet in most cases (except very trivial ones) the generated CMake files will look very un-cmake'ish. Not to mention configure-scripts written in some shell-language or as C++ app... Also whats the point of being able to generate cmake files from "any" project files? If I just want to build the project then I can just as well use the existing buildsystem to build. Why bother installing cmake, if VS is already installed and the project has a solution file? If you want to port a project to cmake, you'll probably also end up restructuring some things wrt. the buildsystem, so a human needs to do the conversion anyway (and automatic conversion will be ugly, see above). This is similar to automatic translation of languages. Yes todays tools that do this are good enough so that you can get the meaning of a text for many cases. But they're still not good enough to match what a native speaker would've written or to be able to translate any arbitrary text (especially 'slang', scientific texts etc. are causing problems for such tools). Andreas -- You need more time; and you probably always will. ___ 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
Re: [CMake] Creating CMakeLists files from Solutions, Projects and Makefiles
On 07.12.10 23:52:10, Andreas Pakulat wrote: > On 07.12.10 13:14:19, Paul Dean wrote: > > > > I've been using CMAKE for a few years now and I absolutley LOVE it. > > It makes my life as a programmer so much easier to be able to generate > > project files on any platform. > > > > What hurts is doing the reverse. I can't count how many hours I've spent > > converting Solutions, Projects and Makefiles into CmakeLists files. > > > > I think if CMAKE could generate CMakeLists files from Solutions, Projects > > and Makefiles, it would be the ULTIMATE make system. > > Just think. Any time you run into some sorcecode that does not have a > > CMakeFile, you could generate it from the Makefile or Project. > > > > I can't imagine any programmer that would not love that ability. I think > > it would be something great to add to CMAKE. > > What are everyones thoughts on that? > > See my answer to John, basically I doubt this is actually possible, > except for very static project-files like may VS solutions are. For > Makefile's or other build-tools like qmake its not going to work as they > allow arbitrary commands to be executed at any point. You may be able to > convert the files on a syntactic level, but that doesn't guarantee you > they're semantically equivalent. And I bet in most cases (except very > trivial ones) the generated CMake files will look very un-cmake'ish. > > Not to mention configure-scripts written in some shell-language or as > C++ app... > > Also whats the point of being able to generate cmake files from "any" > project files? If I just want to build the project then I can just as > well use the existing buildsystem to build. Why bother installing cmake, > if VS is already installed and the project has a solution file? > > If you want to port a project to cmake, you'll probably also end up > restructuring some things wrt. the buildsystem, so a human needs to do > the conversion anyway (and automatic conversion will be ugly, see > above). > > This is similar to automatic translation of languages. Yes todays tools > that do this are good enough so that you can get the meaning of a text > for many cases. But they're still not good enough to match what a native > speaker would've written or to be able to translate any arbitrary text > (especially 'slang', scientific texts etc. are causing problems for such > tools). PS: All the above doesn't mean I think conversion-tools are totally useless. In fact the automake-to-cmake tool I think is very useful to get a basic skeleton cmake project up in no time. That way one can concentrate on the 'real work', i.e. porting the library/feature checks and making sure that includes and link-libs are set up correctly. Andreas -- You are so boring that when I see you my feet go to sleep. ___ 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
Re: [CMake] cmake qt4 Lplates
On 10.12.10 22:09:29, luxInteg wrote: > Greetings, > > I have my cmake L-plates firmly on ( with a Qt4 project I am stumbling on ) > > I have these in CMakeLists.txt file:- > FIND_PACKAGE( Qt4 REQUIRED ) > INCLUDE( ${QT_USE_FILE} ) > set(QT_USE_OPENGL TRUE) > set(QT_USE_QTSVG TRUE ) > SET( QT_USE_QTXML TRUE ) > SET( QT_USE_QT3SUPPORT TRUE ) > SET( QT_USE_QTNETWORK TRUE ) > SET( QT_USE_QTASSISTANT TRUE ) > SET(QT_USE_QTSCRIPT TRUE) This is wrong, you should set the use-variables _before_ including the use-file. Otherwise the qt-include-dir-variable as well as libraries variable won't contain these modules. Thats the whole point of the use-module. > include_directories( ${CMAKE_BINARY_DIR} ${QT_INCLUDE_DIR} ) This should work, but with the wrong order above it might only set includes for Qt/, QtCore/ and QtGui/ subdirs. > Two sets pf problems I have encountered include:' > > A:- I cannot set the includes for Qt4 as 'found' by FindQt4.cmake. I > looked through the said file for such a variable under mark_as_advanced() > or somesuch but I could not discern any related functions nor variable > names. I tried ${QT_INCLUDE_DIR}, ${QT_HEADERS_DIR} aand ${QT_INCLUDES} to > no avail.I had to resort to setting these manually as > /opt/qt4/include/ Did you print out QT_INCLUDE_DIR to check its value or QT_INCLUDES? > B:- This might be due to the manual setting of the Qt4_INCLUDE > (directory(s), but I seem to get duplication in the preprocessors > (generated automatically): Below is an example > > -DQT_NO_DEBUG > -DQT_SVG_LIB > -DQT_QT3SUPPORT_LIB > -DQT3_SUPPORT > -DQT_XML_LIB > -DQT_OPENGL_LIB > -DQT_GUI_LIB > -DQT_NETWORK_LIB > -DQT_CORE_LIB > -DQT_SHARED > -DQT_NO_DEBUG > -DQT_GUI_LIB > -DQT_CORE_LIB > -DQT_SHARED > > (REMARK I have -DQT_SHARED -DQT_NO_DEBUG both duplicated) Whats the problem with that? And are you setting the defines yourself to be included (via QT_DEFINITIONS) or is that done by the use-module? Andreas -- Are you sure the back door is locked? ___ 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
[CMake] How to detect whether CMake scripts are executing under / within CPack environment?
Hi, [subject formulated for best keyword search impact] forgive me for the possibly dumb question, but since cpack of course includes executing the "make install" step I'd like to know how to possibly detect this within CMake code. My build is capable of launching an external script to pop up a "build complete" message, which then of course unhelpfully also occurs during cpack -G DEB (thus completely stopping the packaging due to non-parallel build execution in this environment), thus it would be useful to automatically turn it off in such cases. Of course a potential solution might actually turn out to be generator-specific (e.g. Makefile). :-P I'm afraid since CPack is likely executing a generated CMake environment, detection is difficult or even impossible. Several varied Google searches didn't turn up much. Andreas Mohr ___ 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
Re: [CMake] can't build translated makefile on snow leopard 10.6.5 w/ g++ 4.2.1 (complaint: g++: No such file or directory, although g++ is there!!)
On 20.12.10 23:34:55, ny wrote: > The code was never been tested on a mac, not to mention snow leopard. > I have the guarantee that it compiles + builds for win + linux. > Project was a collaborative effort and unfortunately I am stuck without a > makefile =P and with the ugly *.vcproj file. Note that I did not use an > automated ruby script I found for Then either it doesn't build on Linux or there must be something else for Linux. There is no buildsystem that operates on .vcproj files (afaik) except VS which doesn't work on Linux. > the translation of *.vcproj to makefile, since the script only > handled the basics -> no pre/post-build steps or file-specific flags are > included; > instead, I translated from scratch to CMakelists and then converted to > makefile. not that tricky as it sounds.. > > So, assuming the problem is w/ the makefile, why do I have a clean > makefile during the configuration/generation steps? Are you mixing up Makefile (which is something that make works with) and CMakeLists.txt (which is the input for cmake, which then generates Makefiles from it)? To me the above doesn't make much sense when talking purely about Makefile's. > Note that I choose to generate Unix makefile, not an xcode project. > > I 've successfully translated the *.vcproj file into a makefile, > fixed a few issues, linked to external libs, but the build w/ make fails and > I get > > *i686-apple-darwin10-g++-4.2.1: g++: No such file or directory > make[2]: *** [CMakeFiles/.../.../...cpp.o] Error 1 > make[1]: *** [CMakeFiles/.../.../all] Error 2 > make: *** [all] Error 2 > * Whats the full errror and the full compile line (run make VERBOSE=1)? > which, honestly, I don't remember seeing before -> complaining about > g++ I mean and not missing file or dir. Note that g++ *is* in place, I can > successfully compile other programs. > > Assuming that /usr/bin was somehow not in the path during the cmake > invocation, > I used > * > * > *set(CMAKE_C_COMPILER /usr/bin/gcc)* > *set(CMAKE_CXX_COMPILER /usr/bin/g++)* > > in the beginning of my CMakeList.txt without any luck. > It complained temporarily for a conflict, i.e. had to reset the cache, > but no progress so far. I > > > I am stuck a few hours now and I suspect (or better hope) that the > problem is sth similar to the typical 32-bit/64-bit problem in mac > ports. I tried w/ -arch i386 -m32 flags without any luck, so I 'd love to > hear any thoughts, ideas.. > I guess there are parts of the code need to be re-written especially > for OS X SL, but I cannot figure out the problem since the failing error is > not > descriptive enough. > > When I build a xcodeproj (with g++ flag -arch i386), I get: > > *lipo: can't figure out the architecture type of: /var/folders/9b/ > 9b2CWG5gHvCi5hawjO4o5E+++TI/-Tmp-//ccXHDX6t.out > Command /Developer/usr/bin/gcc-4.2 failed with exit code 1 > * > When I build a xcodeproj (with g++ flag -arch x86_64), I get: > > *setenv LANG en_US.US-ASCII > /Developer/usr/bin/gcc-4.2 -x c++ -arch x86_64 -fmessage-length=0 - > pipe -Wno-trigraphs -fpascal-strings -fasm-blocks -O0 -mdynamic-no- > pic -DCMAKE_INTDIR="Debug" -isysroot /Developer/SDKs/MacOSX10.6.sdk - > mmacosx-version-min=10.6 -gdwarf-2 -Wmost -Wno-four-char-constants - > Wno-unknown-pragmas //... ... > i686-apple-darwin10-gcc-4.2.1: g++: No such file or directory > Command /Developer/usr/bin/gcc-4.2 failed with exit code 1* > > all cryptic.. Do you have a g++ in /Developer/usr/bin/? I don't know too much about the setup of Compilers on MacOSX, but if gcc-4.2 is run in that path, maybe it expects the g++ at the same place and not just /usr/bin (unless the two are symlinked). Andreas -- Tonight's the night: Sleep in a eucalyptus tree. ___ 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
Re: [CMake] CPack 101
n, only ugly, very bad or semi-failing workarounds. That kind of work should be _fun_, especially when it then results in a nicely working and fully automated result. It plain wasn't. I also recently witnessed a discussion (was it libusb?) where a suggestion for CMake build support was met with a clear number of replies tending away from it, likely due to similar experience. Unfortunately. Hopefully my story will enable people to see where there are problems and how to approach any potential solutions. I have to say that so far I'm quite happy with the sufficiently large infrastructure that I was able to create, it's just that many areas feel wanting (the entire BundleUtilities / install-time stuff is an example of that, too). Thanks, Andreas Mohr ___ 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
Re: [CMake] CPack 101
On 22.12.10 23:24:35, Andreas Mohr wrote: > - there's no cmake -E rename available (perhaps for reasons of build rule > atomicity) Hmm my cmake -E help tells me different: ... rename oldname newname- rename a file or directory (on one volume) ... This is cmake version 2.8.2.20100804-ga42a4 Andreas -- You will be singled out for promotion in your work. ___ 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
[CMake] Wrong escaping of custom-command arguments?
Hi, it seems that cmake doesn't properly escape the commandlines for custom commands. I'm adding a list of strings which include whitespace and also parenthesis "()" as arguments to a custom command. Additionally this custom command is running a target built by the same project. Unfortunately CMake only escapes the whitespace, but doesn't escape the parenthesis. Hence invoking the command aborts with a /bin/sh: Syntax error: Bad function name Trying to solve this by quoting the individual arguments using \" doesn't help as cmake still adds a \ before any whitespace. This leads to wrong arguments being given to the actual command and hence it doesn't behave as it should. So anybody got another idea how to get these arguments through properly? BTW: Using VERBATIM doesn't help either (I didn't expect it anyway, but was worth a try). Andreas -- You will experience a strong urge to do good; but it will pass. ___ 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
[CMake] system script integration
On Thu, Dec 23, 2010 at 09:11:53AM +, Mike McQuaid wrote: > On 22 December 2010 22:24, Andreas Mohr wrote: > > To put it simply, I was just not happy the entire time while > > trying to implement this and not finding any satisfying (well-crafted) > > solution, > > only ugly, very bad or semi-failing workarounds. > > That kind of work should be _fun_, especially when it then results in a > > nicely working and fully automated result. It plain wasn't. > > It's hard to understand exactly what your problems are other than just > learning CMake. I suggest you make a new thread and try and explain > these clearly, it's pretty hard to try and help from your previous > descriptions. Indeed, I probably shouldn't have hijacked the thread like that (I didn't really expect anyone to actively help on my listing, I just intended to provide a live and breathing example of the status quo ;) And of course I didn't have the actual implementation at hand, merely a recollection that was sufficient to demonstrate the issues. The one question that probably should be asked after my mail: which is the essential part that was showing lacking support in my sample? I believe it's foreign scripting support: there should be sufficient builtin support for system scripts to be executed easily (e.g. to integrate parts common with other build systems one may be using and thus be able to keep them deployed with several systems). And this likely boils down to lacking dos2unix-type integration (provided via a /usr/share/cmake../Modules/ helper), since all the other parts (file(WRITE), or using script templates via configure_file() etc.) can be deemed sufficient I believe. The ensuing question would be: can (and should!?) this file write / configure file / dos2unix op handling for script preparation be made a suitable one-liner for easy integration? Since there are quite specific (and limited) needs for execution of system scripts (shell, perl, python, ...) it might be a good idea to provide a generic yet simple helper function. Andreas Mohr ___ 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
Re: [CMake] CMake 2.8.3 built on OS X crashes on Startup.
On 05.01.11 12:34:09, David Cole wrote: > cmake-gui needs some further work to be automatically testable. > > If we launched it as-is on a test run, then it would just hang there > forever, waiting for user input as gui apps will do, and the test > would timeout. There are also tools out there to test gui applications in an automated fashion, including support for driving them from cmake. Andreas -- Good day for overcoming obstacles. Try a steeplechase. ___ 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
Re: [CMake] RUNTIME_OUTPUT_DIRECTORY_ has no effect
On 07.01.11 11:11:18, Martin Magnusson wrote: > I'm having trouble setting the runtime output directory, especially with > multiple configurations. > > I'm using CMake 2.8 on Ubuntu 10.04, with gcc. > > My current root CMakeLists.txt contains > SET( EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin ) > which works, although the EXECUTABLE_OUTPUT_PATH is deprecated. > > If I read the documentation correctly, the proper way of setting the > output directory now would be > SET_PROPERTY( GLOBAL PROPERTY > RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin > ) > but that doesn't work for me. With that setting, the binary is produced > in the source directory, just as if I hadn't specified an output > directory at all. Thats because that variable is not a global property. If you look at the cmake manual you'll see it listed under the target-properties heading. So you have to set this for each target (or wrap your target-creation in a macro to set it automatically). Andreas -- You never know how many friends you have until you rent a house on the beach. ___ 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
Re: [CMake] RUNTIME_OUTPUT_DIRECTORY_ has no effect
On 07.01.11 11:11:18, Martin Magnusson wrote: > I'm having trouble setting the runtime output directory, especially with > multiple configurations. > > I'm using CMake 2.8 on Ubuntu 10.04, with gcc. > > My current root CMakeLists.txt contains > SET( EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin ) > which works, although the EXECUTABLE_OUTPUT_PATH is deprecated. > > If I read the documentation correctly, the proper way of setting the > output directory now would be > SET_PROPERTY( GLOBAL PROPERTY > RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin > ) > but that doesn't work for me. With that setting, the binary is produced > in the source directory, just as if I hadn't specified an output > directory at all. PS: To set the global value once, simply prefix it with CMAKE_ as documented in the manual. Andreas -- You are confused; but this is your normal state. ___ 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
[CMake] Restrictions on where a binary can be put?
Hi, I'm having a bit of a problem here changing the runtime output directory for a binary. Its an executable target named 'setup' and I'd like to put it into the top-level directory. Unfortunately it always ends up in the bin/ directory, which is what CMAKE_RUNTIME_OUTPUT_DIRECTORY is being set to. I'm using set_target_properties( setup PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR} ) after creating the target currently, which should work as far as I can see from the documentation. Are there maybe any restrictions on what the directory may be or what targets can be put there? If not, any suggestions how to debug this? I can see that the build.make does already have the rule setup for putting the binary into bin/, so it must be going wrong somewhere in the generation stage, but a simple cmake --trace doesn't show up anything suspicious. Is there a switch to follow the steps that cmake does during makefile-generation? Andreas -- Avoid reality at all costs. ___ 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
Re: [CMake] Restrictions on where a binary can be put?
On 09.01.11 14:24:16, Michael Hertling wrote: > On 01/09/2011 12:58 PM, Andreas Pakulat wrote: > > Hi, > > > > I'm having a bit of a problem here changing the runtime output directory > > for a binary. Its an executable target named 'setup' and I'd like to put it > > into the top-level directory. Unfortunately it always ends up in the bin/ > > directory, which is what CMAKE_RUNTIME_OUTPUT_DIRECTORY is being set to. > > > > I'm using > > set_target_properties( setup PROPERTIES RUNTIME_OUTPUT_DIRECTORY > > ${CMAKE_BINARY_DIR} ) > > after creating the target currently, which should work as far as I can see > > from the documentation. Are there maybe any restrictions on what the > > directory may be or what targets can be put there? > > > > If not, any suggestions how to debug this? I can see that the build.make > > does already have the rule setup for putting the binary into bin/, so it > > must be going wrong somewhere in the generation stage, but a simple cmake > > --trace doesn't show up anything suspicious. Is there a switch to follow > > the steps that cmake does during makefile-generation? > > Could you provide a minimal but complete example? Might take a bit, my first try actually works as expected, so I'll need to take the real code and reduce it. > Currently, I can't > confirm this issue, i.e. the RUNTIME_OUTPUT_DIRECTORY property seems > to take precedence over the CMAKE_RUNTIME_OUTPUT_DIRECTORY variable. > Nevertheless, if RUNTIME_OUTPUT_DIRECTORY is set to CMAKE_BINARY_DIR > from within a subdirectory, i.e. CMAKE_CURRENT_BINARY_DIR isn't equal > to CMAKE_BINARY_DIR, I can see quite strange things happening: > > # CMakeLists.txt: > CMAKE_MINIMUM_REQUIRED(VERSION 2.8 FATAL_ERROR) > PROJECT(ROD C) > ADD_SUBDIRECTORY(main) > > # main/CMakeLists.txt: > FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/main.c > "int main(void){return 0;}\n" > ) > ADD_EXECUTABLE(main ${CMAKE_CURRENT_BINARY_DIR}/main.c) > SET_TARGET_PROPERTIES(main PROPERTIES > RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR} > ) > > After CMaking from within an empty directory, building fails with: > > .../gcc CMakeFiles/main.dir/main.c.o -o . -rdynamic > .../ld: cannot open output file .: Is a directory > > If the RUNTIME_OUTPUT_DIRECTORY property is set to CMAKE_BINARY_DIR/bin, > e.g., everything works as expected, i.e. the executable gets written to > CMAKE_BINARY_DIR/bin. Also, no such problem occurs from within the top- > level directory, i.e. CMAKE_CURRENT_BINARY_DIR == CMAKE_BINARY_DIR. > Perhaps, these two phenomena are related? Hmm, for me everything works fine (see attached project) here when setting the output-dir to cmake-binary-dir. Andreas -- Green light in A.M. for new projects. Red light in P.M. for traffic tickets. cmake_tst1.tar.gz Description: Binary data ___ 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
Re: [CMake] Restrictions on where a binary can be put?
On 09.01.11 14:24:16, Michael Hertling wrote: > On 01/09/2011 12:58 PM, Andreas Pakulat wrote: > > Hi, > > > > I'm having a bit of a problem here changing the runtime output directory > > for a binary. Its an executable target named 'setup' and I'd like to put it > > into the top-level directory. Unfortunately it always ends up in the bin/ > > directory, which is what CMAKE_RUNTIME_OUTPUT_DIRECTORY is being set to. > > > > I'm using > > set_target_properties( setup PROPERTIES RUNTIME_OUTPUT_DIRECTORY > > ${CMAKE_BINARY_DIR} ) > > after creating the target currently, which should work as far as I can see > > from the documentation. Are there maybe any restrictions on what the > > directory may be or what targets can be put there? > > > > If not, any suggestions how to debug this? I can see that the build.make > > does already have the rule setup for putting the binary into bin/, so it > > must be going wrong somewhere in the generation stage, but a simple cmake > > --trace doesn't show up anything suspicious. Is there a switch to follow > > the steps that cmake does during makefile-generation? > > Could you provide a minimal but complete example? Ok, attached case produces the error. Apparently the problem is fetching the LOCATION property from the target and setting the RUNTIME_OUTPUT_DIRECTORY afterwards. Looks like a cmake bug to me, so I'll file a report. Andreas -- Your reasoning is excellent -- it's only your basic assumptions that are wrong. ___ 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
Re: [CMake] Restrictions on where a binary can be put?
On 09.01.11 21:05:21, Andreas Pakulat wrote: > On 09.01.11 14:24:16, Michael Hertling wrote: > > On 01/09/2011 12:58 PM, Andreas Pakulat wrote: > > > Hi, > > > > > > I'm having a bit of a problem here changing the runtime output directory > > > for a binary. Its an executable target named 'setup' and I'd like to put > > > it > > > into the top-level directory. Unfortunately it always ends up in the bin/ > > > directory, which is what CMAKE_RUNTIME_OUTPUT_DIRECTORY is being set to. > > > > > > I'm using > > > set_target_properties( setup PROPERTIES RUNTIME_OUTPUT_DIRECTORY > > > ${CMAKE_BINARY_DIR} ) > > > after creating the target currently, which should work as far as I can see > > > from the documentation. Are there maybe any restrictions on what the > > > directory may be or what targets can be put there? > > > > > > If not, any suggestions how to debug this? I can see that the build.make > > > does already have the rule setup for putting the binary into bin/, so it > > > must be going wrong somewhere in the generation stage, but a simple cmake > > > --trace doesn't show up anything suspicious. Is there a switch to follow > > > the steps that cmake does during makefile-generation? > > > > Could you provide a minimal but complete example? > > Ok, attached case produces the error. Apparently the problem is fetching > the LOCATION property from the target and setting the > RUNTIME_OUTPUT_DIRECTORY afterwards. Looks like a cmake bug to me, so > I'll file a report. Ooops, forgot the attachment :) Andreas -- You should emulate your heros, but don't carry it too far. Especially if they are dead. test_output_dir.tar.gz Description: Binary data ___ 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
Re: [CMake] Restrictions on where a binary can be put?
On 09.01.11 21:09:37, Andreas Pakulat wrote: > On 09.01.11 21:05:21, Andreas Pakulat wrote: > > On 09.01.11 14:24:16, Michael Hertling wrote: > > > On 01/09/2011 12:58 PM, Andreas Pakulat wrote: > > > > Hi, > > > > > > > > I'm having a bit of a problem here changing the runtime output directory > > > > for a binary. Its an executable target named 'setup' and I'd like to > > > > put it > > > > into the top-level directory. Unfortunately it always ends up in the > > > > bin/ > > > > directory, which is what CMAKE_RUNTIME_OUTPUT_DIRECTORY is being set to. > > > > > > > > I'm using > > > > set_target_properties( setup PROPERTIES RUNTIME_OUTPUT_DIRECTORY > > > > ${CMAKE_BINARY_DIR} ) > > > > after creating the target currently, which should work as far as I can > > > > see > > > > from the documentation. Are there maybe any restrictions on what the > > > > directory may be or what targets can be put there? > > > > > > > > If not, any suggestions how to debug this? I can see that the build.make > > > > does already have the rule setup for putting the binary into bin/, so it > > > > must be going wrong somewhere in the generation stage, but a simple > > > > cmake > > > > --trace doesn't show up anything suspicious. Is there a switch to follow > > > > the steps that cmake does during makefile-generation? > > > > > > Could you provide a minimal but complete example? > > > > Ok, attached case produces the error. Apparently the problem is fetching > > the LOCATION property from the target and setting the > > RUNTIME_OUTPUT_DIRECTORY afterwards. Looks like a cmake bug to me, so > > I'll file a report. > > Ooops, forgot the attachment :) Filed a ticket now: http://public.kitware.com/Bug/view.php?id=11671 Andreas -- You love your home and want it to be beautiful. ___ 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
Re: [CMake] Restrictions on where a binary can be put?
On 09.01.11 22:48:34, Nizar Khalifa Sallem wrote: > > > I don't really understand why you want to get the LOCATION from your > > > target, anyway, the get_target_property works fine if you use > > > set_target_properties before it. [...] > > > > ...but SET_TARGET_PROPERTIES() doesn't work fine if it's used after > > GET_TARGET_PROPERTY(), even if both operate on different properties. > That point I can definitely exclude since I am using > set_target_properties on RUNTIME_OUTPUT_DIRECTORY along with > get_target_property on the file name havily in my > projects and it works fine even today. I am using cmake v2.8.3 (built) > on a ubuntu 10.10 and it did work fine with cmake v2.6.4. Did you build my example? If so, where was the foo binary put? The example code has no other purpose than showing that changing the output directory for the executable doesn't have any effect if done after fetching a property from that target (the LOCATION). It doesn't matter what my intent is in doing this to prove that this is unexpected and strange behaviour. That means there's an error, that is either cmake behaves incorrectly in not updating the output directory once you've queried the LOCATION of a target. Or its intented behaviour and the error is in not warning that the call has no effect and not documenting this surprising behaviour. Andreas -- You will pioneer the first Martian colony. ___ 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
Re: [CMake] CPack and configure_file
On 10.01.11 17:26:04, Tobias Ellinghaus wrote: > Hello, > > I create some files inside of CMAKE_CURRENT_BINARY_DIR using > configure_file(). > These are not installed but needed for compiling the program. When creating a > .tgz file with make package_source these files are not included so that the > resulting source package is basically useless. > > Is there a way to add these files? I have searched through google and the > list > archives and only found http://www.cmake.org/Bug/view.php?id=8438 which would > at least allow to copy the files into CMAKE_CURRENT_SOURCE_DIR. Are you sure you've built a source-package? I can't reproduce this here using include(CPack) and make package_source. As far as I understood your description for a binary package of your code the files won't be necessary as they're only needed during compilation? Andreas -- Go to a movie tonight. Darkness becomes you. ___ 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
Re: [CMake] add_subdirectory and link_directories
On 11.01.11 10:27:02, Thomas Petazzoni wrote: > Hello, > > On Tue, 11 Jan 2011 01:42:47 +0100 > Michael Hertling wrote: > > > Since CMake prefers to specify libraries by path instead of using > > -l/-L or the like, there's usually no need for the LINK_DIRECTORIES() > > command, IMO. > > Sorry to jump into the discussion, but I'm having a problem that I > think is related to that. > > I have an application that links against Qt and another library which > is found using pkg-config (and the PkgConfig CMake module). Due to the > fact that I'm cross-compiling, the library is in a non-standard > location (i.e: $HOME/something/usr/lib instead of /usr/lib). > Unfortunately, the xxx_LIBRARIES variable filled by the PkgConfig > module only contains "-lfoobar". So I'd like to either : Don't use the results of the PkgConfig module directly when finding libraries. Instead simply use it as hint to the find_library() cmake function to get the real libraries. For example this might work: set( MyPkg_LIBS ) foreach( lib ${MyPkg_LIBRARIES} ) find_library( _lib NAMES ${lib} HINTS ${MyPkg_LIBRARY_DIRS} ) list( APPEND MyPkg_LIBS ${_lib} ) endforeach() This will make sure that the libraries extracted by using the PkgConfig module are found with their absolute path and put into the MyPkg_LIBS variable. If you want to, you can also create individual variables for each library. The HINTS argument will make sure that CMake first searches for your library in the paths extracted from the pkg-config file. Andreas -- You recoil from the crude; you tend naturally toward the exquisite. ___ 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
[CMake] CMake Java Support
Hello CMake, my name is Andreas Schneider and I'm working for Red Hat. At the end of last year I've worked on Dogtag PKI [1]. The Dogtag Certificate System [2] is an enterprise-class open source Certificate Authority. The project is written in serveral different laguages (C, C++ and Java), so I've used CMake as the new build system. To be able to build the java project I needed Java support in CMake. So I've started to write functions to compile java files, find jar files, bundle jar files and generate javadoc. It should provide everything to build java and jni projects. You find the files here: http://git.cryptomilk.org/projects/cmake-tools.git/tree/language/java FindJNI.cmake: Find JNI libraries and headers. I think this is the file from CMake itself. FindJava.cmake: Find all needed Java tools like javac, javadoc, jar, etc. UseJava.cmake: This file provides all needed function to support creating java projects in CMake. Most of the function are documented in detail. There is some documentation missing. I will add this soon. UseJavaClassFilelist.cmake: This is needed to find the class files in the build directory. One .java file can create multiple .class files. So you have to glob for these file. There is support to only look for certain .class files. UseJavaSymlinks.cmake: This is a helper to create symlinks for versioned jar files. git clone git://git.cryptomilk.org/projects/cmake-tools.git It would be nice if this would be included into the CMake distribution, but at the moment there is still documentation missing. I hope that this will help some people to get their Java project built with CMake. Comments, suggestions and patches are welcome! Best regards, -- andreas [1] https://fedorahosted.org/pki/browser/trunk/pki [2] http://pki.fedoraproject.org/wiki/PKI_Main_Page -- Andreas Schneider GPG-ID: 8B7EB4B8 Red Hat a...@redhat.com Samba Team a...@samba.org ___ 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
Re: [CMake] CMake Java Support
On Tuesday 11 January 2011 16:01:14 Andrea Galeazzi wrote: > Hi Andreas, Hi Andrea, > I'm a dyed-in-the-wool Java developer (and also Fedora user) so it makes > me very happy to know that someone are working to integrate Java in > CMake. My question is: shouldn't Ant be enough? Or better, Could > invoking an Ant file as pre/post build command in CMakeLists always > accomplish any kind of build requirement? a) As I've said before this is a C, C++ and Java project. I don't think that ant supports C or C++ b) I don't like XML and this is why I would never use ant. c) I don't see a reason to use ant when CMake ist able to do the same the way I like and prefer. -- andreas -- Andreas Schneider GPG-ID: 8B7EB4B8 Red Hat a...@redhat.com Samba Team a...@samba.org ___ 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
Re: [CMake] List operations
On 12.01.11 11:56:53, kent williams wrote: > I'm generating a list of files with file(GLOB), but then I want to > remove some filenames from the resulting list. > > So essentially I'd like a CMake function like this > > function(RemoveItemsFromList ListA ListToRemove) > endfunction(RemoveItemsFromList) > > and I don't know what to put in the middle ;-) There's no need for a function, the list() function can already do that: list( REMOVE_ITEM yourlist ${listToRemove} ) Andreas -- Give thought to your reputation. Consider changing name and moving to a new town. ___ 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
Re: [CMake] CMake Java Support
On Wednesday 12 January 2011 15:32:08 Allen D Byrne wrote: > Andreas, > Thanks for providing these files! I have finally been able to progress on > converting our java product to cmake. I have one suggestion: > > Add to the add_java function the classpath for the target; > > set(${_TARGET_NAME}_CLASSPATH > ".${CMAKE_JAVA_INCLUDE_PATH_FINAL}/${_TARGET_NAME}.jar" PARENT_SCOPE) > > I needed this on linux (uses ':' in classpath not ';' ) to do an add_test. > > Also two questions: > How do I get the jar files into an output folder for build/test (not > install task)? > > After I build my JNI Library with normal C process how do I connect the > java JAR to use the library? I'm not sure how to use INSTALL_JNI_SYMLINK? > > Allen > > > Hello CMake, > > > > my name is Andreas Schneider and I'm working for Red Hat. At the end of > > last year I've worked on Dogtag PKI [1]. The Dogtag Certificate System > > [2] is an enterprise-class open source Certificate Authority. > > > > The project is written in serveral different laguages (C, C++ and Java), > > so I've used CMake as the new build system. To be able to build the java > > project I needed Java support in CMake. So I've started to write > > functions to compile java files, find jar files, bundle jar files and > > generate javadoc. > > > > It should provide everything to build java and jni projects. You find the > > files here: > > > > http://git.cryptomilk.org/projects/cmake-tools.git/tree/language/java > > > > FindJNI.cmake: > > Find JNI libraries and headers. I think this is the file from CMake > > itself. > > > > FindJava.cmake: > > Find all needed Java tools like javac, javadoc, jar, etc. > > > > UseJava.cmake: > > This file provides all needed function to support creating java > > projects in CMake. Most of the function are documented in detail. > > There is some documentation missing. I will add this soon. > > > > UseJavaClassFilelist.cmake: > > This is needed to find the class files in the build directory. One > > .java file can create multiple .class files. So you have to glob for > > these file. There is support to only look for certain .class files. > > > > UseJavaSymlinks.cmake: > > This is a helper to create symlinks for versioned jar files. > > > > git clone git://git.cryptomilk.org/projects/cmake-tools.git > > > > > > It would be nice if this would be included into the CMake distribution, > > but at the moment there is still documentation missing. I hope that this > > will help some people to get their Java project built with CMake. > > > > Comments, suggestions and patches are welcome! > > > > Best regards, > > > > -- andreas > > > > [1] https://fedorahosted.org/pki/browser/trunk/pki > > [2] http://pki.fedoraproject.org/wiki/PKI_Main_Page -- Andreas Schneider GPG-ID: 8B7EB4B8 Red Hat a...@redhat.com Samba Team a...@samba.org ___ 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
Re: [CMake] CMake Java Support
On Wednesday 12 January 2011 15:32:08 Allen D Byrne wrote: > Andreas, Hi Allen, > Thanks for providing these files! I have finally been able to progress on > converting our java product to cmake. I have one suggestion: > > Add to the add_java function the classpath for the target; > > set(${_TARGET_NAME}_CLASSPATH > ".${CMAKE_JAVA_INCLUDE_PATH_FINAL}/${_TARGET_NAME}.jar" PARENT_SCOPE) You should use an absolute path here if it isn't one yet. But the . at the beginning look suspicous :) Do you want to create a patch for that? > I needed this on linux (uses ':' in classpath not ';' ) to do an add_test. > > Also two questions: > How do I get the jar files into an output folder for build/test (not > install task)? I think we would need to support this. We could support EXECUTABLE_OUTPUT_PATH if it is set. Then you copy the jar file to this directory too. > After I build my JNI Library with normal C process how do I connect the > java JAR to use the library? I'm not sure how to use INSTALL_JNI_SYMLINK? You need to set a version, else it will not work. Cheers, -- andreas -- Andreas Schneider GPG-ID: 8B7EB4B8 Red Hat a...@redhat.com Samba Team a...@samba.org ___ 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
Re: [CMake] CMake Java Support
On Friday 14 January 2011 16:32:16 you wrote: > Andreas, Hi Allen, > Thanks, I do have most everything working, setting the version was the > key! > Concerning the '.' at the beginning of my proposed patch, I added that > because the CMAKE_JAVA_INCLUDE_PATH_FINAL started with a seperator and I > didn't look into why. I find this 'set' command very useful and I suggest > you consider adding it (with or without the leading '.'). Note that I > discovered a bug with Windows and the Visual Studio generator. The use of > CMAKE_JAVA_INCLUDE_PATH_FINAL in the add_custom_command changes the ';' > seperator into spaces - I think it needs to be escaped somehow - maybe the > CMake gurus have a suggestion? I'm not a java programmer and I haven't tested this stuff on Windows. Please tell which variables have the wrong ; or : or whatever and what it should look like. I already did some things to get it working on Windows but never tested. The more details you give the easier it is to fix. If you could print out the variables I could try to fix it and add what you need. -- andreas -- Andreas Schneider GPG-ID: 8B7EB4B8 Red Hat a...@redhat.com Samba Team a...@samba.org ___ 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
[CMake] problem getting defines quoted properly
Hi, I'm trying to set a define so that it can be used as string-literal in C++ code using add_definitions. This: add_definition( -DMYFOO=\"BAR BAZ\" ) works fine on linux, but breaks with MSVC6 on windows. I always thought I understood cmake's quoting rules, but apparently I'm wrong :( I've already tried: add_definition( -DMYFOO=\\\"BAR BAZ\\\" ) What I didn't think of trying when I was at the machine is add_definition( -DMYFOO=\\"BAR BAZ\\" ) Would that be the correct one? Or do I need even more \? Andreas -- You had some happiness once, but your parents moved away, and you had to leave it behind. ___ 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
Re: [CMake] problem getting defines quoted properly
On 14.01.11 21:57:39, Michael Hertling wrote: > On 01/14/2011 08:25 PM, Andreas Pakulat wrote: > > Hi, > > > > I'm trying to set a define so that it can be used as string-literal in > > C++ code using add_definitions. This: > > > > add_definition( -DMYFOO=\"BAR BAZ\" ) > > > > works fine on linux, but breaks with MSVC6 on windows. I always thought > > I understood cmake's quoting rules, but apparently I'm wrong :( > > > > I've already tried: > > add_definition( -DMYFOO=\\\"BAR BAZ\\\" ) > > > > What I didn't think of trying when I was at the machine is > > add_definition( -DMYFOO=\\"BAR BAZ\\" ) > > > > Would that be the correct one? Or do I need even more \? > > No, you probably need a configured header. ;) Not an option at this point as that would require source-code changes, which I cannot justify right now. > The documentation of ADD_DEFINITIONS() states > > "Flags beginning in -D or /D that look like preprocessor definitions are > automatically added to the COMPILE_DEFINITIONS property for the current > directory." > > and from the COMPILE_DEFINITIONS directory property's documentation: > > "The VS6 IDE does not support definition values with spaces..." > ^^^ Sorry, I guess I should've added that I'm using NMake Makefiles, so the above shouldn't apply. And at least cl.exe is capable of getting values with spaces as the existing build-system does exactly that ;) The problem is that in the generated file thats passed to cl (btw. is there a way to let cmake not delete this file so I can look into it) the qupting is incorrect and hence cl considered "BAZ" a source file instead of part of a define. Andreas -- Tomorrow will be cancelled due to lack of interest. ___ 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
Re: [CMake] Tips on cmake with git submodules?
On 14.01.11 14:56:22, James C. Sutherland wrote: > The recent thread on ctest and git submodules made me start considering > using submodules in a few projects. My question is how to integrate the two > build systems (both cmake based). > > Right now I do a find_package() to resolve the dependent library. If I move > to a submodule, and both the superproject and subproject are cmake-based, is > there any recipe for how to make them play nice? add_subdirectory() and build the submodule as part of the superproject. Make sure that the submodule also builds standalone and is not influenced by stuff set in the super-project (move the add_subdirectory to the top of the cmakelists.txt). Thats all I can think of right now. Andreas -- Don't tell any big lies today. Small ones can be just as effective. ___ 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
Re: [CMake] libtool to cmake static-libs combine howto
On 16.01.11 16:48:52, luxInteg wrote: > Greetings > > > suppose one had a libtool project that did the following Please search for cmake and 'convenience libraries', there's info about this in the FAQ and in the archive of this list. Basically: Don't use them, add the source files directly to the shared library target and link it against all dependencies. Andreas -- You are magnetic in your bearing. ___ 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
Re: [CMake] problem getting defines quoted properly
On 14.01.11 20:25:25, Andreas Pakulat wrote: > Hi, > > I'm trying to set a define so that it can be used as string-literal in > C++ code using add_definitions. This: > > add_definition( -DMYFOO=\"BAR BAZ\" ) > > works fine on linux, but breaks with MSVC6 on windows. I always thought > I understood cmake's quoting rules, but apparently I'm wrong :( > > I've already tried: > add_definition( -DMYFOO=\\\"BAR BAZ\\\" ) > > What I didn't think of trying when I was at the machine is > add_definition( -DMYFOO=\\"BAR BAZ\\" ) > > Would that be the correct one? Or do I need even more \? It just turned out that the problem was not the above, in particular since I require version 2.8 which sets CMP0005 to NEW. Hence cmake takes care of proper quoting itself. The problem was rather an earlier add_definitions line which tried to set a define that included a semicolon. Apparently that is something that make cmake create completely bogus CXX_DEFINES lines in the flags.make file. I've reported a bug about that now. Andreas -- Chess tonight. ___ 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
Re: [CMake] VS resource compiler preprocessor defines
On 18.01.11 14:11:15, "Sören Freudiger" wrote: > Hello > Right now the CXX preprocessor defines are also used as the preprocessor > defines for the resource compiler (rc). Is there a way of changing that > behavior? We are using different preprocessor defines for cl and rc. And > sometimes we even connot use the cxx flags for the rc compiler... > > Any idea? If you don't use add_definitions, but instead use set_target_properties with COMPILE_DEFINITIONS and set_source_properties then you should be able to set completely different defines for the .rc source files than the rest of the same target. Andreas -- Never look up when dragons fly overhead. ___ 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
Re: [CMake] VS resource compiler preprocessor defines
On 18.01.11 15:01:13, "Sören Freudiger" wrote: > hmm.. okay. That means I have to set the target properties for the cxx files > like this: > > > add_executable( ${MY_PROJECT} WIN32 ${SOURCE_FILES} ) > set_target_properties( ${MY_PROJECT} PROPERTIES COMPILE_DEFINITIONS > ${MY_CXX_PRE_DEFS}) > > with MY_CXX_PRE_DEFS: DEF1;DEF2;DEF3 Either this, or using a cmake list as MY_CXX_PRE_DEFS. > But what's about the rc defines? Do I have to set the target properties for > each file??? set_source_files_properties takes a list of files, so you can specify all .rc files that should get different flags there. Andreas -- Advancement in position. ___ 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
Re: [CMake] Restrictions on where a binary can be put?
On 21.01.11 01:37:41, Michael Hertling wrote: > So, what's your conclusion in this matter? Should the behavior in > question be considered as a bug or is it alright? IMO, such a subtle > side effect of a read operation on a subsequent write operation is at > least highly surprising. Besides, does one have to take this phenomenon > into account elsewhere, i.e. when saying > > GET_TARGET_PROPERTY( X) > ... > SET_TARGET_PROPERTIES( PROPERTIES Y ...) > > with X!=LOCATION and Y!=RUNTIME_OUTPUT_DIRECTORY, is it assured that > the latter command works as expected? Are directory or source files > properties possibly affected, too? Check the bugreport I mentioned further up in the thread. The docs have been expanded to mention this problem with LOCATION and RUNTIME_OUTPUT_DIRECTORY. As far as I understood Brad in the report its unique to those properties defining where a target ends up on disk (and how). And indeed (as he said also) changing the output directory _after_ querying it (via LOCATION) hints towards a bug in your cmake code, after all whatever you did with LOCATION is void if you change the output directory again and you'd have to re-run that code. Andreas -- Don't read everything you believe. ___ 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
Re: [CMake] Produce only an object file (*.o) from a CMake build target
On 24.01.11 09:37:01, Helseth, Nicholas H wrote: > I'm trying to build an object file using CMake, but I can't seem to > get CMake to build something other than a complete executable. I'm > basically looking for the result of the following compilation (the > result will be loaded on a VxWorks target and linked then-it needs to > be a *.o because of the way our build system works): You can't do this with cmake. Andreas -- You will be run over by a beer truck. ___ 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
Re: [CMake] directory traverse guidance
On 25.01.11 02:57:27, luxInteg wrote: > Greetings > > I am learning cmake > > consider my project with two directories dir1 and dir2 > > if I want to:- > move to dir1 and add a library libA in dir1 > move to dir2 and add a library libB in dir2 > move back to dir1 and add a test testA in dir1 > move back to dir2 and add a test testB to dir2 > > > (the moving back is because of the interdependencies of the tests with the > libraries i.e. testA reaquires libB etc)) > > how do I do this? You don't. All you need is 2 CMakeLists.txt, one in dir1 with libA and testA targets and the other in dir2 with libB and testB targets. CMake as a declarative language (to a certain extent) does not depend on the order in which you declare targets and use them. Andreas -- Just to have it is enough. ___ 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
Re: [CMake] directory traverse guidance
On 25.01.11 19:09:23, luxInteg wrote: > On Tuesday 25 January 2011 07:53:24 Andreas Pakulat wrote: > > On 25.01.11 02:57:27, luxInteg wrote: > > > Greetings > > > > > > I am learning cmake > > > > > > consider my project with two directories dir1 and dir2 > > > > > > if I want to:- > > > move to dir1 and add a library libA in dir1 > > > move to dir2 and add a library libB in dir2 > > > move back to dir1 and add a test testA in dir1 > > > move back to dir2 and add a test testB to dir2 > > > > > > > > > (the moving back is because of the interdependencies of the tests with > > > the libraries i.e. testA reaquires libB etc)) > > > > > > how do I do this? > > > > You don't. All you need is 2 CMakeLists.txt, one in dir1 with libA and > > testA targets and the other in dir2 with libB and testB targets. CMake > > as a declarative language (to a certain extent) does not depend on the > > order in which you declare targets and use them. > > > Before I made my posting, I tried a setup (as you suggested) but with more > than two directories -lets call this N > > my extended setup had dir1 ..dirN > each with > add_library(someLIB ${sourceFiles(1...N)}) > add_depedencies(someLIB someTEST) So your library depends on the test? This doesn't look like it makes much sense. Also cmake will already take care of dependencies via target_link_libraries. > then > add_test(someTEST someFILE(1...N).c ) This is actually not going to do anything useful, add_test expects an executable or the name of a target created by add_executable. > Basically I have to build a set of tests after building some static libraries > > and some of these tests require linking to libraries that occur much later > in the build-scheme. {In other words libA.a might be built and testA > (built > in the same directory as liba.A} but it requires linking not only to > libA.a > but to the 'later-built' libN.a) As I said, this works just fine if you let cmake handle the dependencies via add_library+add_executable+add_test. If you still can't make it work, please try out the attached project and try to make it break by adding more targets, dependencies or source files and then post the resulting project. Andreas -- Learn to pause -- or nothing worthwhile can catch up to you. cmdep.tar.gz Description: Binary data ___ 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
Re: [CMake] CMake performs search for includes/libs in non-default compiler search paths.
On 27.01.11 16:13:09, arrowdodger wrote: > Hello. On FreeBSD everything, that distributes with system goes to /usr (i > mean includes go to /usr/includes and libs to /usr/lib) and all 3d party > stuff goes to /usr/local. > And the compiler is intentionally set to look only in /usr/include. The same > is for linker - it's looking for libs only in /usr/lib by default. So, if > user want to use some 3d-party library, he should add -I/usr/local/include > and -L/usr/local/lib to build command. > > Now, i'm using find_library() and find_path() to locate 3d-party library in > such way: > > > find_path(FFI_INCLUDE_PATH ffi.h PATHS ${USER_DEFINED_INCLUDE_DIR}) > > find_library(FFI_LIBRARY_PATH ffi PATHS ${USER_DEFINED_LIB_DIR}) > > > I'm expecting that search will not succeed until i supply CMake with > additional directories to search. But it's succeeds because > CMAKE_SYSTEM_PREFIX_PATH from Modules/Platform/UnixPaths.cmake is set to > "/usr;/usr/local;/". And this file is included by > Modules/Platform/FreeBSD.cmake. > > Later i'm doing: > > > if(${USER_DEFINED_INCLUDE_DIR}) > > include_directories(${FFI_INCLUDE_DIR}) > > endif() > > > > On FreeBSD it leads to "No such file or directory: ffi.h" error. So here is > the question: Is this a CMake bug? No, the bug is in your cmake code. You shouldn't use USER_DEFINED_INCLUDE_DIR to decide wether to add the path to the include-directories or not. Instead use the FFI_INCLUDE_PATH variable to decide that, it won't hurt if FFI_INCLUDE_PATH happens to be /usr/include. The reason cmake searches in /usr/local in addition to /usr is simply a convenience matter. Its a common prefix to have non-distribution software installed in and for the same reason things like /opt/local, /opt/csw and /usr/openwin are being searched for by default. Andreas -- Beware of a dark-haired man with a loud tie. ___ 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
Re: [CMake] CMake performs search for includes/libs in non-default compiler search paths.
On 27.01.11 20:08:06, Óscar Fuentes wrote: > Michael Wild writes: > > IMHO you're the one trying to jump through hoops that aren't even there... > > Okay, so if I have this: > > check_include_file(foo.h HAVE_FOO_H) > > and it succeeds, I have no guarantees that a program such as this: > > #include "foo.h" > > will compile, becasue foo.h may be found on a directory not included on > the compiler's default search list. Actually, thats wrong. If you look at the check_include_file macro you'll notice that it uses try_compile. That in turn (as documented in man cmake) creates a cmakelists.txt which only adds include dirs set via the INCLUDE_DIRECTORIES variable passed into the internal cmake call and otherwise just uses a simple add_executable() call for the source. The convenience paths are only added to things such as find_path, find_library etc. They are _not_ added to compiler invocations automatically. Hence the above check_include_file would fail if foo.h is in /usr/local/include and your compiler does not search there by default. So you'd need to either set CMAKE_REQUIRED_INCLUDES or use find_path and then add the director to include_directories(). > We end having something like /usr/local/include (or /opt/local/include > or /opt/pkg/include etc) on the search list. > > We now test for the presence of some third party library ("thelib"). We > have an user-settable variable for using just in case we want to use an > specific install, and we use it: > > cmake -DTHELIB_IS_HERE=/home/oscar/thelib . > > The search mechanism for thelib looks into that directory first and > succeeds, as it should. We add the corresponding directory: > > include_directories( ${THELIB_INCLUDE_PATH} ) > > But there is another install of thelib on /usr/local, and that install > is the one that will be used by our build because we end having this > search list: > > /usr/local/include /home/oscar/thelib/include This has nothing to do with the default paths of the compiler, all you need to do with this is fix the order of include's of your target or source files. You'd run into compile problems (or compiling against the wrong lib version) no matter wether cmake searches in /usr/local/include for foo.h or not - unless you actually wanted cmake to _not_ find the foo.h header at all. If you want to ensure that /home/oscar/thelib/include is being searched before /usr/local/include then use include_directories with its BEFORE parameter so it ends up at the front of the list. This is the same thing if you'd create the compiler command yourself in a shell. Andreas -- You will be called upon to help a friend in trouble. ___ 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
Re: [CMake] Wrong linking at run time.
On 30.01.11 19:14:50, Avanindra Singh wrote: > Hi All, > > I have a cmake project currently on UNIX plaform. When I run the project, > some of the codes of Qt try to link jpeg lib which I have built as static > lib under the project. Ideally it should reference > Qt's own jpeg library. How can I avoid this conflict? This does not really have anything to do with CMake, you just need to link your Qt against that static jpeg lib. Look at compiling in the image plugins statically into Qt, I'm not sure though wether this will really link against a static jpeg lib. Andreas -- You're definitely on their list. The question to ask next is what list it is. ___ 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
Re: [CMake] Finding dynamic libraries with major interface revision numbers
On 30.01.11 13:43:13, Jack Poulson wrote: > Hello, > > I am having a hard time figuring out what the appropriate method is for > getting cmake to find a library of the form /usr/lib/libgfortran.so.2. > Unfortunately, it is fairly common for /usr/lib/libgfortran.so not to exist. > I am fairly certain that forming /usr/lib/libgfortran.so as a symbolic link > would solve the problem, but I obviously cannot assume that the user has > administrator privileges. Actually, noting having the .so or a symlink of that name suggests a broken installation. The 'pure' .so file is usually only included in the development packages, as its only necessary when building software against the shared library. Hence lacking that file, suggests that also headers are missing and possibly more things. > The find_library documentation for CMake 2.8 does not seem to specify how > NAMES can be used to specify the library extension. The following does not > find /usr/lib/libgfortran.so.2 when GFORTRAN_LIB_DIR_HINT is set to > /usr/lib: You can't, your gfortran installation is not complete (in terms of linking to it), so fix that and then cmake will just fine the .so file. Andreas -- You should emulate your heros, but don't carry it too far. Especially if they are dead. ___ 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
Re: [CMake] Compiler definitions for shared and static builds
On 31.01.11 17:18:58, Louis Hoefler wrote: > Hello everyone, > I try to generate a cmake project and want to > build shared and dynamic libraries in one step. > > I therefore added two targets: > ADD_LIBRARY(${fox_default_libname} STATIC ${fox_cpp_files} > ${fox_h_files} icons.h icons.cpp) > ADD_LIBRARY(${fox_default_libname} SHARED ${fox_cpp_files} > ${fox_h_files} icons.h icons.cpp) > > Booth of them should have different compiler definitions. > How to set them explicitly for shared and static targets? > > I tried something like this: > SET_PROPERTY(TARGET ${fox_default_libname} >PROPERTY COMPILE_DEFINITIONS > ${fox_default_defines_static} > ) > > But the targets for shared and static builds need to have different names > (becouse the need different build directories though). > > Is there an elegant way to achive what I want? No, target names in cmake need to be unique within the same CMakeLists.txt at least (not sure if they need to be unique globally) and hence using 2 different names for the shared and static lib are necessary. Once you have that you can use set_target_properties with COMPILE_DEFINITIONS without any problem. Andreas -- Future looks spotty. You will spill soup in late evening. ___ 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
Re: [CMake] How to link a library?
On 02.02.11 13:18:49, Enrique Izaguirre wrote: > Hello, > > I have tried several ways to link an Api library to my project, but > everything I've done so far is unsuccessful. > > I have a .lib file named AdbWinApi.lib in the address > ${myProject_SOURCE_DIR}/android/development/windows/usb/api > > I am trying to link this library to myProject, first I used the following: > > find_library(AdbWin_LIBRARY > AdbWinApi.lib Remove the .lib here > ${myProject_SOURCE_DIR}/android/development/windows/usb/api There is at least PATHS missing here, see the cmake manual for details. > ) > then I used a simple way to assert it was found: > > if (${AdbWin_LIBRARY}) > message (STATUS "AdbWin library found") > target_link_library (myproj ${AdbWin_LIBRARY}) This should be target_link_libraries. > endif () > > but always it is unsuccessful. > > Even though it looks pretty straight forward, I have not been able to link > it. If you know the full path already, simply pass that to target_link_libraries, there's no need for the find_library call. Andreas -- You are number 6! Who is number one? ___ 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
Re: [CMake] CMake Java Support
On Wednesday, January 12, 2011 15:32:08 you wrote: > Andreas, > Thanks for providing these files! I have finally been able to progress on > converting our java product to cmake. I have one suggestion: > > Add to the add_java function the classpath for the target; > > set(${_TARGET_NAME}_CLASSPATH > ".${CMAKE_JAVA_INCLUDE_PATH_FINAL}/${_TARGET_NAME}.jar" PARENT_SCOPE) Wouldn't be set(${_TARGET_NAME}_CLASSPATH "${CMAKE_JAVA_CLASS_OUTPUT_PATH}/${_TARGET_NAME}.jar" PARENT_SCOPE) more correct on the end of the add_jar function? -- andreas ___ 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
Re: [CMake] CMAKE_INSTALL_PREFIX on Windows Machine
On 07.02.11 17:24:26, Holmes, David R. III, Ph.D. [RO RM1-24] wrote: > # In the CPack section > > IF(${CMAKE_INSTALL_PREFIX} MATCHES > ${CPACK_PACKAGE_INSTALL_DIRECTORY}) > > ELSE(${CMAKE_INSTALL_PREFIX} MATCHES > ${CPACK_PACKAGE_INSTALL_DIRECTORY}) > > STRING(REPLACE ${PROJECT_NAME} ${CPACK_PACKAGE_INSTALL_DIRECTORY} > dummy ${CMAKE_INSTALL_PREFIX} ) > > SET(CMAKE_INSTALL_PREFIX ${dummy} CACHE PATH "" FORCE) > > ENDIF(${CMAKE_INSTALL_PREFIX} MATCHES > ${CPACK_PACKAGE_INSTALL_DIRECTORY}) Thats your problem right there. Whenever CMAKE_INSTALL_PREFIX is not the same as the CPACK_PACKAGE_INSTALL_DIRECTORY its reset to be the same using FORCE which means whatever was there in the case is overwritten. Looks like the author does not want anybody to change the install prefix once its been set. Andreas -- Be careful! Is it classified? ___ 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
Re: [CMake] CMake Java Support
On Saturday 05 February 2011 16:04:15 Allen D Byrne wrote: > Yes! That is where I meant! (dang email doesn't read minds properly:) there is already ${_TARGET_NAME}_JAR_FILE which is exactly what you want. > BTW, I have a problem I couldn't fix. When doing an add_jar with source in > the current dir and resource files (image files) in a sub-directory, the > resource files in the jar are at the class base instead of below. Example; > > Want: > x.jar > classpath1 > -classpath2 > classA > images > Z.img > > Get: > x.jar > classpath1 > -classpath2 > classA > images > ---Z.img I think then you have to move the images to the right location. Resource files are just copied to the same location as in the source dir. They are not magically moved. -- andreas -- Andreas Schneider GPG-ID: 8B7EB4B8 Red Hat a...@redhat.com Samba Team a...@samba.org ___ 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
Re: [CMake] linking static vs dynamic
On 12.02.11 21:20:58, Dominik Szczerba wrote: > I never actually saw a solution to this problem in cmake: > I need to link (independent constraint from above) with libguide.a and > not libguide.so (in intel compiler, does not matter much), but both > are available, and cmake always takes the shared one when given > "guide" as the desired library to be linked. > Is there an elegant way of static linking (other than -static passed > to the linker for static linking of everything) of this particular lib > other than hacking (like deleting the .so from the folder)? No, i.e. no elegant way. What you can do is force cmake to search only for .a files by setting a cmake variable, unfortunately I don't remember which one and can't easily find it right now. The archive of this list has more info as well as the cmake manual or the FAQ on the cmake website. Andreas -- You will gain money by an illegal action. ___ 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
[CMake] Include-Dir order problem
Hi, I've got a somewhat tricky problem here with include directories. I'm building a couple of source files and for some of them I need to add an include-directory to the front of the list that cmake passes to the compiler. At the same time other source files in that directory need to not have that include-dir in front of the list. I can't see a way to do this, except by using COMPILE_FLAGS source file properties for each and every file to specify include-dirs and not use include_directories at all, as COMPILE_FLAGS always end up behind the includes. So, am I missing something here? If not I guess I'll have to find that bugreport about making include-dirs a source-file property and vote for it so it gets included into 2.8.5... Andreas -- Be careful! Is it classified? ___ 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
Re: [CMake] FIND_PATH issue in FindQt4.cmake
On 14.02.11 16:18:09, Clinton Stimpson wrote: > On Monday, February 14, 2011 03:27:11 pm Harinarayan Krishnan wrote: > > Hi All, > > > > I was trying to build the VisIt software package on my Mac OSX 1.5 . This > > package uses Qt 4.6.1 during its build. I ran into an issue where the > > QtCore path finds my globally installed version of Qt (4.7) as apposed to > > the Qt (4.6.1). > > > > While digging around I found that FIND_PATH (code included below) in > > FindQt4.cmake is pulling information from the system path and assigning > > this value to the QT_QTCORE_INCLUDE_DIR. This is causing a build failure > > where the rest of the QT headers are using 4.6.1 and QtCore is using > > version 4.7. > > > > The value in ${qt_headers} points to the correct 4.6.1 location yet > > FIND_PATH does not use this parameter. Any ideas? > > > > > > _qt4_query_qmake(QT_INSTALL_HEADERS qt_headers) > > SET(QT_QTCORE_INCLUDE_DIR NOTFOUND) > > FIND_PATH(QT_QTCORE_INCLUDE_DIR QtCore > >HINTS ${qt_headers} > >${QT_LIBRARY_DIR}/QtCore.framework/Headers > >PATH_SUFFIXES QtCore > >) > > > > Ok, I'm able to reproduce this problem. > I did notice that if I add the NO_CMAKE_SYSTEM_PATH option, then the problem > goes away. But, I thought HINTS had a higher priority than paths from the > Mac's platform files. > And, I don't see this problem on Linux. > Is this a bug in find_path() ?? Definetly, the only thing that has higher priority than HINTS are values from the cmake or environment variables CMAKE_PREFIX_PATH, CMAKE_INCLUDE_PATH and CMAKE_FRAMEWORK_PATH. There's no special behaviour for MacOSX documented. Someone should file a bugreport after verifying this still happens with the latest rc of 2.8.4. Andreas > -- > Clinton Stimpson > Elemental Technologies, Inc > Computational Simulation Software, LLC > www.csimsoft.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 > -- The time is right to make new friends. ___ 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