View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002603CMakeCMakepublic2005-12-13 16:472006-01-03 16:41
ReporterAlex Neundorf 
Assigned ToKen Martin 
PrioritynormalSeverityfeatureReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0002603: support for #define HAVE_BLAH [0|1] for CONFIGURE_FILE()
DescriptionHi,

using #cmake_define it is possible to have config options like this with cmake:

#define HAVE_UNISTD_H
/* undef HAVE_UNISTD_H*/

Now there is also software where another style of config options is used:

#define HAVE_UNISTD_H 1
#define HAVE_UNISTD_H 0

This second style is currently not directly supported by cmake. The attached patch introduces a new CONFIGURE_FILE() keyword "#cmakedefine01" which adds this behaviour.

Alex
TagsNo tags attached.
Attached Filespatch file icon cmakedefine01.patch [^] (1,852 bytes) 1969-12-31 19:00 [Show Content]

 Relationships

  Notes
(0003497)
Bill Hoffman (manager)
2006-01-02 13:54

You can sort of do this now, as long as the variable in question is either 1 or 0, you can do:

#define HAVE_UNISTD_H @HAVE_UNISTD_H@

Do we need more syntax?
(0003498)
Alex Neundorf (developer)
2006-01-02 14:01

Unfortunately the macros CHECK_FUNCTION_EXISTS() and friends all use:

IF(${VARIABLE})
   SET(${VARIABLE} 1 CACHE INTERNAL)
   ...
ELSE(${VARIABLE})
   SET(${VARIABLE} "" CACHE INTERNAL)
...
ENDIF(${VARIABLE})

I.e. the variable is "1" on success and empty (instead of "0") on failure.
So of course it can be done right now, but only with an additional macro which changes the returned variable to "0" if it is empty. Adding a *_01 version of all these macros wouldn't be too nice, and changing the behaviour of the existing macros would probably break several CMakeLists.txt.

Alex
(0003508)
Bill Hoffman (manager)
2006-01-03 16:41

OK, I checked it in to cvs, along with a test in complex, seems to work, thanks.

 Issue History
Date Modified Username Field Change


Copyright © 2000 - 2018 MantisBT Team