Skip to content

Commit

Permalink
Add opencv3 check (#114)
Browse files Browse the repository at this point in the history
* Turn off cuda for opencv3 if GCC > 4. This also simplifies the logic for special cases.
  • Loading branch information
allenh1 committed Jan 8, 2018
1 parent c353409 commit b7c9f94
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions superflore/generators/ebuild/ebuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,14 +184,22 @@ def get_ebuild_text(self, distributor, license_text):
ret += " ros-cmake_src_prepare\n"
ret += "}\n"

special_pkgs = ['opencv3', 'stage']
# source configuration
if self.name in special_pkgs:
if self.name == 'opencv3':
ret += "\nsrc_configure() {\n"
if self.name == 'opencv3':
ret += " filter-flags '-march=*' '-mcpu=*' '-mtune=*'\n"
elif self.name == 'stage':
ret += " filter-flags '-std=*'\n"
ret += " filter-flags '-march=*' '-mcpu=*' '-mtune=*'\n"
ret += " if [[ $(gcc-major-version) -gt 4 ]]; then\n"
ret += " local mycmakeargs=(\n"
ret += " -DWITH_CUDA=OFF\n"
ret += " )\n"
ret += ' ewarn "Cuda does not support GCC > 4, so cuda'
ret += ' has been disabled."\n'
ret += " fi\n"
ret += " ros-cmake_src_configure\n"
ret += "}\n"
elif self.name == 'stage':
ret += "\nsrc_configure() {\n"
ret += " filter-flags '-std=*'\n"
ret += " ros-cmake_src_configure\n"
ret += "}\n"

Expand Down

0 comments on commit b7c9f94

Please sign in to comment.