Skip to content

Commit

Permalink
octomap: do not force PIC
Browse files Browse the repository at this point in the history
  • Loading branch information
SpaceIm committed Apr 3, 2020
1 parent 67b15f7 commit 8541939
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions recipes/octomap/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,20 @@ def source(self):
os.rename(self.name + "-" + self.version, self._source_subfolder)

def build(self):
tools.replace_in_file(os.path.join(self._source_subfolder, "octomap","CMakeLists.txt"),
"SET( BASE_DIR ${CMAKE_SOURCE_DIR} )",
"SET( BASE_DIR ${CMAKE_BINARY_DIR} )")
self._patch_sources()
cmake = CMake(self)
cmake.definitions["OCTOMAP_OMP"] = self.options.openmp
cmake.configure(build_folder=self._build_subfolder)
cmake.build(target="octomap" if self.options.shared else "octomap-static")

def _patch_sources(self):
tools.replace_in_file(os.path.join(self._source_subfolder, "octomap", "CMakeLists.txt"),
"SET( BASE_DIR ${CMAKE_SOURCE_DIR} )",
"SET( BASE_DIR ${CMAKE_BINARY_DIR} )")
# Do not force PIC
tools.replace_in_file(os.path.join(self._source_subfolder, "octomap", "CMakeModules", "CompilerSettings.cmake"),
"ADD_DEFINITIONS(-fPIC)", "")

def package(self):
self.copy("LICENSE.txt", dst="licenses", src=os.path.join(self._source_subfolder, "octomap"))
source_include_dir = os.path.join(self._source_subfolder, "octomap", "include")
Expand Down

0 comments on commit 8541939

Please sign in to comment.