[CMake] CMake Completeness: The builder + installer.

Filipe Sousa filipe at ipb.pt
Sun Jan 29 20:04:17 EST 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Rodrigo Madera wrote:
> 
> You see, the way I use CMake today it requires a girlfriend:
> BuildProject.py. It's a nice Python script that does some magic to
> make CMake alive.

I think you can do most of things with cmake itself.

> Right now, my script does this:
> 
> * When called with no arguments, it generates the project files and
> then executes the build command, according to the platform in use.
> * When passed the "install" parameter, it installs under
> "C:\Libraries" in Windows or "/lib" if on Linux.

IF(WIN32)
  SET(CMAKE_INSTALL_PREFIX "C:\Libraries")
ELSE(WIN32)
  IF(UNIX)
    SET(CMAKE_INSTAL_PREFIX "/lib")
  ENDIF(UNIX)
ENDIF(WIN32)

> * When called with the "clean" parameter, it cleans all the
> intermediary CMake-generated files (quite a few, aren't they?)

You can do out-of-source builds and remove the build tree whenever you need.

> Since CMake has little documentation released on the net (or so it was
> a few days {or months} ago) I only have the classic build-related
> information. And the doubt that kills me is if I'm doing redundant use
> here or incorrectly using CMake (I hate misusing features).
> 
> Does CMake have anything resembling this?
> 
> After all, what are those "INSTALL" projects it creates under MSVC?

MSVC Generators creates a project per target. I still prefer one project
per PROJECT()

> Well, not that I want to spoil anything between CMake and his script
> friend, but if there is an easier or more straightforward way, it
> would be nice to know.
> 
> This has led us to almost start a project to interface CMake with, to
> create post-build rules like creating media ISO images and getting the
> product ready to ship in a one-liner.

You can use custom commands ADD_CUSTOM_COMMAND() and custom targets
ADD_CUSTOM_TARGET to create custom rules. You can also use OPTION() to
tell cmake if he should or should not create iso images. Use ccmake
(unix) or CMakeSetup (windows) to interface with the options.

> Thanks for the attention everyone, for now I'll go back to see what I
> have one day mistreated. Never again to be done.
> 
> Rodrigo
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
> 
> 


- --
Filipe Sousa
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFD3WYRbQdNYqwwwCwRAnXWAJ9xZk9b/w/k8I5ja141f+uRUcFDFwCeMVue
IrJxOdfwgfTfnQe8LmJSuY8=
=2DaA
-----END PGP SIGNATURE-----


More information about the CMake mailing list