Skip to content

Commit

Permalink
Merge pull request #1261 from SpaceIm/octomap/do-not-force-PIC
Browse files Browse the repository at this point in the history
octomap: do not force PIC
  • Loading branch information
danimtb authored Apr 3, 2020
2 parents edf0020 + 8541939 commit f58a636
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 f58a636

Please sign in to comment.