Skip to content

Commit

Permalink
cmake: patch cmakelists to include conanbuildinfo.cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
madebr committed May 31, 2020
1 parent 2931d4d commit aaf55f8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
9 changes: 0 additions & 9 deletions recipes/cmake/3.x.x/CMakeLists.txt

This file was deleted.

7 changes: 5 additions & 2 deletions recipes/cmake/3.x.x/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ class CMakeConan(ConanFile):
url = "https://github.com/conan-io/conan-center-index"
homepage = "https://github.com/Kitware/CMake"
license = "BSD-3-Clause"
exports_sources = ["CMakeLists.txt"]
generators = "cmake"
settings = "os", "arch", "compiler", "build_type"

Expand Down Expand Up @@ -55,10 +54,14 @@ def _configure_cmake(self):
if self._with_openssl:
self._cmake.definitions["OPENSSL_USE_STATIC_LIBS"] = not self.options["openssl"].shared
self._cmake.definitions["CMAKE_EXE_LINKER_FLAGS"] = "-lz"
self._cmake.configure()
self._cmake.configure(source_folder=self._source_subfolder)
return self._cmake

def build(self):
tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"),
"project(CMake)",
"project(CMake)\ninclude(\"{}/conanbuildinfo.cmake\")\nconan_basic_setup()".format(
self.build_folder.replace("\\", "/")))
if self.settings.os == "Linux":
tools.replace_in_file(os.path.join(self._source_subfolder, "Utilities", "cmcurl", "CMakeLists.txt"),
"list(APPEND CURL_LIBS ${OPENSSL_LIBRARIES})",
Expand Down

0 comments on commit aaf55f8

Please sign in to comment.