Skip to content

Installation

Ootzk edited this page Mar 8, 2025 · 3 revisions

Version

If you want to use CLIEngine in your (local) project:

CMakeLists.txt

cmake_minimum_required(VERSION 3.22)
set(CMAKE_CXX_STANDARD 11)

project(MyProject LANGUAGES CXX)

include(FetchContent)
FetchContent_Declare(CLIEngine
    GIT_REPOSITORY https://github.com/Ootzk/CLIEngine.git
    GIT_TAG v0.4.1
    GIT_PROGRESS TRUE
    GIT_SHALLOW TRUE
)
FetchContent_MakeAvailable(CLIEngine)

set(SOURCES
    main.cpp
)

add_executable(myproject ${SOURCES})
target_include_directories(myproject PRIVATE ${CLIEngine_SOURCE_DIR}/include)
target_link_libraries(myproject PRIVATE cli_engine)  # cli_engine is alias defined in CLIEngine

main.cpp

#include "CLIEngine/core.hpp"

int main()
{
    CLIEngine::setPalette(CLIEngine::Color::RED, CLIEngine::Color::WHITE);
    std::cout << "hello world" << x << endl;
    CLIEngine::setPalette();

    // for more examples, refer wiki.
}

Clone this wiki locally