text=! Custom module path%0a* The current project has custom CMake modules under cmake_modules/%0a%0aAppend the path in the top-level CMakeLists.txt:%0a[@%0alist(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake_modules")%0a@]%0a%0a! Out-of-Tree Sub-Projects%0a* myLib is out-of-tree library source with its own CMakeLists.txt%0a* we want to build and link against the out-of-tree library%0a%0aInstruct CMake to build the external library beneath the current binary dir explicitly:%0a[@%0aadd_subdirectory (${OUT_OF_TREE_DIR}/myLib ${CMAKE_CURRENT_BINARY_DIR}/myLib)%0a@]%0a%0a! MSVC static runtime definitions%0a* MSVC projects require linking against specific versions of runtime libraries%0a%0aOverride CMAKE_C_FLAGS_:%0a[@%0aset(CMAKE_C_FLAGS_DEBUG "/MTd")%0aset(CMAKE_C_FLAGS_RELEASE "/MT")%0a@]%0a%0a! Arch-specific Files%0a Architecture-specific C implementation files in src/$ARCH/.c%0a%0aDefine TARGET_BUILD_PLATFORM=[linux|win32|...]. Include glob:%0a[@%0afile(GLOB PLATFORM_CSRCS ${TARGET_BUILD_PLATFORM}/.c)%0a@]%0a%0a! Group files in MSVC projects%0a[@%0asource_group(Groupname FILES ${PLATFORM_CSRCS})%0a@]%0a%0a! Custom Cross-compiler Toolchain%0a* Seems to require overriding tool invocation commands within the Toolchain file%0a* For compilers that don't include their system include files automatically, a platform .cmake file is useful%0a** Seems this has to live in the CMake install tree (is there a better way?)%0a%0a%0a