Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(#24893) magic_enum/0.9.6: fixes install dir #24894

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions recipes/magic_enum/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from conan import ConanFile
from conan.errors import ConanInvalidConfiguration
from conan.tools.build import check_min_cppstd
from conan.tools.files import copy, get
from conan.tools.layout import basic_layout
from conan.tools.files import copy, get, rmdir
from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout
from conan.tools.scm import Version
import os

Expand Down Expand Up @@ -39,7 +39,7 @@
}

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

Check failure on line 42 in recipes/magic_enum/all/conanfile.py

View workflow job for this annotation

GitHub Actions / Lint changed conanfile.py (v2 migration)

layout is missing `src_folder` argument which should be to `src`
nine marked this conversation as resolved.
Show resolved Hide resolved

def package_id(self):
self.info.clear()
Expand All @@ -56,12 +56,22 @@
def source(self):
get(self, **self.conan_data["sources"][self.version], strip_root=True)

def generate(self):
tc = CMakeToolchain(self)
tc.generate()

def build(self):
pass
cmake = CMake(self)
cmake.configure()
cmake.build()

def package(self):
copy(self, "*", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include"))
cmake = CMake(self)
cmake.install()
copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses"))
rmdir(self, os.path.join(self.package_folder, "lib", "cmake"))
rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig"))
rmdir(self, os.path.join(self.package_folder, "share"))

def package_info(self):
self.cpp_info.set_property("cmake_file_name", "magic_enum")
Expand Down
4 changes: 0 additions & 4 deletions recipes/magic_enum/all/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,3 @@ find_package(magic_enum REQUIRED CONFIG)
add_executable(${PROJECT_NAME} test_package.cpp)
target_link_libraries(${PROJECT_NAME} PRIVATE magic_enum::magic_enum)
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17)

if(magic_enum_VERSION VERSION_GREATER_EQUAL "0.9.4")
target_compile_definitions(${PROJECT_NAME} PRIVATE MAGIC_ENUM_INCLUDE_WITH_FOLDER)
endif()
6 changes: 1 addition & 5 deletions recipes/magic_enum/all/test_package/test_package.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
#ifdef MAGIC_ENUM_INCLUDE_WITH_FOLDER
# include <magic_enum/magic_enum.hpp>
#else
# include <magic_enum.hpp>
#endif
#include <magic_enum.hpp>
#include <cstdlib>
#include <string>

Expand Down
Loading