Cmake Question

John Ralls jralls at ceridwen.us
Tue Sep 26 16:43:17 EDT 2017


> On Sep 26, 2017, at 1:26 PM, Robert Fewell <14ubobit at gmail.com> wrote:
> 
> Hi,
> 
> I have managed to convert the use of css files to using a gresource file
> that gets compiled in and thought it would be good idea to use css files
> when compiled with DEBUG enabled.
> So I moved the two css files to the gnucash directory and added #ifdef
> DEBUG statements to gnc-gnome-utils.c to enable using css files but wanted
> to only copy them when in DEBUG so added this to CmakeLists.txt
> 
> IF(CMAKE_BUILD_TYPE MATCHES DEBUG)
>   FILE(GLOB CSS_FILES "*.css")
>   FILE(COPY ${CSS_FILES}
>      DESTINATION ${DATADIR_BUILD}/gnucash/ui)
>   INSTALL(FILES ${CSS_FILES}
>      DESTINATION share/gnucash/ui)
> ENDIF(CMAKE_BUILD_TYPE MATCHES DEBUG)
> 
> which does not work, removing the if/endif does copy them so that is OK, if
> I add the following to the top level CmakeLists.txt
> 
> SET (CMAKE_BUILD_TYPE DEBUG)
> 
> it works, so how should that be set ?
> 
> There is this line in the file...
> 
> OPTION (ENABLE_DEBUG "compile with debugging flags set" OFF)
> 
> Should that then do the SET ?

The normal way to turn on debugging is -D CMAKE_BUILD_TYPE=Debug on the command line. Since "ENABLE_DEBUG" doesn't seem to be used anywhere I think it's a no-op and should be removed.

Regards,
John Ralls



More information about the gnucash-devel mailing list