Skip to content
This repository was archived by the owner on Apr 23, 2021. It is now read-only.

Commit

Permalink
Update CMake requeriments
Browse files Browse the repository at this point in the history
  • Loading branch information
Bajoja committed Apr 20, 2017
1 parent 619aa0a commit e80e053
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ ensure_vala_version("0.20" MINIMUM)
include(ValaPrecompile)
# make sure we use GettextTranslate
include(GettextTranslate)
#
include(FindPythonModule)
find_python_module(requests_oauthlib)


#indicator
Expand Down
23 changes: 23 additions & 0 deletions cmake/FindPythonModule.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2017 KDE Connect Indicator Developers
#
# This software is licensed under the GNU Lesser General Public License
# (version 2.1 or later). See the COPYING file in this distribution.
#

function(find_python_module module)
execute_process(
COMMAND
python3 -c "from requests_oauthlib import OAuth2Session"
RESULT_VARIABLE PYTHON_module
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE
)

if(NOT PYTHON_module)
message ("-- Found requests_oauthlib")
else(PYTHON_module)
message (FATAL_ERROR "-- Not Found requests_oauthlib: install it first")
endif()

endfunction(find_python_module)

0 comments on commit e80e053

Please sign in to comment.