• Stars
    star
    123
  • Rank 289,358 (Top 6 %)
  • Language
    C++
  • Created over 7 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Concise CMake templates for creating C++ libraries or executables.

cmake_templates

Concise cmake templates for creating C++ libraries and executables.

Creating a normal cmake project

  • Copy the chosen project template somewhere.
  • Rename the folder include/PROJECT_NAME_HERE/.
  • Open CMakeLists.txt and change PROJECT_NAME_HERE.
#################################################    Project     #################################################
cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
project               (PROJECT_NAME_HERE VERSION 1.0 LANGUAGES CXX)
list                  (APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
...
  • Add your third party libraries via the import_library function which creates a cmake library target for the given include directories and libraries. You may also set the PROJECT_INCLUDE_DIRS and PROJECT_LIBRARIES variables manually instead of using import_library.
...
#################################################  Dependencies  #################################################
include(import_library)

# ADD LIBRARIES HERE. EXAMPLES:
# Header Only:
find_package  (GLM REQUIRED)
import_library(GLM_INCLUDE_DIRS)
# Identical Debug and Release:
find_package  (OpenGL REQUIRED)
import_library(OPENGL_INCLUDE_DIR OPENGL_LIBRARIES)
# Separate Debug and Release:
find_package  (Boost REQUIRED iostreams)
import_library(Boost_INCLUDE_DIRS Boost_IOSTREAMS_LIBRARY_DEBUG Boost_IOSTREAMS_LIBRARY_RELEASE)
...

Creating a conan cmake project

  • Copy the chosen project template somewhere.
  • Rename the folder include/PROJECT_NAME_HERE/.
  • Open CMakeLists.txt and change PROJECT_NAME_HERE.
#################################################    Project     #################################################
cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
project               (PROJECT_NAME_HERE VERSION 1.0 LANGUAGES CXX)
list                  (APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
...
  • Open conanfile.py, change PROJECT_NAME_HERE as well as PROJECT_URL_HERE (if available) and add your third party libraries to the requires.
...
class Project(ConanFile):
    name            = "PROJECT_NAME_HERE"
    description     = "Conan package for PROJECT_NAME_HERE."
    version         = "1.0.0"                
    url             = "PROJECT_URL_HERE"
    settings        = "arch", "build_type", "compiler", "os"
    generators      = "cmake"
    requires        = (("doctest/2.3.4@bincrafters/stable")) 
    ...

Creating a vcpkg cmake project

  • Copy the chosen project template somewhere.
  • Rename the folder include/PROJECT_NAME_HERE/.
  • Open CMakeLists.txt and change PROJECT_NAME_HERE.
#################################################    Project     #################################################
cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
project               (PROJECT_NAME_HERE VERSION 1.0 LANGUAGES CXX)
list                  (APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
...
  • Add your third party libraries via the import_library function which creates a cmake library target for the given include directories and libraries. You may also set the PROJECT_INCLUDE_DIRS and PROJECT_LIBRARIES variables manually instead of using import_library.
...
#################################################  Dependencies  #################################################
include(import_library)

# ADD LIBRARIES HERE. EXAMPLES:
# Header Only:
find_package  (GLM REQUIRED)
import_library(GLM_INCLUDE_DIRS)
# Identical Debug and Release:
find_package  (OpenGL REQUIRED)
import_library(OPENGL_INCLUDE_DIR OPENGL_LIBRARIES)
# Separate Debug and Release:
find_package  (Boost REQUIRED iostreams)
import_library(Boost_INCLUDE_DIRS Boost_IOSTREAMS_LIBRARY_DEBUG Boost_IOSTREAMS_LIBRARY_RELEASE)
...
  • Open bootstrap.bat and bootstrap.sh, and add your third party library ports.
...
rem Add your library ports here.
%VCPKG_COMMAND% doctest
...
...
# Add your library ports here. 
$VCPKG_COMMAND doctest
...

More Repositories

1

fg

Rendering abstraction which describes a frame as a directed acyclic graph of render tasks and resources.
C++
490
star
2

gl

Header-only C++17 wrapper for OpenGL 4.6 Core Profile.
C++
156
star
3

mpi

Header-only C++20 wrapper for MPI 4.0.
C++
39
star
4

acd

Single file utilities for C++.
C++
30
star
5

rational

Implementation of the std::experimental::rational proposal.
C++
9
star
6

ode

Header-only ordinary differential equation solvers in C++20.
C++
8
star
7

uci

Single header implementation of the Universal Chess Interface (UCI) protocol.
C++
7
star
8

vcv_plugin_template

A concise template for creating VCV rack plugins.
Shell
6
star
9

ec

Data-driven entity-component-system built on top of boost mp11.
C++
5
star
10

monte_carlo

Single header Monte Carlo simulator.
C++
4
star
11

hdf

Header-only C++20 wrapper for HDF5. [WIP]
C++
4
star
12

vulkan_sdl

Create a Vulkan surface from an SDL window. Deprecated: SDL now provides identical functionality natively.
C++
4
star
13

magpie

A minimalistic rendering engine based on ImGui and Im3d.
C++
4
star
14

fd

Generic finite differences in C++20.
C++
3
star
15

bm

Single header micro- and macro-benchmarking library.
C++
3
star
16

multi

Standard-like multidimensional arrays and vectors built on top of mdspan.
C++
3
star
17

hid.hpp

Single header C++23 wrapper for libusb/hidapi.
C++
3
star
18

map_reduce

Single header Map-Reduce built on top of Intel TBB.
CMake
3
star
19

ra

Generic resource abstraction for game/rendering engines.
C++
3
star
20

dpa

Distributed particle advector based on TBB and MPI.
C++
2
star
21

mcmc

Header-only library containing generic implementations of common Markov Chain Monte Carlo methods.
C++
2
star
22

ecs

A naive implementation of the entity-component-system model.
C++
2
star
23

di

Display and input abstraction built on top of SDL2 and OpenVR.
C++
2
star
24

pars

Source code of the paper Parallel Particle Advection and Lagrangian Analysis for 3D-PLI Fiber Orientation Maps.
C++
2
star
25

optix_cmake

An unofficial CMakeLists.txt for OptiX that exports the OptiX::OptiX target.
CMake
1
star
26

croupier

A generic poker engine capable of evaluating any variant of poker. Includes default rulesets for Texas and Omaha Hold'em, 5-Card, 7-Card and more. Intended for training poker bots.
C++
1
star
27

dayz_mod_template

A template for creating DayZ Standalone mods.
C++
1
star
28

type_trait_concepts

Concept equivalents of <type_traits>.
C++
1
star
29

csgo_map_templates

Collection of CS:GO map templates.
1
star
30

cs_server

A minimal CS 1.6 server with Metamod, AMX Mod X and Yet Another POD Bot (YAPB).
Batchfile
1
star
31

gh_bf4

Wallhack + aimbot for Battlefield 4.
C++
1
star
32

cs_removed_maps

This repository brings all maps that have been removed from beta 1.0 up until release 1.5 back into 1.6.
1
star
33

astray

A performance-portable geodesic ray tracer. Archived. See https://github.com/vrgrouprwth/astray instead.
C++
1
star
34

concepts.hpp

Concept equivalents of every boolean in <type_traits>.
C++
1
star
35

makina-old

Makina is a research engine focusing on computer graphics and virtual reality. [ARCHIVED]
C++
1
star
36

lorenz

Numerical integration of the Lorenz system in Three.js.
JavaScript
1
star
37

cush

Cuda Spherical Harmonics library.
C++
1
star
38

vcpkg_overlay_ports

Unofficial, useful vcpkg ports.
CMake
1
star
39

d3_template

Template for creating D3.js charts.
HTML
1
star
40

unity_data_binding

A general data and event binding plugin to compensate for the lack of these features in Unity 4.6.
C#
1
star
41

solidity_template

A concise solidity smart contract template.
JavaScript
1
star
42

dayz_server_template

A template for creating DayZ servers which automatically update the app and mods at each restart.
Batchfile
1
star
43

dayz_vanilla_server

A minimal server configuration for DayZ.
Batchfile
1
star
44

eigen

Personal fork of Eigen 3.
C++
1
star
45

tbtivh

Turkiye Bedelsiz Tasit Ithalati Vergi Hesaplayicisi (TBTIVH) / Turkish Private Vehicle Import Tax Calculator (TPVITC).
Python
1
star
46

cs_community_maps

This repository archives community-made maps that are important to the history of Counter-Strike.
1
star
47

r_portable

Portable version of R 4.2.1 for 64-bit Windows systems.
R
1
star
48

csgo_server

A minimalist CS:GO server.
Batchfile
1
star
49

makina-old-example

Makina example project.
C++
1
star
50

continuum_vst3

VST3 plugin simulating the Continuum Fingerboard through split channel pitch bends. Outputs MIDI Polyphonic Expression (MPE) data.
C++
1
star
51

hexagonal_keyboard_vst3

VST3 plugin for visualizing and outputting MIDI from various hexagonal keyboards, including the harmonic table and the Wicki-Hayden layout.
C++
1
star
52

fi

C++11 wrapper for FreeImage 3.17.0.
C++
1
star
53

astrid

A relativistic ray tracing server and end-user application built on Astray. Archived. See https://github.com/vrgrouprwth/astrid instead.
Cuda
1
star
54

makina

Makina C++ libraries.
1
star
55

jupyter_server

A minimal Jupyter notebook installation with Julia, Python and R.
Shell
1
star
56

arp

An arpeggiator VST3 plugin.
C++
1
star