Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [paho-dev] Paho C and C++ build systems
  • From: Frank Pagliughi <fpagliughi@xxxxxxxxxxxxxx>
  • Date: Tue, 1 Sep 2020 12:49:05 -0400
  • Autocrypt: addr=fpagliughi@xxxxxxxxxxxxxx; keydata= LS0tLS1CRUdJTiBQR1AgUFVCTElDIEtFWSBCTE9DSy0tLS0tCgptUUdOQkY0c1V6OEJEQURT TjNEQ2FoUFd3ek8vVDlvT2c0a2pnalE4Z2VCWHpNRkR2OEhLZzQzVXJocGc4d0srCnJBY3g4 V0NYRWJIalBnQ1paR1UzOVVQOEYyWDNzekxvQUJLWGp1SFo2ZjRyV0dpZ3ZodGJXRDNkbmgz eFdzcTcKM0Y3YmNmVCtZcSttZ3FkT1JnNlV0T1g5VzA3VVkxQzdkSzlieU5BY2FxaE9QT1VM YkM2dWdMZWVWaDN4WER3NwowaHphNGcrVlJNM1p3Q09SeTZDUERndjFVclQ1YVZrOWl2dEFj aVByY1RQR1BDVEtHRGhmb3k1N002Vm9TOTJQClNGYU5ycXVKUUtHRjlHR1l4dmQ4WXlvaDJH VVRCcHJNaU1xd0ZLNlJLVXpwalhhK0hWQmUvTkg3NmpuZXJHWUQKQ2JlT2RtbzNoUlgzRlI4 eTBOcHh6Q0pIdkNHYjVONXBxc3ROS0pLYll0ZFJud3lSWUN5UEkrc1ppd3B3UnluZgpYQUM5 SVBzL3NUMnV1eDJMMWppREoxOGRidlpIT0hDckFreDVjVWpienFNYldxZS8rM0lDOWNBM0dH RGlkSnpxCk51TndoM1hpVEdXUmNuVmFhK0hFN0YyQVdOZXpNaUpGa1JNVGtPYllqV20zQzg0 TDJuZnJnWnR6MEE5V0RKcDEKMmhaQVkrMnNqZ1NIZmdFQUVRRUFBYlFtWm5CaFoyeHBkV2Rv YVNBOFpuQmhaMnhwZFdkb2FVQnRhVzVrYzNCeQphVzVuTG1OdmJUNkpBZFFFRXdFS0FENFdJ UVJq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oTkpBblVJaHZ4a3dnVmZMCjZndzZVT1VjUktMbjM5OG9MUmho K2lKRDcrWmRIVkdlSTdtVGtnUC9acTZyN1BEMlBmemVpN0E2WGUyamQvaWUKOXlwZldqR3ZS bmN2YWFXa0pva0tYWHR2Q2YyMFBZbTNBeHNBdklvNmZYcmNTdk9DYVNCajZ3YzZHOFZzM1JU egozMFJwWnVBVU9ZZlBWNWJ1RGRLNk5BUUticWVkenRzc01PVzdxc0hECj1YcTFWCi0tLS0t RU5EIFBHUCBQVUJMSUMgS0VZIEJMT0NLLS0tLS0K
  • Delivered-to: paho-dev@xxxxxxxxxxx
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=dk12062016; d=mindspring.com; b=HB2hJA3zdpH/0YAwBxgSIv0kNb7hjSgCGTnNRJ5cA3vnozgwsVbN+CiGm42Uw/ifnCETOsFKVWypETTQuKnPQAMvuYUXqB3x3kgtJmXkd3UM2noX/opCEUzB0MQFyFUiC/qCA3RI4bHTd8V7r/sU6v0AOcVv3uLKFzsRGATOo1byzchi+7UXkqDycMKVq8UaHXKqVk6VfJdN0R/5Uk4q2Ne26wtrd9bAgGppxzm8xR6zC18l7T2kB9WfGxr6jdsMFPCEMEBWuwect7JR48TPS5mknHcvTsDaPu0YHAe7M+SdFmhzObgAisTE+92eZtlfFQ4ew+7bcXBdUrSUUCBOEQ==; h=Received:Subject:To:Cc:References:From:Autocrypt:Message-ID:Date:User-Agent:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding:Content-Language:X-ELNK-Trace:X-Originating-IP;
  • List-archive: <https://www.eclipse.org/mailman/private/paho-dev>
  • List-help: <mailto:paho-dev-request@eclipse.org?subject=help>
  • List-subscribe: <https://www.eclipse.org/mailman/listinfo/paho-dev>, <mailto:paho-dev-request@eclipse.org?subject=subscribe>
  • List-unsubscribe: <https://www.eclipse.org/mailman/options/paho-dev>, <mailto:paho-dev-request@eclipse.org?subject=unsubscribe>
  • User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

