[CMake] use_mangled_mesa as a scriptable operation

Harinarayan Krishnan hkrishnan at lbl.gov
Thu Mar 3 10:46:52 EST 2011


Hi All,

I would like to be able to script the cmake compatibility command
use_mangle_mesa(mesapath/include/GL some_other_path).

For example:

%cat scriptfile
cmake_minimum_required(VERSION 2.8)
use_mangled_mesa(mesapath/include/GL some_other_path)
%cmake  -P scriptfile

Ultimately it would be nice to do
echo 'cmake_minimum_required(VERSION
2.8)\nuse_mangled_mesa(mesapath/include/GL some_other_path)'
| cmake -P /dev/stdin
or even
echo 'use_mangled_mesa(mesapath/include/GL some_other_path)' | cmake -P
/dev/stdin

The error from both these methods:

CMake Error at /dev/stdin:1 (use_mangled_mesa):
  Command use_mangled_mesa() is not scriptable

is there a reason why the function use_mangled_mesa is not scriptable?

My current solution is to create a tmp directory and a CMakeLists.txt with
the contents of use_mangled_mesa then execute it using cmake.

%cat CMakeLists.txt
cmake_minimum_required(VERSION 2.8)
use_mangled_mesa(mesapath/include/GL some_other_path)
%cmake .

This operation seems overkill for what I would like to do as it generates
CMakeFiles, CmakeCache.txt, and other files. Are there other alternatives
that do not require running a full cmake on CMakeLists.txt in order to run a
simple cmake compatibility command operation?

A simple test that I can do:
echo 'cmake_minimum_required(VERSION 2.8)\nMESSAGE( "${INPUT_X}" )' | cmake
-DINPUT_X=abc -P /dev/stdin
or
echo 'MESSAGE( "${INPUT_X}" )' | cmake -DINPUT_X=abc -P /dev/stdin
and I get a correct response from cmake. I would like to replace MESSAGE
with use_mangled_mesa.


Thanks,
Hari
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20110303/5bc0b383/attachment.htm>


More information about the CMake mailing list