OpenJK icon indicating copy to clipboard operation
OpenJK copied to clipboard

Refactor CMake files

Open xycaleth opened this issue 7 years ago • 1 comments

Our CMakeLists.txt files at the moment are a pretty big mess with some dependencies defined at the top level, even when not all projects need those dependencies. You can't choose to build one or two projects without going through the process of ticking/unticking a lot of boxes.

Good use of CMake should each each project to be built standalone, but currently this isn't possible because they all rely on the top-level project. I reckon there should be a "Common.cmake" file in the CMakeModules/ folder and then each project's CMakeLists.txt then includes this file to get all of the compiler settings, defines, etc. The job of the top-level CMakeLists.txt file is then to simply add the projects you choose to add.

Here are some good links on good use of CMake:

https://rix0r.nl/blog/2015/08/13/cmake-guide/ http://www.slideshare.net/DanielPfeifer1/cmake-48475415

xycaleth avatar Aug 02 '16 20:08 xycaleth

https://github.com/ttroy50/cmake-examples

I found this as a possible tutorial help too.

ensiform avatar Oct 19 '16 01:10 ensiform