[IPOL discuss] 2 cmake questions
Pierre Moulon
pmoulon at gmail.com
Mon Nov 28 17:30:16 CET 2011
I'm sorry you can't specify the output directory through the command line
without a specific options of the cmake 2.8.
By default it consider the current dir as output
You could use the following
$ cmake -E make_directory build
$ cmake -E chdir build cmake ../HelloWorld
$ cmake --build build
$ rm -rf ./build
=> http://www.cmake.org/cmake/help/cmake-2-8-docs.html#opt:--builddir
Something that you could like is the graphivz export of dependencies :
--graphviz=[file]: Generate graphviz of dependencies.
Generate a graphviz input file that will contain all the library and
executable dependencies in the project.
Regards,
Pierre
2011/11/28 Nicolas Limare <nicolas.limare at cmla.ens-cachan.fr>
> > This should not work, see note below [1]. The intended use for cmake
> > is to build in a different dir than the one containing the source
> > code. So, lets say you have the source in ./src and you compile in
> > ./build. You can safely do a 'rm -fr build/*' to get rid of
> > everything.
>
> OK for the concept of out-of-cource build, easy to cleanup with a
> simple rm -rf. But for such out-ou-source build, it seems that I HAVE
> to manually move to this build dir wth CD. The syntax provided by
> Pierre dows not create the cmake files in the build dir.
>
> I just want something like
>
> mkdir /path/to/build/
> cmake -option /path/to/build/ /path/to/src/
> ^^^^^^^^^^^^^^^^^^^^^^
> `-> would create CMakeFiles, CMakeCache,
> etc. in /path/to/build/
> make -C /path/to/build/
> rm -rf /path/to/build
>
> So far, it seems that cmake always create the CMakeStuff in the
> current directory.
>
> I think my two wishes are incompatible in the cmake world:
> * a want a command (a make, cmake or a simple rm) to cleanup everything
>
OK => since Cmake 2.8with --build option. Before you have to do
$ mkdir build
$ cd build
$ cmake ../helloWorld
$ make
* I want to manage all the build process without moving
>
OK
>
> --
> Nicolas LIMARE - CMLA - ENS Cachan
> http://www.cmla.ens-cachan.fr/~limare/
> IPOL - image processing on line
> http://www.ipol.im/
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
>
> iEYEARECAAYFAk7ThbYACgkQvviFAPpCP09VegCfW/tU03kTt4F7wUNxFrqg9ClI
> bNsAmgKnPjtpHZiVXtzWal0kK/UntwMV
> =DbP7
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> discuss mailing list
> discuss at list.ipol.im
> http://tools.ipol.im/mailman/listinfo/discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tools.ipol.im/mailman/archive/discuss/attachments/20111128/b3f73d35/attachment.html>
More information about the discuss
mailing list