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
- It uses CMake, which is cross platform.
- Automatic dependency resolving. This is especially useful, and is first supported by this project.
- Easy to use.
Version 2.8.3+ required, since
You need to setup environment variables
ATS-CMakeuse 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,
Copy those :index:`CMake modules` into CMake module dir.
Normally, the module dir is
/usr/share/cmake-x.x.x/Modules. You can find more information at CMake Website.
Start using it!
Suppose you have a small project containing
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 ...
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
>>> cd ./build >>> cmake .. ... >>> make ...
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.
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.