Skip to content

Commit

Permalink
Merge pull request #1 from madebr/jwt-cpp-prince-chrismc
Browse files Browse the repository at this point in the history
jwt-cpp: test_package needs cmake generator
  • Loading branch information
prince-chrismc authored Mar 5, 2020
2 parents b165b27 + 7e82cbe commit 1721284
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions recipes/jwt-cpp/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from conans import ConanFile, tools

import os


class JwtCppConan(ConanFile):
name = "jwt-cpp"
license = "MIT"
Expand All @@ -26,7 +26,7 @@ def source(self):
os.rename(extracted_dir, self._source_subfolder)

def package(self):
header_dir = self._source_subfolder + "/include/jwt-cpp/"
header_dir = os.path.join(self._source_subfolder, "include", "jwt-cpp/")
self.copy("jwt.h", dst="include", src=header_dir, keep_path=False)
self.copy("base.h", dst="include", src=header_dir, keep_path=False)
self.copy("LICENSE", dst="licenses", src=self._source_subfolder)
Expand Down
3 changes: 2 additions & 1 deletion recipes/jwt-cpp/all/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
cmake_minimum_required(VERSION 2.8.12)
project(PackageTest CXX)

set(CMAKE_VERBOSE_MAKEFILE TRUE)
include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake")
conan_basic_setup()

find_package(jwt-cpp REQUIRED)

Expand Down
8 changes: 3 additions & 5 deletions recipes/jwt-cpp/all/test_package/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

import os


class JsonCppTestConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "cmake_find_package"
generators = "cmake", "cmake_find_package"

@property
def _is_multi_configuration(self):
Expand All @@ -18,8 +19,5 @@ def build(self):

def test(self):
if not tools.cross_building(self.settings):
bin_path = "example"
if self._is_multi_configuration:
bin_path = os.path.join(str(self.settings.build_type), bin_path)
self.output.info(bin_path)
bin_path = os.path.join("bin", "example")
self.run(bin_path, run_environment=True)

0 comments on commit 1721284

Please sign in to comment.