Skip to content

Commit

Permalink
Merge pull request #26 from usdot-fhwa-stol/fix/allow_so_version_zero
Browse files Browse the repository at this point in the history
Allow for 0 SO_VERSION
  • Loading branch information
adamlm authored Sep 22, 2023
2 parents cca01c9 + 72a7345 commit 9d81166
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cmake/Packing.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@ endif()
get_target_property(target_type ${PROJECT_NAME} TYPE)
if (target_type STREQUAL "SHARED_LIBRARY")
get_target_property(so_version ${PROJECT_NAME} SOVERSION)
if (NOT so_version)
# Check if so_version is empty or not found to allow for version 0
# which is normally treated the same as so_version-NOTFOUND in a condition.
if ("${so_version}" STREQUAL "" OR "${so_version}" STREQUAL "so_version-NOTFOUND")
message( FATAL_ERROR "Target property SOVERSION must be defined for shared library packages." )
endif()
endif()
set (PACKAGE_VERSION ${so_version})
endif()

if (NOT PACKAGE_VERSION)
if (NOT DEFINED PACKAGE_VERSION)
message( FATAL_ERROR "PACKAGE_VERSION must be defined for packages." )
endif()

Expand Down

0 comments on commit 9d81166

Please sign in to comment.