Skip to content

Commit

Permalink
compare linux distributions 'lsb_release' in find script
Browse files Browse the repository at this point in the history
issue #220
  • Loading branch information
Scott M Anderson committed Oct 25, 2018
1 parent c77c49d commit 8b5a4fa
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions modules/Findscript.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,21 @@ else()
message(STATUS "@CMAKE_PROJECT_NAME@: ${findFile}.")
message(AUTHOR_WARNING "Find scripts don't match. You may want to update the local with the @CMAKE_PROJECT_NAME@ version.")
endif()
execute_process(COMMAND lsb_release --description
OUTPUT_VARIABLE lsbDesc # LSB (Linux Standard Base)
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_VARIABLE lsbErr
)
if(NOT lsbErr)
set(infoFile ${@CMAKE_PROJECT_NAME@_DIR}/@CMAKE_PROJECT_NAME@_${@CMAKE_PROJECT_NAME@_SIG}.txt)
set(lsbString "^lsb_release Description:[ \t]+(.*)")
file(STRINGS ${infoFile} LSB REGEX "${lsbString}")
string(REGEX REPLACE "${lsbString}" "\\1" xpLSB ${LSB})
string(REGEX REPLACE "Description:[ \t]+(.*)" "\\1" thisLSB ${lsbDesc})
if(NOT xpLSB STREQUAL thisLSB)
message(AUTHOR_WARNING "@CMAKE_PROJECT_NAME@ ${xpLSB} build\n${PROJECT_NAME} ${thisLSB} build")
endif()
endif()
message(STATUS "Found @CMAKE_PROJECT_NAME@: ${@CMAKE_PROJECT_NAME@_DIR}")
list(APPEND XP_MODULE_PATH ${moduleDir})
link_directories(${@CMAKE_PROJECT_NAME@_DIR}/lib)
Expand Down

0 comments on commit 8b5a4fa

Please sign in to comment.