All Projects → CLIUtils → Cmake

CLIUtils / Cmake

Licence: bsd-3-clause
A set of cmake modules to assist in building code

Labels

Projects that are alternatives of or similar to Cmake

Kernel Grok
grok the kernel via a cmake shim
Stars: ✭ 114 (-10.24%)
Mutual labels:  cmake
Llvm Pass Tutorial
A step-by-step tutorial for building an LLVM sample pass
Stars: ✭ 122 (-3.94%)
Mutual labels:  cmake
Core
parallel finite element unstructured meshes
Stars: ✭ 124 (-2.36%)
Mutual labels:  cmake
Mars Vins
MARS-VINS binary release repository
Stars: ✭ 116 (-8.66%)
Mutual labels:  cmake
Gr Tpms
Tire Pressure Monitor tools for GNU Radio
Stars: ✭ 118 (-7.09%)
Mutual labels:  cmake
Sffmpeg
Full-featured static FFmpeg build helper
Stars: ✭ 122 (-3.94%)
Mutual labels:  cmake
Ros Examples
This repository is home to a collection of ROS nodes that process 3D sensor information from Velodyne LIDAR
Stars: ✭ 113 (-11.02%)
Mutual labels:  cmake
Openage
Free (as in freedom) open source clone of the Age of Empires II engine 🚀
Stars: ✭ 10,712 (+8334.65%)
Mutual labels:  cmake
Griefly
Griefly: Yet Another Space Station Remake
Stars: ✭ 121 (-4.72%)
Mutual labels:  cmake
Arduino Cmake Ng
CMake-Based framework for Arduino platforms
Stars: ✭ 123 (-3.15%)
Mutual labels:  cmake
Xray 16
Improved version of the X-Ray Engine, the game engine used in the world-famous S.T.A.L.K.E.R. game series by GSC Game World. Join OpenXRay! ;)
Stars: ✭ 1,806 (+1322.05%)
Mutual labels:  cmake
Opengl cmake skeleton
❤️ A ready to use cmake skeleton using GLFW, Glew and glm. 👍
Stars: ✭ 118 (-7.09%)
Mutual labels:  cmake
Flutter embedded
Embedded Flutter
Stars: ✭ 123 (-3.15%)
Mutual labels:  cmake
Catkin tools
Command line tools for working with catkin
Stars: ✭ 115 (-9.45%)
Mutual labels:  cmake
Chip8cpp
Chip-8 Emulator in C++
Stars: ✭ 125 (-1.57%)
Mutual labels:  cmake
Sampgdk
Write SA-MP gamemodes in C/C++
Stars: ✭ 113 (-11.02%)
Mutual labels:  cmake
Shiyanlou
学习C & C++ & python&汇编语言 LLVM编译器 数据结构 算法 操作系统 单片机 linux 面试
Stars: ✭ 1,909 (+1403.15%)
Mutual labels:  cmake
Opencv4androidwithcmake
Use Android Studio 3.0 (>=2.2) and Cmake Toolchain to make your Android device fly with Opencv (OpenCV 3.40)
Stars: ✭ 126 (-0.79%)
Mutual labels:  cmake
Ros Travis Integration
ROS package continuous integration using travis-CI
Stars: ✭ 125 (-1.57%)
Mutual labels:  cmake
More Modern Cmake
Contains the slides and examples for my "More Modern CMake" and "Oh No! More Modern CMake" talks from "Meeting C++" 2018 and 2019
Stars: ✭ 123 (-3.15%)
Mutual labels:  cmake

CMake 3 Tools

Warning: These tools are being replaced by the Modern CMake. Some of the tools are still being maintained for now, but new projects should check that repository first.

A set of CMake modules to assist in building code, with some tools for common general use packages and a few High Energy Physics packages. These tools are built around modern CMake (See The Ultimate Guide to Modern CMake), which allows clean, simple user CMake files. Although modern CMake is still a little odd in a few places, it is relatively clean and descriptive.

Installing CMake 3 anywhere

CMake is incredibly easy to install. The following line will install the latest 3.7.2 on Linux to your .local directory:

wget -qO- "https://cmake.org/files/v3.7/cmake-3.7.2-Linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C ~/.local

If you don't want to put this in the .local directory, simply replace with any pre-existing directory, and add <directory>/bin to your PATH. See the other files in CMake downloads to find similar installers for Mac and Windows, as well as the latest development versions.

AddGoogleTest

This is a downloader for GoogleTest, based on the excellent DownloadProject tool. Downloading a copy for each project is the recommended way to use GoogleTest (so much so, in fact, that they have disabled the automatic CMake install target), so this respects that design decision. This method downloads the project at configure time, so that IDE's correctly find the libraries. Using it is simple:

cmake_minimum_required(VERSION 3.4)
project(MyProject CXX)
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)

enable_testing() # Must be in main file

include(AddGoogleTest) # Could be in /tests/CMakeLists.txt
add_executable(SimpleTest SimpleTest.cu)
add_gtest(SimpleTest)

Note: add_gtest is just a macro that adds gtest, gmock, and gtest_main, and then runs add_test to create a test with the same name:

target_link_libraries(SimpleTest gtest gmock gtest_main)
add_test(SimpleTest SimpleTest)

FindROOT

The following is an example of a CMakeLists.txt file that will build a project using ROOT. Clone the repository to your project's cmake folder, or use git submodule add if you are already using git. The root-config tool should be in your PATH; if is not, please run source /my/root/install/bin/thisroot.sh to set your PATH and other useful variables. Then your CMakeLists.txt should look like:

cmake_minimum_required(VERSION 3.4)
project(MyProject CXX)
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)

find_package(ROOT 6 REQUIRED COMPONENTS Minuit)

add_executable(MyExecutable MySourceFile.cpp)
target_link_libraries(MyExecutable ROOT::ROOT ROOT::Minuit)

In most cases, you should specify the C++ version (ROOT sets the compiler and linker flags needed, so you can ignore it if using a ROOT target). In CMake < 3.8, that looks like this:

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

If you are using CMake 3.8 (not yet released), you could replace the C++11 selection code with the following line right at the end:

target_compile_features(MyExecutable PUBLIC cxx_std_11)

AddHydra

See the example repository (under development) for an example of the CMake 3.8 AddHydra module.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].