2018-08-02 10:59:20 UTC
Fossil code -- I just pushed a CMake project that handles the Fossil
In case you wonder, the build is done via CMake
`ExternalProject_Add()`. So, basically, it kind of wraps the current
autosetup-based Fossil build without duplicating the dependencies. It
was also possible to unify the current Linux and Windows (MSVC)
The rationale is to leverage the usual IDE conveninces such as code
browsing, auto-complete, visual debugger etc. Also, having a Fossil
source control plugin helps navigating the changes.
CMake project can be generated into Makefiles or native projects for
some IDEs. Most major C/C++ IDEs handle CMake one way or another. So
far I tested building CMake Fossil with QtCreator, Code::Blocks,
Eclipse CDT, and VSCode -- basically free and open source IDEs. Also I
know that CLion has a good CMake support, and recently VisualStudio
promoted better CMake integration, though I didn't test their native
I used Makefiles generators with the IDEs that I tested, both on Linux
and Windows. The Fossil MSVC build now can be also done out-of-source.
QtCreator => opens CMakeLists.txt directly
Code::Blocks => cmake .. -G"CodeBlocks - Unix Makefiles"
VSCode => opens CMakeLists.txt (needs CMakeTools extension)
Eclipse CDT => cmake .. -G"Eclipse CDT4 - Unix Makefiles"
BTW, It appears that Eclipse CDT can already import a __configured__
autosetup-based Fossil project AS IS (import Exisitng C/C++ Makefiles
Project) ! With a couple of additional settings for includes and
sources, all of the IDE features are usable. Nice to know.
I mostly use this CMake project from QtCreator, I'm also using a
Fossil version control plugin. Of course, cmake build can also be done
from the command-line as usual:
cmake .. -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=Release (OR Debug)
cmake .. -G"NMake Makefiles" -DCMAKE_BUILD_TYPE=Release (OR Debug)
Additional parameters may be passed on cmake call via vars:
-DFOSSIL_CONFIGURE="", -DFOSSIL_BUILD="", -DFOSSIL_TEST=""
Hope this would be useful to fellow Fossil developers. Please let me
know of your experinces and ideas. If this makes sense, I may try to
write up some Fossil wiki page with detailed instructions on how to
set up the Fossil project development in IDE.