CMakeLists.txt
cmake_minimum_required(VERSION 3.2)
include("cmake/HunterGate.cmake")
HunterGate(
URL "https://github.com/cpp-pm/hunter/archive/v0.16.15.tar.gz"
SHA1 "6974c2150fc0d3b09de3ad1efcbf15d360647ffa"
)
project(pp VERSION 0.0.0 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 14)
set(src src/main.cpp)
hunter_add_package(imgui)
find_package(imgui CONFIG REQUIRED)
add_executable(${PROJECT_NAME} ${src})
target_link_libraries(${PROJECT_NAME} PRIVATE imgui::imgui)
sh
$ mkdir build cmake src
$ curl -L https://raw.githubusercontent.com/cpp-pm/gate/master/cmake/HunterGate.cmake -o cmake/HunterGate.cmake
$ curl -L https://raw.githubusercontent.com/ocornut/imgui/6a161b8/examples/example_allegro5/main.cpp -o src/main.cpp
$ cd build && cmake ..
-- [hunter] Calculating Config-SHA1
-- [hunter] Calculating Toolchain-SHA1
-- [hunter] HUNTER_ROOT: .hunter
-- [hunter] [ Hunter-ID: 6974c21 | Config-ID: 78315bd | Toolchain-ID: 309ee35 ]
[hunter ** INTERNAL **] Project 'imgui' not found
[hunter ** INTERNAL **] [Directory:/tmp/imgui2]
------------------------------ WIKI -------------------------------
https://github.com/ruslo/hunter/wiki/error.internal
-------------------------------------------------------------------
CMake Error at .hunter/_Base/Download/Hunter/0.16.15/6974c21/Unpacked/cmake/modules/hunter_wiki.cmake:12 (message):
Call Stack (most recent call first):
.hunter/_Base/Download/Hunter/0.16.15/6974c21/Unpacked/cmake/modules/hunter_internal_error.cmake:13 (hunter_wiki)
.hunter/_Base/Download/Hunter/0.16.15/6974c21/Unpacked/cmake/modules/hunter_add_package.cmake:45 (hunter_internal_error)
CMakeLists.txt:12 (hunter_add_package)
-- Configuring incomplete, errors occurred!
See also "/tmp/imgui2/build/CMakeFiles/CMakeOutput.log".
See also "/tmp/imgui2/build/CMakeFiles/CMakeError.log".
CMakeLists.txtsh