libpsl icon indicating copy to clipboard operation
libpsl copied to clipboard

Adding a basic CMakeLists for building a static library

Open Coeur opened this issue 3 months ago • 3 comments

Based on @ckerr code at https://github.com/transmission/libpsl/blob/692c69d2415e1b20378030c08607935a54434087/CMakeLists.txt

Adapted for upstream.

Added a cross-platforms workflow to trigger it on each pull request (ubuntu, windows, macos).

Coeur avatar Nov 10 '25 11:11 Coeur

Please add CMakeLists.txt to EXTRA_DIST in Makefile.am. That adds the file to the tarball, so that the instructions also work when building from tarball.

rockdaboot avatar Nov 10 '25 18:11 rockdaboot

Asking for the sake of clarity...

What's the overall desired goal for CMake support. e.g. is this about using it via add_subdirectory from another CMake project?

eli-schwartz avatar Nov 10 '25 19:11 eli-schwartz

In my use case (Transmission), yes:

  1. We have libpsl as submodule under "third-party".
  2. We do add_subdirectory("third-party/libpsl" "${PROJECT_BINARY_DIR}/third-party/libpsl.bld")

https://github.com/transmission/transmission/blob/b372f7b193a2c02864af33093295d26b7caacfb7/CMakeLists.txt#L554-L555 https://github.com/transmission/transmission/blob/b372f7b193a2c02864af33093295d26b7caacfb7/cmake/TrMacros.cmake#L148

Coeur avatar Nov 10 '25 19:11 Coeur