<commit_before># -*- coding: utf-8 -*-
#
# Copyright 2012-2019 CNRS-UM LIRMM, CNRS-AIST JRL
#

from conans import ConanFile, CMake, tools
import os
import shutil

class SCHCoreConan(ConanFile):
    name = "sch-core"
    version = "1.0.3"
    description = "Efficient implementation of GJK algorithm for proximity queries (collision detection, distance computations, penetration depths and witness points) between convex shapes."
    topics = ("robotics", "collision", "proximity", "convex")
    url = "https://github.com/jrl-umi3218/sch-core"
    homepage = "https://github.com/jrl-umi3218/sch-core"
    author = "<NAME> <<EMAIL>>"
    license = "BSD-2-Clause"
    exports = ["LICENSE"]
    exports_sources = ["CMakeLists.txt", "conan/CMakeLists.txt", "cmake/*", "CMakeModules/*", "doc/*", "examples/*", "include/*", "src/*", "README.md", "conan/FindBoost.cmake"]
    generators = ["cmake_paths"]
    settings = "os", "arch", "compiler", "build_type"

    requires = (
        # We don't really care for a specific version of Boost and conan has >= 1.64
        "boost/1.73.0"
    )

    def source(self):
        # Wrap the original CMake file to call conan_basic_setup
        shutil.move("CMakeLists.txt", "CMakeListsOriginal.txt")
        shutil.move(os.path.join("conan", "CMakeLists.txt"), "CMakeLists.txt")
        # Make sure we find conan's Boost not system Boost
        replacement = '''if(CONAN_BOOST_ROOT)
  set(BOOST_ROOT "${{CONAN_BOOST_ROOT}}")
else()
  set(BOOST_ROOT "${{PACKAGE_PREFIX_DIR}}")
endif()
set(Boost_NO_SYSTEM_PATHS ON)
list(APPEND CMAKE_MODULE_PATH "${{CMAKE_CURRENT_LIST_DIR}}")
{}'''.format(pattern)
        tools.replace_in_file('cmake/Config.cmake.in', pattern, replacement)
        # Install the up-to-date FindBoost.cmake
        pattern = 'add_subdirectory(src)'
        replacement = '''list(APPEND CMAKE_MODULE_PATH "${{CMAKE_CURRENT_LIST_DIR}}/conan")
{}
install(FILES conan/FindBoost.cmake DESTINATION lib/cmake/RBDyn)'''.format(pattern)
        tools.replace_in_file('CMakeListsOriginal.txt', pattern, replacement)

    def _configure_cmake(self):
        cmake = CMake(self)
        cmake.definitions['BUILD_TESTING'] = False
        cmake.definitions['INSTALL_DOCUMENTATION'] = False
        cmake.definitions['SCH_BUILD_BSD'] = True
        cmake.configure()
        return cmake

    def build(self):
        cmake = self._configure_cmake()
        cmake.build()

    def package(self):
        cmake = self._configure_cmake()
        cmake.install()

    def deploy(self):
        self.copy("*")
        self.copy_deps("*")

    def package_info(self):
        self.cpp_info.libs = tools.collect_libs(self)
        self.env_info.LD_LIBRARY_PATH.append(os.path.join(self.package_folder, 'lib'))
<commit_msg>[conan] Fix recipe bug<commit_after># -*- coding: utf-8 -*-
#
# Copyright 2012-2019 CNRS-UM LIRMM, CNRS-AIST JRL
#

from conans import ConanFile, CMake, tools
import os
import shutil

class SCHCoreConan(ConanFile):
    name = "sch-core"
    version = "1.0.3"
    description = "Efficient implementation of GJK algorithm for proximity queries (collision detection, distance computations, penetration depths and witness points) between convex shapes."
    topics = ("robotics", "collision", "proximity", "convex")
    url = "https://github.com/jrl-umi3218/sch-core"
    homepage = "https://github.com/jrl-umi3218/sch-core"
    author = "<NAME> <pi<EMAIL>>"
    license = "BSD-2-Clause"
    exports = ["LICENSE"]
    exports_sources = ["CMakeLists.txt", "conan/CMakeLists.txt", "cmake/*", "CMakeModules/*", "doc/*", "examples/*", "include/*", "src/*", "README.md", "conan/FindBoost.cmake"]
    generators = ["cmake_paths"]
    settings = "os", "arch", "compiler", "build_type"

    requires = (
        # We don't really care for a specific version of Boost and conan has >= 1.64
        "boost/1.73.0"
    )

    def source(self):
        # Wrap the original CMake file to call conan_basic_setup
        shutil.move("CMakeLists.txt", "CMakeListsOriginal.txt")
        shutil.move(os.path.join("conan", "CMakeLists.txt"), "CMakeLists.txt")
        # Make sure we find conan's Boost not system Boost
        pattern = 'include(CMakeFindDependencyMacro)'
        replacement = '''if(CONAN_BOOST_ROOT)
  set(BOOST_ROOT "${{CONAN_BOOST_ROOT}}")
else()
  set(BOOST_ROOT "${{PACKAGE_PREFIX_DIR}}")
endif()
set(Boost_NO_SYSTEM_PATHS ON)
list(APPEND CMAKE_MODULE_PATH "${{CMAKE_CURRENT_LIST_DIR}}")
{}'''.format(pattern)
        tools.replace_in_file('cmake/Config.cmake.in', pattern, replacement)
        # Install the up-to-date FindBoost.cmake
        pattern = 'add_subdirectory(src)'
        replacement = '''list(APPEND CMAKE_MODULE_PATH "${{CMAKE_CURRENT_LIST_DIR}}/conan")
{}
install(FILES conan/FindBoost.cmake DESTINATION lib/cmake/RBDyn)'''.format(pattern)
        tools.replace_in_file('CMakeListsOriginal.txt', pattern, replacement)

    def _configure_cmake(self):
        cmake = CMake(self)
        cmake.definitions['BUILD_TESTING'] = False
        cmake.definitions['INSTALL_DOCUMENTATION'] = False
        cmake.definitions['SCH_BUILD_BSD'] = True
        cmake.configure()
        return cmake

    def build(self):
        cmake = self._configure_cmake()
        cmake.build()

    def package(self):
        cmake = self._configure_cmake()
        cmake.install()

    def deploy(self):
        self.copy("*")
        self.copy_deps("*")

    def package_info(self):
        self.cpp_info.libs = tools.collect_libs(self)
        self.env_info.LD_LIBRARY_PATH.append(os.path.join(self.package_folder, 'lib'))

{'fraction_non_alphanumeric': 0.14301094563071953, 'fraction_numerical': 0.010048447873676656, 'mean_word_length': 3.506063055780113, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6382731', 'n_tokens_mistral': 1955, 'n_tokens_neox': 1837, 'n_words': 379}