Skip to content

cmake: fix build and achieve parity with autotools - #6

Open
pauljevans wants to merge 4 commits into
doug-gilbert:mainfrom
pauljevans:cmake
Open

cmake: fix build and achieve parity with autotools#6
pauljevans wants to merge 4 commits into
doug-gilbert:mainfrom
pauljevans:cmake

Conversation

@pauljevans

Copy link
Copy Markdown

Update the CMake build so it correctly discovers and links against the
system-installed libsgutils2 on both Debian/Ubuntu and Fedora/RHEL,
and bring feature checks, platform support, and packaging to parity
with the autotools build.

Add all the feature checks and platform support that were present
in the autotools build but missing from CMake.

  • Use pkg-config with find_library/find_path fallback to discover
    both the sgutils2 library and its headers.
  • Add CPack RPM/DEB runtime dependencies, using dpkg-shlibdeps for
    correct Debian package names. Only enable DEB/RPM generators when
    dpkg/rpmbuild are present.
  • Bump cmake_minimum_required to 3.18.

Use pkg_check_modules() to find both the library and its include
path (e.g. /usr/include/scsi on Ubuntu), with find_library/find_path
fallback. Remove redundant add_definitions(-DSG_LIB_LINUX), fix
static build to use target_link_options instead of add_definitions.

Signed-off-by: Paul Evans <pevans@redhat.com>
Add missing feature checks, platform-specific defines and flags,
and fix doc/CMakeLists.txt paths. Clean up config.h.in.cmake and
add CPack RPM/DEB runtime dependencies. Bump minimum to 3.18.

Signed-off-by: Paul Evans <pevans@redhat.com>
@doug-gilbert

Copy link
Copy Markdown
Owner

Missed this one. Already applied some of this one upstream. Hand applying now and on Ubuntu 26.04 I get "Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)". Continuing to apply ...

doug-gilbert added a commit that referenced this pull request Jun 10, 2026
…BSD work from my end

git-svn-id: https://svn.bingwo.ca/repos/sdparm/trunk@401 c1e33020-0f26-4edd-b954-b49f5d3ab223
@doug-gilbert

Copy link
Copy Markdown
Owner

Now applied the rest of this PR by hand upstream. That is subversion revision 401 and what looks like github commit abf32f3 . Please review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants