[CMake] Adding support for new languages to CMake

Alan W. Irwin irwin at beluga.phys.uvic.ca
Fri Oct 17 15:30:24 EDT 2008


On 2008-10-17 12:34-0600 Eric (Brad) Lemings wrote:

> Eric (Brad) Lemings wrote:
>> Alan W. Irwin wrote:
>>
>>> On 2008-10-16 18:08-0600 Eric (Brad) Lemings wrote:
>>>
>>>
>>>> Where can I find info/tutorials on adding support for new languages to
>>>> CMake?
>>>>
>>> The following is pretty minimal, but I think this is all there is at the
>>> moment.
>>>
>>> Look at Modules/CMakeAddNewLanguage.txt in the CMake source tree. Pick a
>>> language you are familiar with and uses its support files in Modules and
>>> Modules/Platform as a template for your own work. You may also want to
>>> look
>>> at the CMake source code to confirm how CMake interacts with those
>>> various
>>> language support files.  Ask for help on this mailing list when you run
>>> into some difficulty.
>>>
>> Does CMake require that additional language support files (e.g.
>> CMakeDelphiCompiler.cmake.in,
>> CMakeDelphiInformation.cmake, CMakeDetermineDelphiCompiler.cmake,
>> CMakeTestDelphiCompiler.cmake) reside in ${CMAKE_ROOT} or can CMake
>> be instructed to locate them in ${CMAKE_MODULE_PATH}?  If so, how?
>>
> Umm, setting CMAKE_MODULE_PATH before your `package` command?  :)

No, unless I missed something in the past that doesn't seem to work.
CMAKE_MODULE_PATH is not accessible at language support time as far as I could
tell.

Instead, what you have to do is a temporary change in one of the language
support files defining CMAKE_MODULE_PATH so the support files will work in
the ${CMAKE_MODULE_PATH} region.  Look for FIXME in the PLplot Ada language
support file
http://plplot.svn.sourceforge.net/viewvc/plplot/branches/test_cmake/test_ada/cmake_working/Modules/CMakeTestAdaCompiler.cmake
for where you have to make the change, and where I would have to change it
again to get the Ada support files to work in another location such as
${CMAKE_ROOT}.

To make things clearer for those looking at that simple Ada CMake language
support test project, I have just renamed some directories to cmake_working
(which works both for cmake-2.4 and 2.6) and cmake_experimental (not done
yet) and double-checked that the simple "hello, world" Ada library and Ada
executable that calls that library function still runs using cmake_working
directory following the directions at
http://plplot.svn.sourceforge.net/viewvc/plplot/branches/test_cmake/test_ada/README.

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________

Linux-powered Science
__________________________


More information about the CMake mailing list