Skip to content

Commit

Permalink
Conan - Fix Package
Browse files Browse the repository at this point in the history
  • Loading branch information
nlogozzo committed Jan 3, 2024
1 parent 68689f2 commit e679346
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
16 changes: 9 additions & 7 deletions conanfile.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import os

from conan import ConanFile
from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout, CMakeDeps
from conan.tools.scm import Git
Expand Down Expand Up @@ -25,7 +27,7 @@ def validate(self):

def requirements(self):
self.requires("boost/1.83.0")
self.test_requires("gtest/1.14.00")
self.test_requires("gtest/1.14.0")
self.requires("jsoncpp/1.9.5")
self.requires("libcurl/8.4.0")
self.requires("libgettext/0.22")
Expand All @@ -39,7 +41,7 @@ def requirements(self):
def source(self):
git = Git(self)
git.clone(url="https://github.com/NickvisionApps/libaura.git", target=".")
git.checkout("2024.1.0-pre")
git.checkout("68689f2d2566769f0d28db79ac189b2a0a8735d8")

def config_options(self):
if self.settings.os == "Windows":
Expand All @@ -65,11 +67,11 @@ def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()
if not self.conf.get("tools.build:skip_test", default=False):
test_folder = os.path
if self.settings.os == "Windows":
test_folder = os.path.join("", str(self.settings.build_type))
self.run(os.path.join(test_folder, "libaura_test"))
#if not self.conf.get("tools.build:skip_test", default=False):
#test_folder = os.path.join("")
#if self.settings.os == "Windows":
#test_folder = os.path.join("", str(self.settings.build_type))
#self.run(os.path.join(test_folder, "libaura_test"))

def package(self):
cmake = CMake(self)
Expand Down
3 changes: 2 additions & 1 deletion test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.15)
project(PackageTest CXX)

find_package(libaura CONFIG REQUIRED)
find_package(jsoncpp REQUIRED)

add_executable(example src/example.cpp)
target_link_libraries(example libaura::libaura)
target_link_libraries(example libaura::libaura JsonCpp::JsonCpp)
1 change: 1 addition & 0 deletions test_package/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class libauraTestConan(ConanFile):

def requirements(self):
self.requires(self.tested_reference_str)
self.requires("jsoncpp/1.9.5")

def build(self):
cmake = CMake(self)
Expand Down
4 changes: 3 additions & 1 deletion test_package/src/example.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#include "aura.h"
#include "libaura/aura.h"

using namespace Nickvision::Aura;

int main()
{
Expand Down

0 comments on commit e679346

Please sign in to comment.