Skip to content

Commit

Permalink
modernize more
Browse files Browse the repository at this point in the history
  • Loading branch information
SpaceIm committed Jan 7, 2023
1 parent 3179aee commit 35ad6da
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 17 deletions.
16 changes: 6 additions & 10 deletions recipes/cctag/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir
import os

required_conan_version = ">=1.52.0"
required_conan_version = ">=1.53.0"


class CCTagConan(ConanFile):
Expand Down Expand Up @@ -44,16 +44,13 @@ def config_options(self):

def configure(self):
if self.options.shared:
try:
del self.options.fPIC
except Exception:
pass
self.options.rm_safe("fPIC")

def layout(self):
cmake_layout(self, src_folder="src")

def requirements(self):
self.requires("boost/1.80.0")
self.requires("boost/1.81.0")
self.requires("eigen/3.4.0")
self.requires("onetbb/2020.3")
self.requires("opencv/4.5.5")
Expand All @@ -76,16 +73,15 @@ def validate(self):
f"{', '.join(self._required_boost_components)}",
)

if self.info.settings.compiler.get_safe("cppstd"):
if self.settings.compiler.get_safe("cppstd"):
check_min_cppstd(self, 14)

# FIXME: add cuda support
if self.info.options.with_cuda:
if self.options.with_cuda:
raise ConanInvalidConfiguration("CUDA not supported yet")

def source(self):
get(self, **self.conan_data["sources"][self.version],
destination=self.source_folder, strip_root=True)
get(self, **self.conan_data["sources"][self.version], strip_root=True)

def generate(self):
tc = CMakeToolchain(self)
Expand Down
11 changes: 4 additions & 7 deletions recipes/cctag/all/test_v1_package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
cmake_minimum_required(VERSION 3.8)
project(test_package LANGUAGES CXX)
cmake_minimum_required(VERSION 3.1)
project(test_package)

include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup(TARGETS)

find_package(CCTag REQUIRED CONFIG)

add_executable(${PROJECT_NAME} ../test_package/test_package.cpp)
target_link_libraries(${PROJECT_NAME} PRIVATE CCTag::CCTag)
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package
${CMAKE_CURRENT_BINARY_DIR}/test_package)

0 comments on commit 35ad6da

Please sign in to comment.