CMake Proposal

Bill Hoffman bill.hoffman at kitware.com
Thu Feb 25 07:59:26 MST 2010


Seems that at this point there are 3 issues with CMake on the list.

1. --command line options
2. AC_CHECK_HEADERS.
3. The CMake language is not python

There is nothing that can really be done about 3.

However, both 1 and 2, are not so difficult to address.  For 2, the 
following CMake code should do the trick:

include(CheckIncludeFile)
function(cmake_ac_check_headers)
   foreach(file ${ARGN})
     string(REPLACE "." "_"  have_var "${file}")
     string(TOUPPER "${have_var}" have_var)
     check_include_file("${file}" "HAVE_${have_var}")
   endforeach()
endfunction(cmake_ac_check_headers)


cmake_ac_check_headers(foo.h bar.h car.h stdio.h)

produces these values in the CMake Cache:
$ grep HAVE CMakeCache.txt
HAVE_BAR_H:INTERNAL=
HAVE_CAR_H:INTERNAL=
HAVE_FOO_H:INTERNAL=
HAVE_STDIO_H:INTERNAL=1

I can make sure this goes into CMake soon, but you can use it today with 
no change or release of CMake required.

For 1, this has come up so many times, and is not really that hard to 
implement.  I can commit to getting this done in the master branch of 
CMake in the next month.   It most likely will not be in a release for 
another 6 months.  However, it is a bit of a cosmetic issue, as 
-Dfoo=bar or --foo=bar is really only different by one character.


-Bill


More information about the samba-technical mailing list