[CMake] My nomination for least helpful CMake Error Message (CONFIGURE_FILE issue)

David Cole david.cole at kitware.com
Mon Nov 23 14:14:16 EST 2009


Perhaps you need a "*" before .xpm and .gif?
Perhaps the input files do not exist in "${SGICOMMONLIB_SOURCE_DIR}/"?
Perhaps you don't have write permission in
"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${DIRNAME}/" ?

For best results, I'd recommend using something like:
> FILE(GLOB DEFAULT_CONFIG_FILES "${full_dir_name}/*.xbm"
"${full_dir_name}/*.xpm" "${full_dir_name}/*.gif" "${full_dir_name}/*.tif"
"${full_dir_name}/*.pal" )

If you do not have the directory name in the globbing expression, then there
is an implied dir that it runs in... I am not sure if that implied dir is
CMAKE_CURRENT_SOURCE_DIR or current working directory or something else,
because I always use full path directory names in file glob input
expressions...


(But I will grant you that "Problem configuring file" is a pretty lame error
message...) :-)

HTH,
David


On Mon, Nov 23, 2009 at 1:29 PM, Eric Noulard <eric.noulard at gmail.com>wrote:

> 2009/11/23 kent williams <nkwmailinglists at gmail.com>:
> > CMake Error at common/CMakeLists.txt:83 (CONFIGURE_FILE):
> >   configure_file Problem configuring file
> >
> > The issue being the CONFIGURE_FILE command:
> >
> > PROJECT(SGICOMMONLIB)
> > #
> > # other stuff removed for brevity.
> > #
> > SET(DIRNAME pixmaps)
> > FILE(GLOB DEFAULT_CONFIG_FILES "*.xbm" ".xpm" ".gif" "*.tif" "*.pal" )
> > FOREACH(MODULE ${DEFAULT_CONFIG_FILES} )
> >  GET_FILENAME_COMPONENT(CURR_FILENAME ${MODULE} NAME)
> >  CONFIGURE_FILE(${SGICOMMONLIB_SOURCE_DIR}/${CURR_FILENAME}
> > ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${DIRNAME}/${CURR_FILENAME} COPYONLY
> > IMMEDIATE )
> >  INSTALL(FILES ${SGICOMMONLIB_SOURCE_DIR}/${DIRNAME}/${CURR_FILENAME}
> >                DESTINATION bin/${DIRNAME})
> > ENDFOREACH(MODULE)
> >
> >
> >
> -----------------------------------------------------------------------------------------------
> > I think the reason I'm having this trouble is that
> > CMAKE_RUNTIME_OUTPUT_DIRECTORY isn't defined.  But the error message
> > doesn't say anything useful.
>
> Almost true, you know at least where the problem is and you may add
> appropriate MESSAGE(...) to inspect concerned VAR values.
>
> May be you can suggest some output you would have found useful
> and may be file a bug report?
>
> --
> Erk
> Membre de l'April - « promouvoir et défendre le logiciel libre » -
> http://www.april.org
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20091123/49509da8/attachment.htm>


More information about the CMake mailing list