☰
Current Page
Main Menu
Home
Home
Editing
CMake
Edit
Preview
h1
h2
h3
Keybinding
default
vim
emacs
Markup
Markdown
Plain Text
Pod
RDoc
reStructuredText
AsciiDoc
BibTeX
Creole
MediaWiki
Org-mode
Textile
Help 1
Help 1
Help 1
Help 2
Help 3
Help 4
Help 5
Help 6
Help 7
Help 8
Autosaved text is available. Click the button to restore it.
Restore Text
--- title: CMake --- # Custom module path * The current project has custom [CMake][1] modules under cmake_modules/ Append the path in the top-level CMakeLists.txt: list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake_modules") # Out-of-Tree Sub-Projects * myLib is out-of-tree library source with its own CMakeLists.txt * we want to build and link against the out-of-tree library Instruct [CMake][1] to build the external library beneath the current binary dir explicitly: add_subdirectory (${OUT_OF_TREE_DIR}/myLib ${CMAKE_CURRENT_BINARY_DIR}/myLib) # MSVC static runtime definitions * MSVC projects require linking against specific versions of runtime libraries Override CMAKE\_C\_FLAGS_*: set(CMAKE_C_FLAGS_DEBUG "/MTd") set(CMAKE_C_FLAGS_RELEASE "/MT") # Arch-specific Files * Architecture-specific C implementation files in src/$ARCH/*.c Define TARGET\_BUILD\_PLATFORM=[linux|win32|...]. Include glob: file(GLOB PLATFORM_CSRCS ${TARGET_BUILD_PLATFORM}/*.c) # Group files in MSVC projects source_group(Groupname FILES ${PLATFORM_CSRCS}) # Custom Cross-compiler Toolchain * Seems to require overriding tool invocation commands within the Toolchain file * For compilers that don't include their system include files automatically, a platform .cmake file is useful * Seems this has to live in the [CMake][1] install tree (is there a better way?) [1]: CMake
Uploading file...
Sidebar
# SideBar * [Home][1] * [Projects][2] * * * <!-- --> * [Code][3] * [Tech][4] * [Network][5] * [MediaCentre][6] * [UAV][7] * * * <!-- --> * [Travel][8] * [Music][9] * [Horse Riding][10] * [Study][11] * [Games][12] * [Other Activities][13] * * * <!-- --> * [Car][14] * [House][15] * [Watch][16] * [Clothing][17] * [Miscellany][18] * * * [1]: /Home [2]: /Projects [3]: /Code/Code [4]: /Tech/Tech [5]: /Network/Network [6]: /MediaCentre/MediaCentre [7]: /UAV/UAV [8]: /Travel/Travel [9]: /Music/Music [10]: /HorseRiding/HorseRiding [11]: /Study/Study [12]: /Games/Games [13]: /Do/Do [14]: /Car/Car [15]: /House/House [16]: /Watch/Watch [17]: /Clothing/Clothing [18]: /Miscellany/Miscellany
Edit message:
Cancel