-
-
Save bolry/5f957b3b9e7d92d685841fde1e677369 to your computer and use it in GitHub Desktop.
Example of settings to CMake I use | |
Overrides RelWithDebugInfo from '-O2' to '-Og' | |
Also sets TYPE to 'Debug' | |
And example of setting the Eclipse executable path. | |
alias ncmake='CXX=g++ CC=gcc cmake -DCMAKE_C_FLAGS_RELWITHDEBINFO="-Og -g -DNDEBUG" -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="-Og -g -DNDEBUG" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_ECLIPSE_MAKE_ARGUMENTS=-v -DCMAKE_ECLIPSE_EXECUTABLE=/home/bo/eclipse/cpp-mars/eclipse/eclipse -DCMAKE_ECLIPSE_VERSION:STRING="4.5 (Mars)" -G "Eclipse CDT4 - Ninja"' |
C++Now 2017 Effective CMake talk https://youtu.be/bsXLMQ6WgIk?t=504
Speeding Up CMake https://cristianadam.eu/20170709/speeding-up-cmake/
The Ultimate Guide to Modern CMake
https://rix0r.nl/blog/2015/08/13/cmake-guide/
Modern CMake (Feb 2013)
https://archive.fosdem.org/2013/schedule/event/moderncmake/
Modern C++ CI 2017-07-01
https://juan-medina.com/2017/07/01/moderncppci/
Google Test and CMake automatic
https://crascit.com/2015/07/25/cmake-gtest/
From http://www.bitsnbites.eu/faster-c-builds/
Using gold:
if (UNIX AND NOT APPLE)
execute_process(COMMAND ${CMAKE_C_COMPILER} -fuse-ld=gold -Wl,--version ERROR_QUIET OUTPUT_VARIABLE ld_version)
if ("${ld_version}" MATCHES "GNU gold")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold -Wl,--disable-new-dtags")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fuse-ld=gold -Wl,--disable-new-dtags")
endif()
endif()
CGold: The Hitchhiker’s Guide to the CMake
https://cgold.readthedocs.io/en/latest/