[IPOL discuss] 2 cmake questions

Pierre Moulon pmoulon at gmail.com
Mon Nov 28 09:10:04 CET 2011


Hi Nicolas,


2011/11/28 Nicolas Limare <nicolas.limare at cmla.ens-cachan.fr>

> Hi,
>
> I am trying to write a basic CMake configuration.
>
> 2 questions:
> * I find `mkdir build; cd build; cmake ../; cd ../` quite
>  annoying. Isn't there a cmake command-line option to tell where the
>  build dir is?
>

you could do
$ mkdir build
cmake BUILD_PATH SRC_PATH
$ cmake ./build ./

* The default Makefile produces by cmake has no option to cleanup
>  everything (Makefile, CMakeCache.txt, CMakeFiles,
>  cmake_install.cmake). How do I remove everything produced by cmake,
>  without doing it manually?
>

$ cmake clean
will remove compilation objects
$ cmake distclean
remove all the generated file from cmake



> PS: Two important informations were missing for me in the cmake
> tutorial in the IPOL wiki:
> * we use add_executable() to list *all* the source for an executable
> * target_link_libraries() is also for libraries installed on the
>  system
>

I will add those information. Thanks.
But I prefer to not use installed libraries for the tutorial because,
supposing installed libraries means that we are system configuration
dependent.

So far, I am disturbed by cmake hiding all the transformation path
> from source to executable and the notions of object file and separate
>  compilation.
>

It's a build system so it changes a bit. The only things to understand is
that configuration is handle by simple macro.
Each registered file in cmake will give object files so it's like classical
CMAKEFILE.

Regards,
Pierre

>
> --
> 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)
>
> iEYEARECAAYFAk7S/uoACgkQvviFAPpCP08UIgCdGKrmoLh2/F60Sny7ttHrn2Bv
> AKcAnRGWJuhNsc7+/2DYskyev9fgZZ23
> =MsMZ
> -----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/dcfa38b0/attachment.html>


More information about the discuss mailing list