Skip to content

Commit

Permalink
Fixed formatting issued detected by linters.
Browse files Browse the repository at this point in the history
  • Loading branch information
max-krichenbauer committed Jan 10, 2020
1 parent 69c2d21 commit 8e5bc1e
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 37 deletions.
14 changes: 14 additions & 0 deletions ament_cmake_virtualenv/ament_cmake_virtualenv-extras.cmake
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2019-2020 eSOL Co.,Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Include cmake modules from ament_cmake_virtualenv
include(${ament_cmake_virtualenv_DIR}/ament_generate_virtualenv.cmake)
include(${ament_cmake_virtualenv_DIR}/ament_install_python.cmake)
40 changes: 18 additions & 22 deletions ament_cmake_virtualenv/cmake/ament_generate_virtualenv.cmake
Original file line number Diff line number Diff line change
@@ -1,25 +1,21 @@
# Software License Agreement (GPL)
# Copyright 2019-2020 eSOL Co.,Ltd.
#
# \file ament_generate_virtualenv.cmake
# \authors Max Krichenbauer <[email protected]>
# \copyright Copyright (c) (2019), eSol, All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of the
# License, or (at your option) any later version.
# http://www.apache.org/licenses/LICENSE-2.0
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

function(ament_generate_virtualenv)
set(oneValueArgs PYTHON_VERSION PYTHON_VERSION_MAJOR USE_SYSTEM_PACKAGES ISOLATE_REQUIREMENTS)
set(multiValueArgs EXTRA_PIP_ARGS)
cmake_parse_arguments(ARG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
cmake_parse_arguments(ARG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})

# Check if this package already has a virtualenv target before creating one
if(TARGET ${PROJECT_NAME}_generate_virtualenv)
Expand All @@ -45,7 +41,7 @@ function(ament_generate_virtualenv)
set(ARG_ISOLATE_REQUIREMENTS FALSE)
endif()

if (NOT DEFINED ARG_EXTRA_PIP_ARGS)
if(NOT DEFINED ARG_EXTRA_PIP_ARGS)
set(ARG_EXTRA_PIP_ARGS "-qq")
endif()
# Convert CMake list to ' '-separated list
Expand All @@ -66,7 +62,7 @@ function(ament_generate_virtualenv)

# Collect all exported pip requirements files, from this package and all dependencies
find_program(glob_requirements_BIN NAMES "glob_requirements"
PATHS "${CMAKE_INSTALL_PREFIX}/../ament_virtualenv/bin/")
PATHS "${CMAKE_INSTALL_PREFIX}/../ament_virtualenv/bin/")
if(NOT glob_requirements_BIN)
message(FATAL_ERROR "could not find program 'glob_requirements'")
endif()
Expand All @@ -88,7 +84,7 @@ function(ament_generate_virtualenv)

# Combine requirements into one list
find_program(combine_requirements_BIN NAMES "combine_requirements"
PATHS "${CMAKE_INSTALL_PREFIX}/../ament_virtualenv/bin/")
PATHS "${CMAKE_INSTALL_PREFIX}/../ament_virtualenv/bin/")
if(NOT combine_requirements_BIN)
message(FATAL_ERROR "could not find program 'combine_requirements'")
endif()
Expand All @@ -105,7 +101,7 @@ function(ament_generate_virtualenv)

# Generate a virtualenv, fixing up paths for install-space
find_program(build_venv_BIN NAMES "build_venv"
PATHS "${CMAKE_INSTALL_PREFIX}/../ament_virtualenv/bin/")
PATHS "${CMAKE_INSTALL_PREFIX}/../ament_virtualenv/bin/")
if(NOT build_venv_BIN)
message(FATAL_ERROR "could not find program 'build_venv'")
endif()
Expand Down Expand Up @@ -134,7 +130,7 @@ function(ament_generate_virtualenv)

# Override the ament_python_install_module macro to wrap modules
find_program(wrap_module_BIN NAMES "wrap_module"
PATHS "${CMAKE_INSTALL_PREFIX}/../ament_virtualenv/bin/")
PATHS "${CMAKE_INSTALL_PREFIX}/../ament_virtualenv/bin/")
if(NOT wrap_module_BIN)
message(FATAL_ERROR "could not find program 'wrap_module'")
endif()
Expand All @@ -149,7 +145,7 @@ function(ament_generate_virtualenv)

# Override the ament_python_install_package macro to wrap packages
find_program(wrap_package_BIN NAMES "wrap_package"
PATHS "${CMAKE_INSTALL_PREFIX}/../ament_virtualenv/bin/")
PATHS "${CMAKE_INSTALL_PREFIX}/../ament_virtualenv/bin/")
if(NOT wrap_package_BIN)
message(FATAL_ERROR "could not find program 'wrap_package'")
endif()
Expand Down
26 changes: 11 additions & 15 deletions ament_cmake_virtualenv/cmake/ament_install_python.cmake
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
# Software License Agreement (GPL)
# Copyright 2019-2020 eSOL Co.,Ltd.
#
# \file ament_install_python.cmake
# \authors Max Krichenbauer <[email protected]>
# \copyright Copyright (c) (2019), eSol, All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of the
# License, or (at your option) any later version.
# http://www.apache.org/licenses/LICENSE-2.0
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

function(ament_install_python)
# See https://github.com/ros/ament/blob/kinetic-devel/cmake/ament_install_python.cmake for overriden function
cmake_parse_arguments(ARG "OPTIONAL" "DESTINATION" "PROGRAMS" ${ARGN})
Expand Down

0 comments on commit 8e5bc1e

Please sign in to comment.