<div dir="ltr"><div><div><div><div><div><div><div><div><div><div>Hello!<br><br></div>I would like to know your thoughts on adding a CMake build system as the one in my fork here:<br><a href="https://github.com/TNick/ccan">https://github.com/TNick/ccan</a><br>
</div>(Note: at least on my machine code does not compile without hacks, probably because of include paths; it is meant as an example for now)<br><br></div>This would make including ccan in a CMake driven project trivial. Here's how I imagine it:<br>
<br></div></div>mkdir ~/test_ccan<br>cd ~/test_ccan<br></div>git init<br></div>touch CMakeLists.txt<br></div>git submodule add git@github.com:rustyrussell/ccan.git ccan<br><br></div>Now in CmakeLists.txt:<br><br>set( PROJECT_NAME ccan_test )<br>
project(${PROJECT_NAME})<br>add_subdirectory( "ccan" )<br>add_executable( ${PROJECT_NAME} main.c)<br>target_link_libraries( ${PROJECT_NAME}<br> ccan_time<br> ccan_cpuid<br> ccan_antithread<br>)<br>add_dependencies ( ${PROJECT_NAME}<br>
ccan_alignof<br>)<br><br></div>The system only builds only those modules that are actually needed. There are, of course, many things to add (libccan, examples, tests, the junk code, definitions in <a href="http://config.h.in">config.h.in</a>).<br>
<div><div><br></div><div>One important issue is that many (all?) modules require a config.h file in source directory to be created. The cmake build system will throw it in build directory. When including a header that requires config.h, the compiler will pick the header from current target.<br>
<br></div><div>The question is, basically, if you are interested in adding this and further enhancements to main repo or I should keep it as a fork.<br></div><div><br></div><div>On a different note, I couldn’t find a one page index of all modules (probably because of a lack of skill) so I've created one: <a href="http://tnick.github.io/overview/2014/03/05/ccan.html">http://tnick.github.io/overview/2014/03/05/ccan.html</a><br>
<br></div><div>Have a great day!<br></div><div>Nicu<br></div></div></div>