Skip to content

Commit

Permalink
Update cmake --install support
Browse files Browse the repository at this point in the history
1. Bug fix
2. Add a small project for testing installation
  • Loading branch information
HenryAWE committed May 21, 2024
1 parent baac147 commit debdac6
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 1 deletion.
10 changes: 10 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,16 @@ jobs:
working-directory: ${{github.workspace}}/build/example
run: ./info

- name: Install
working-directory: ${{github.workspace}}/build
run: sudo cmake --install .

- name: Test Installation
run: |
cmake -GNinja -S test/test_install/ -B build/papilio_test_install -DCMAKE_CXX_COMPILER=g++-12
cmake --build build/papilio_test_install
build/papilio_test_install/papilio_test_install
Clang:
runs-on: ubuntu-22.04
strategy:
Expand Down
2 changes: 1 addition & 1 deletion cmake/PapilioConfig.cmake.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@PACKAGE_INIT@

include("${CMAKE_CURRENT_LIST_DIR}/PapilioTargets.cmake")
check_required_components(papilio::papilio)
check_required_components(papilio)
11 changes: 11 additions & 0 deletions test/test_install/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
cmake_minimum_required(VERSION 3.20)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED)

project(papilio_test_install LANGUAGES CXX)

find_package(Papilio REQUIRED)

add_executable(papilio_test_install "test_install.cpp")
target_link_libraries(papilio_test_install PRIVATE papilio::papilio)
10 changes: 10 additions & 0 deletions test/test_install/test_install.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#include <papilio/papilio.hpp>

int main()
{
papilio::println("papilio installed");
papilio::println();
papilio::println("{} {} {}", "hello", 42, 3.14f);

return 0;
}

0 comments on commit debdac6

Please sign in to comment.