[CMake] create pc pkgconfig file when installing

Christophe Alexandre christophe.alexandre at lip6.fr
Mon Jan 28 12:24:01 EST 2008


Hi all,

How can I dynamically create a tool.pc pkgconfig file for my tool  
while installing it.
I need to set a variable to the install destination : prefix=@DEST_DIR@
and in my CMakeLists.txt, I use : set(DEST_DIR "$ENV{DESTDIR}")
and then a CONFIGURE_FILE directive.

My problem is that the tool.pc file is created when I run make without  
DEST and is not replaced when I run make DEST=foo

Is there a proper way to generate the .pc file each time I install my  
tool.

Thanks in advance :).

Christophe


More information about the CMake mailing list