diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2018-08-14 10:07:22 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2018-08-14 15:54:55 +0200 |
commit | f65882cca6411461373995b5da4aef85bbbb4841 (patch) | |
tree | 43b270f7bacb7d68276aa20e659f7a9800895a5e /cmake | |
parent | a3475c2e4b1df03ee7306eaf999fe745f010408b (diff) | |
download | libssh-f65882cca6411461373995b5da4aef85bbbb4841.tar.gz libssh-f65882cca6411461373995b5da4aef85bbbb4841.tar.xz libssh-f65882cca6411461373995b5da4aef85bbbb4841.zip |
cmake: Fix optional ABIMap detection
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/Modules/FindABIMap.cmake | 35 |
1 files changed, 24 insertions, 11 deletions
diff --git a/cmake/Modules/FindABIMap.cmake b/cmake/Modules/FindABIMap.cmake index 78bfa36a..e70fbad3 100644 --- a/cmake/Modules/FindABIMap.cmake +++ b/cmake/Modules/FindABIMap.cmake @@ -202,19 +202,30 @@ # # Search for python which is required -find_package(PythonInterp REQUIRED) +if (ABIMap_FIND_REQURIED) + find_package(PythonInterp REQUIRED) +else() + find_package(PythonInterp) +endif() -# Search for abimap tool used to generate the map files -find_program(ABIMAP_EXECUTABLE NAMES abimap DOC "path to the abimap executable") -mark_as_advanced(ABIMAP_EXECUTABLE) -if (NOT ABIMAP_EXECUTABLE AND UNIX) - message(STATUS "Could not find `abimap` in PATH." - " It can be found in PyPI as `abimap`" - " (try `pip install abimap`)") -else () - set(ABIMAP_FOUND TRUE) -endif () +if (PYTHONINTERP_FOUND) + # Search for abimap tool used to generate the map files + find_program(ABIMAP_EXECUTABLE NAMES abimap DOC "path to the abimap executable") + mark_as_advanced(ABIMAP_EXECUTABLE) + + if (NOT ABIMAP_EXECUTABLE AND UNIX) + message(STATUS "Could not find `abimap` in PATH." + " It can be found in PyPI as `abimap`" + " (try `pip install abimap`)") + endif () + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(ABIMap REQUIRED_VARS ABIMAP_EXECUTABLE) +endif() + + +if (ABIMAP_FOUND) # Define helper scripts set(_EXTRACT_SYMBOLS_SCRIPT ${CMAKE_CURRENT_LIST_DIR}/ExtractSymbols.cmake) @@ -392,3 +403,5 @@ function(generate_map_file _TARGET_NAME) ) endif() endfunction() + +endif (ABIMAP_FOUND) |