[Cmake] Comments, questions from my first CMake'd app

Ian Main ian-cmake at stemwinder.org
Tue Mar 18 18:02:31 EST 2003


On Tue, Mar 18, 2003 at 05:20:04PM -0500, Andy Cedilnik wrote:
> Hi Ian,
> 
> Try #cmakedefine VAR ${VAR} or #cmakedefine VAR @VAR@, whatever you
> prefer.

Ah yes, very good!

> > The problem I am currently stumped on is getting a 'config'
> > shell script to install as executable on unix.  I am generating
> > a roy-config shell script from roy-config.in, which when run
> > outputs the CFLAGS, libs etc needed to link with roy (just
> > like gtk, glib etc. use).
> 
> Use INSTALL_PROGRAM(/bin roy-config).

Yeah, I tried that, it ends up installing roy-config.in (but at
least it's executable!)  No idea why it does that though ..

I tried INSTALL_PROGRAMS(/bin/ ${ROY_BINARY_DIR}/roy-config) too
but it just seems to ignore that.

> > The last thing I am unsure of is how to do custom build commands.
> > I have a set of pod files that I use to generate manpages.. not
> > sure how to go about that one.
> 
> Use ADD_CUSTOM_COMMAND. For example:
> 
> # Need a custom target
> ADD_CUSTOM_TARGET(ManPages ALL)
> 
> # Need a rule to generate GenerateManPage.1 from GeneratedManPageInput
> ADD_CUSTOM_COMMAND(TARGET ManPages
>                    SOURCE
> ${CMAKE_CURRENT_SOURCE_DIR}/GeneratedManPageInput
> COMMAND whatever_command
> ARGS arguments_to_command -o
> ${CMAKE_CURRENT_BINARY_DIR}/GeneratedManPage.1
> ${CMAKE_CURRENT_SOURCE_DIR}/GeneratedManPageInput
> OUTPUTS ${CMAKE_CURRENT_SOURCE_DIR}/GeneratedManPageInput)
> 
> # This one will drive the previous one
> ADD_CUSTOM_COMMAND(TARGET ManPages
>                    SOURCE ManPages
>                    DEPENDS GeneratedManPage.1)

OK, I'll give it a whirl. 

Thanks for your help!

        Ian



More information about the CMake mailing list