Repository navigation
CMake Magic
CMake has platform independent morals (intersected only by Microsoft's stubborn adolescence (?)), apt specialized control for desired outcomes, and FOSS philosophy. This page is dedicated to eliciting some of the adorable features of CMake which are indispensable for Karma.
Wish #1: All the code/header files be organized in the same hierarchical fashion in the generated IDE project files, as they are actually organized in the repository project.
The snippet for collection by wildcard globally (within the KarmaEngine library scope) groups the files into Header/Source files (MSVC and XCode) like so

which becomes a mixed nuisance for my style of development (Qt has its own separate graceful way of organization though). But given I shall be developing on and for Windows and MacOS, I better make my own arrangements. This is where CMake's awesome malleability (a form of control) comes for rescue! Based on a fishing expedition, I found a snippet on web (this work) which I shall bring to Wiki's light
MACRO(SOURCE_GROUP_BY_FOLDER Target)
SET(SOURCE_GROUP_DELIMITER "/")
SET(Last_Dir "")
SET(Files "")
message(STATUS "Organizing files by same, project directory hierarchy.")
FOREACH(File ${CPPFILES} ${HEADERFILES})
FILE(RELATIVE_PATH Relative_File "${PROJECT_SOURCE_DIR}/${Target}" ${File})
GET_FILENAME_COMPONENT(Dir "${Relative_File}" PATH)
IF (NOT "${Dir}" STREQUAL "${Last_Dir}")
IF (Files)
SOURCE_GROUP("${Last_Dir}" FILES ${Files})
ENDIF (Files)
SET(Files "")
ENDIF (NOT "${Dir}" STREQUAL "${Last_Dir}")
SET(Files ${Files} ${File})
SET(Last_Dir "${Dir}")
ENDFOREACH(File)
IF (Files)
SOURCE_GROUP("${Last_Dir}" FILES ${Files})
ENDIF (Files)
ENDMACRO(SOURCE_GROUP_BY_FOLDER)We then have desirable result as per our vision

The algorithm is chalked in the following pseudo-code