After watching a dozen YouTube videos on the subject, my take is that
"Modern CMake" is mostly about improved modularity. Mainly that each
library is able to contain its settings without having global variable
leak into or out of it, and that it's "interface" (where its headers and
libraries live, for example) is clearly defined and easy to use by any
application that wants to link the library.

More inline...

On 9/1/20 11:58 AM, Greg Troxel wrote:
> Frank Pagliughi <fpagliughi@xxxxxxxxxxxxxx> writes:
>
>> I'd like to spend a little time in the near future getting the CMake
>> build systems for the Paho C and C++ libraries fixed and modernized. A
>> huge percentage of the requests I'm getting lately are just about how to
>> build and install the libraries. I know there's also a push lately to
>> just get the projects into Conan and/or create installable packages, but
>> fixing the CMake would help there, too.
> Packaging is important, but I think projects need to focus on having a
> build system that is well documented and that works correctly.  Then
> making a package is relatively easy.  (I work on pkgsrc, which packages
> many things, include Paho python and mosquitto.)
>
>> What I would like to do is:
>> 1. Get the build systems of both projects up-to-date with current,
>> modern, modular CMake best practices.
> I am unclear on what cmake people think is best practice, but I will
> suggest that this includes "There are no (or minimal) switches by OS in
> the cmaekfiles.  Instead, there are feature tests."  This means that it
> is far more likely to work on other operating systems.   I see a lot of
> cmakefiles that have lists of OS and have to be patched every time you
> compile it on a new OS, for no good reason.  autoconf culture got this
> right; cmake lets you get it right but there seems to be a culture of
> doing it wrong.

Agreed, though it seems like there's finally an effort on the part of
the CMake folks to start preaching about what bad/old techniques need to
be deprecated, and how they should be replaced in current projects.



>
>> 2. Properly handle transient dependencies
> I don't know what that means.

This is mainly a CMake thing... make it easy for apps and higher-level
libraries to find and link their dependencies in their build systems,
assuming that those also use CMake.

That means, basically, if an application wants to use Paho C++, it
shouldn't need to know or care (too much) that the library, in turn,
needs the Paho C lib underneath. To help out end users, the Paho C++ lib
should do the hard work of finding the C lib and then passing those
results back up to the app's build system as to what additional
libraries are needed.


>
>> 3. Properly export the installs with consistent naming, etc
>> 4. Have the C++ lib automatically build the C lib if not found
> Are Paho C and Paho C++ separate projects?  If so, does the C++ one
> depend on the C one?  Separate tarballs? Separate install targets?

Yes on all counts. The C++ lib is a separate project that wraps the C
library.

>
> From a packaging viewpoint, what is ideal is if there is a tarball that
> can build, test and install the C library.  Then one to build C++ and if
> C++ needs the C lib (because it's a wrapper, instead of being an
> implementation in C++), then it should expect it to be installed.

Yes, that's part of what needs to be done.

>
> An alternative view is that there is one package, which is both C and
> C++ and just builds both.  C++ is fairly normal, although C++11 is a
> barrier in many environments still I suspect.   So I would not be a big
> fan of this.

Yeah, it's C++11.

>
> Another thing is tests.  People should be able to run the tests easily.
>
> Also, see autoconf/automake's notion of "make dist" to make a
> distribution tarball, and "make distcheck" to unpack that tarball and do
> an objdir build of it and then run the tests.  cmake culture appears not
> to do this.   Doesn't need to be in cmake per se, as long as it's a
> shell script (/bin/sh, POSIX, not bash, per the usual portability norms).

Some of that is in the C lib, but not yet in the C++ library. So that's
on the list.

Frank



Back to the top