Skip to content

Commit

Permalink
(conan-io#18167) access_private: add package_type
Browse files Browse the repository at this point in the history
* access_private: add package_type

* access_private: restore test_v1_package
  • Loading branch information
valgur authored Jul 5, 2023
1 parent ea91b61 commit 18b58bb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
15 changes: 8 additions & 7 deletions recipes/access_private/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,26 @@ class AccessPrivateConan(ConanFile):
name = "access_private"
description = "Access private members and statics of a C++ class"
license = "MIT"
topics = ("access", "private", "header-only")
homepage = "https://github.com/martong/access_private"
url = "https://github.com/conan-io/conan-center-index"
homepage = "https://github.com/martong/access_private"
topics = ("access", "private", "header-only")

package_type = "header-library"
settings = "os", "arch", "compiler", "build_type"
no_copy_source = True

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

def package_id(self):
self.info.clear()

def validate(self):
if self.settings.compiler.get_safe("cppstd"):
check_min_cppstd(self, 11)

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

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 build(self):
pass
Expand Down
11 changes: 4 additions & 7 deletions recipes/access_private/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.15)
project(test_package)

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

find_package(access_private REQUIRED CONFIG)

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

0 comments on commit 18b58bb

Please sign in to comment.