Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
97 lines (66 sloc) 3.42 KB

Welcome

This is a project aiming at developing a build tool for ATS. It is based on CMake. Currently, it provides some very useful CMake modules for ATS users to simplify building processes. In the near future, it will support downloading artifacts from a server to help you utilize third party ATS libraries.

The project is hosted on GitHub. Welcome to contribute.

Table of Contents

.. toctree::
   :maxdepth: 2

   examples
   inside
   cmake
   contacts

:index:`Features`

  • It uses CMake, which is cross platform.
  • Automatic dependency resolving. This is especially useful, and is first supported by this project.
  • Easy to use.

:index:`Quick Start`

  • :index:`Install CMake`. You can download them from CMake Website.

    Note

    Version 2.8.3+ required, since ATS-CMake uses CMAKE_CURRENT_LIST_DIR variable

  • :index:`Install ATS` from ATS Website.

    Note

    You need to setup environment variables ATSHOME and PATH properly. ATS-CMake use them to locate your currently available ATS binaries. For example:

    export ATSHOME=/cs/coursedata/cs320/ATS029
    export ATSHOMERELOC=ATS-0.2.9
    export PATH=$PATH:$ATSHOME/bin
    
  • Download this project from GitHub. Particularly, FindATS.cmake and ATSCC.cmake.

  • Copy those :index:`CMake modules` into CMake module dir.

    Note

    Normally, the module dir is /usr/share/cmake-x.x.x/Modules. You can find more information at CMake Website.

  • Start using it!

Hello World

Suppose you have a small project containing hello.sats, hello.dats and main.dats. Then, you need to write a CMakeLists.txt like the following

.. literalinclude:: quick-demo.cmake
   :language: cmake

After you have a correct CMakeLists.txt, we just need to invoke cmake. But please make sure that you have a correct project layout.

HelloWorld
|   CMakeLists.txt
|   hello.dats
|   hello.sats
|   main.dats
|
\---build
        ...

Note

I suggest using out-of-source :index:`build <single: out-of-source build>`, which makes everything clean, especially when you want to delete all temp files. See here for more information. I use a ./build dir for this purpose.

Now, go to ./build and invoke cmake. It will generate a makefile for you under ./build. You can invoke make now, to build the project as usual, and congratulations! The output binary will be under ./build

>>> cd ./build
>>> cmake ..
...
>>> make
...

Note

We use cmake .. because the present working directory is ./build, while the CMakeLists.txt is in the parent directory. Therefore, it is cmake .. instead of cmake .. Pay attention.

What's Next

In the followings, I will try to cover more use cases, and then look into what's happening in the CMake modules, so that you can better use them, and even help me develop it.