diff --git a/CMakeLists.txt b/CMakeLists.txt index 8497e77..e70e879 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,11 +6,8 @@ include (cmake/Flags.cmake) set(CMAKE_CXX_STANDARD 20) -if (NOT BUILD_TESTING STREQUAL OFF) - set(ENABLE_TESTING ON) - enable_testing() - find_package(GTest QUIET REQUIRED) -endif() +enable_testing() +find_package(GTest QUIET REQUIRED) if (DEFINED BUILD_COVERAGE) if (${BUILD_COVERAGE}) diff --git a/conanfile.py b/conanfile.py index 7de9784..3d6730a 100644 --- a/conanfile.py +++ b/conanfile.py @@ -1,7 +1,7 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.build import check_min_cppstd -from conan.tools.cmake import CMakeToolchain, CMakeDeps, CMake, cmake_layout +from conan.tools.cmake import CMakeToolchain, CMakeDeps, CMake from conan.tools.files import copy from conan.tools.files import copy from os.path import join @@ -10,7 +10,7 @@ class NuRaftMesgConan(ConanFile): name = "nuraft_mesg" - version = "3.5.9" + version = "3.5.10" homepage = "https://github.com/eBay/nuraft_mesg" description = "A gRPC service for NuRAFT" @@ -59,10 +59,9 @@ def configure(self): raise ConanInvalidConfiguration("Coverage/Sanitizer requires Testing!") def build_requirements(self): - if not self.conf.get("tools.build:skip_test", default=False): - self.test_requires("lz4/[>=1.9]") - self.test_requires("gtest/1.14.0") - self.test_requires("jungle/cci.20221201") + self.test_requires("lz4/[>=1.9]") + self.test_requires("gtest/1.14.0") + self.test_requires("jungle/cci.20221201") def requirements(self): self.requires("boost/1.83.0", transitive_headers=True) @@ -70,7 +69,18 @@ def requirements(self): self.requires("nuraft/2.4.2", transitive_headers=True) def layout(self): - cmake_layout(self) + self.folders.source = "." + self.folders.build = join("build", str(self.settings.build_type)) + self.folders.generators = join(self.folders.build, "generators") + + self.cpp.source.includedirs = ["include"] + + self.cpp.build.components["proto"].libdirs = ["src/proto"] + + self.cpp.package.components["proto"].libs = ["nuraft_mesg_proto"] + self.cpp.package.components["proto"].set_property("pkg_config_name", "libnuraft_mesg_proto") + self.cpp.package.includedirs = ["include"] # includedirs is already set to 'include' by + self.cpp.package.libdirs = ["lib"] def generate(self): # This generates "conan_toolchain.cmake" in self.generators_folder @@ -109,8 +119,6 @@ def package(self): copy(self, "*.so*", self.build_folder, lib_dir, keep_path=False) def package_info(self): - self.cpp_info.components["proto"].libs = ["nuraft_mesg_proto"] - self.cpp_info.components["proto"].set_property("pkg_config_name", "libnuraft_mesg_proto") self.cpp_info.components["proto"].requires.extend([ "nuraft::nuraft", "boost::boost", diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0501efa..9a3f79b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -12,8 +12,4 @@ add_subdirectory (proto) add_subdirectory (flatb) add_subdirectory (lib) -if(DEFINED ENABLE_TESTING) - if(${ENABLE_TESTING}) - add_subdirectory(tests) - endif() -endif() +add_subdirectory(tests)