build.md 931 B

Build and install

Build

  1. Generate build files
 $ cmake -Bbuild -DCMAKE_BUILD_TYPE=Release

If you want to build in debug mode, replace 'Release' with 'Debug' in the command above or remove -DCMAKE_BUILD_TYPE=Release` completely.

  1. Run build
 $ cmake --build ./build

Install

 $ sudo cmake --install ./build

Usage

main.cpp

#include <iostream>

#include <mcl/containers/dlist.hpp>

int main() {
		mcl::DList<int> l1{};

		l1.add_back(0);
		l1.add_back(1);
		l1.add_back(2);

		l1.add_front(-1);
		l1.add_front(-2);

		for (auto i : l1) {
				std::cout << i << ", ";
		}
		std::cout << std::endl;
}

CMakeLists.txt

cmake_minimum_required(VERSION 3.20)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

project(example)

find_package(mcl REQUIRED)

add_executable(exe main.cpp)

target_link_libraries(exe PRIVATE mcl::assert)