diff --git a/cmake/jwt-cpp-config.cmake.in b/cmake/jwt-cpp-config.cmake.in index fc22ce6..1f591ba 100644 --- a/cmake/jwt-cpp-config.cmake.in +++ b/cmake/jwt-cpp-config.cmake.in @@ -1,2 +1,6 @@ @PACKAGE_INIT@ + +include(CMakeFindDependencyMacro) +find_dependency(OpenSSL REQUIRED) + include(${CMAKE_INSTALL_PREFIX}/jwt-cpp/jwt-cpp.cmake) diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt index b4fda7c..c6cdfbb 100644 --- a/example/CMakeLists.txt +++ b/example/CMakeLists.txt @@ -1,7 +1,8 @@ cmake_minimum_required(VERSION 3.8) -project(jwt-cpp-test) +include(${CMAKE_TOOLCHAIN_FILE}) -find_package(jwt-cpp REQUIRED) +project(jwt-cpp-test) +find_package(jwt-cpp CONFIG REQUIRED) add_executable(jwt-cpp-test print-claims.cpp) -target_link_libraries(jwt-cpp-test PRIVATE jwt-cpp:jwt-cpp) +target_link_libraries(jwt-cpp-test jwt-cpp::jwt-cpp) diff --git a/example/README.md b/example/README.md new file mode 100644 index 0000000..557e25a --- /dev/null +++ b/example/README.md @@ -0,0 +1,8 @@ +# Print Claims Example + +Simple demo showing the usage along with vcpkg. + +```sh +cmake -DVCPKG_TARGET_TRIPLET=x64-linux -DCMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/vcpkg/scripts/buildsystems/vcpkg.cmake . +make +``` diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index bdc03a9..fd1a695 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -13,7 +13,7 @@ set(TEST_SOURCES add_executable(jwt-cpp-test ${TEST_SOURCES}) target_link_libraries( - jwt-cpp-test PRIVATE jwt-cpp GTest::gtest GTest::gtest_main GTest::gmock + jwt-cpp-test PRIVATE jwt-cpp::jwt-cpp GTest::gtest GTest::gtest_main GTest::gmock GTest::gmock_main) add_test(AllTests jwt-cpp-test)