← Back to team overview

elementary-dev-community team mailing list archive

GTK-Ready Application Project Template

 

Hi everyone,

After much struggling with CMake and various tutorials around the 'net, I
decided to go ahead and build a bare-bones CMake vala application template.
I tried to follow the Elementary tutorial as closely as I could (however,
the tutorial version I found via Google omits critical components like
setting up Vala CMake macros), so it should work for developing Elementary
apps. Basically, this template exists for folks like me who can't make
CMake yield to their will. Because I'm no CMake wizard, I'm sure it's far
from perfect, and I'm open to suggestions on how to improve it, but I hope
some people will find it useful.

Here are some instructions:

1) Get it from https://bitbucket.org/craig_weber/cmake-vala-template/ (I'm
not sure if I've made this public--if not, please let me know and I'll
correct it)--it's available in zip, gz, and bz2 formats or you can clone it
via mercurial if you so desire.

2) Open the root CMakeLists.txt file and change the 'multifileproj' in the
line "set(PROJECT_NAME multifileproj)" to the name of your project

3) In src/CMakeLists.txt, add any project dependencies in the dependency
lists (basically anywhere you see a reference to gtk+-3.0)

4) To build, navigate to the project's root directory and type:
mkdir build
cd build
cmake ..
make

5) Your executable will be in build/src/ (I have no idea why)

If you have any problems, questions, concerns, suggestions, or accolades,
please don't hesitate to email me.

Thanks,
Craig

Follow ups