View Issue Details [ Jump to Notes ] | [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
0002603 | CMake | CMake | public | 2005-12-13 16:47 | 2006-01-03 16:41 | ||||
Reporter | Alex Neundorf | ||||||||
Assigned To | Ken Martin | ||||||||
Priority | normal | Severity | feature | Reproducibility | always | ||||
Status | closed | Resolution | fixed | ||||||
Platform | OS | OS Version | |||||||
Product Version | |||||||||
Target Version | Fixed in Version | ||||||||
Summary | 0002603: support for #define HAVE_BLAH [0|1] for CONFIGURE_FILE() | ||||||||
Description | Hi, 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 | ||||||||
Tags | No tags attached. | ||||||||
Attached Files | cmakedefine01.patch [^] (1,852 bytes) 1969-12-31 19:00 [Show Content] | ||||||||
Relationships | |
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. |
Notes |
Issue History | |||
Date Modified | Username | Field | Change |
Issue History |
Copyright © 2000 - 2018 MantisBT Team |