[CMake] How to set "Look for CMakeDetermine<Lang>.cmake here"

Chuck Atkins chuck.atkins at kitware.com
Mon Jul 28 14:52:11 EDT 2014


Hi David,

You can add to the search path CMake uses by appending to the
CMAKE_MODULE_PATH variable.  In your case, you'll probably want to set it
before the project command to make sure it's present for you're entire
project.  For example:

In your project, you create CMake directory where you would place
additional *.cmake files, such as your language files,or maybe even custom
Find modules.  Then in your top level CMakeLists file, you would have:

cmake_minimum_required(VERSION 2.8.12)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake")
project(MyAwesomeProject)

Now anytime CMake searches for any sort of *.cmake file, it will also
search the CMake folder in your source tree.

Hope that helps.
- Chuck


On Mon, Jul 21, 2014 at 7:32 PM, David Zemon <david at zemon.name> wrote:

> I am attempting to build an easy-to-use build system for an embedded
> system. This chip uses .dat, .spin, .cogc, and .ecogc files along with .S,
> .c, and .cpp. I've added the necessary language files to my project path
> which will enable cogc (I'll get to the other file types eventually) and
> they work great, but it requires manually linking or copying the files out
> of the project directory and into CMake's installation path. Is there some
> way to tell CMake that it should look for these files in a custom path?
>
> Thanks,
> David
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at http://www.kitware.com/
> opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20140728/b2960571/attachment.html>


More information about the CMake mailing list