Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMAKE Support #34

Closed
wants to merge 6 commits into from
Closed

CMAKE Support #34

wants to merge 6 commits into from

Conversation

clinthidinger
Copy link

I added CMAKE support. I tested building on Windows10 (Visual Studio), Ubuntu, and OS X.

To test:

  1. Install CMAKE.
  2. mkdir build; cd build;
  3. cmake .. -DBUILD_TESTS=ON
  4. make

@x42
Copy link
Owner

x42 commented Mar 29, 2018

I will not add a 2nd build system, and certainly not cmake. sorry.

@x42
Copy link
Owner

x42 commented Mar 29, 2018

One option would be to switch to a modern, sane and standard-compliant build system at some point. meson perhaps when it's ready (and remove auto-tools).

My issue with Cmake: It does not follow any standards (e.g. CC CFLAGS etc environment variables). it does not even support listing compile options, cross-compilation is tricky and the syntax is horrible. It's by far the worst build system I've seen.

As for the case at hand, the CMakeList.txt that you provide only does a fraction of what configure.ac currently does (there's no version subsitution, no symbol export..) I can leave this PR in place for users who are interested for one reason or another but I cannot recommend using it. You're on your own there.

@clinthidinger
Copy link
Author

Ok, cool. I CMake'd it to integrate with some other libraries that I was using (mostly portaudio) and get it running on windows. I wanted to share, but definitely understand why you might not like CMake.

@x42 x42 mentioned this pull request Mar 30, 2018
@lp35
Copy link

lp35 commented Apr 3, 2018

I add my 2 cents: I agree that there are many flaws in CMake language. Considering the use of CMake version > 3.0:

  • Syntax is horrible: I cannot contradict you on this!
  • CC and CFLAGS: did some test this morning with a colleague: CC and CFLAGS seems to be automatically appended to CMAKE_C_FLAGS if properly configured and not overriden.
  • Crosscompilation: For a small library, crosscompilation is relatively easy. AC heavily rely on unix command that makes it totally unportable on non UNIX project. CMake also supports Mac.
  • Version substitution: in our company project, we use configure_file
  • Symbol export can be achieved by passing linker options using target_link_libraries. Also note that there is WINDOWS_EXPORT_ALL_SYMBOLS.
  • Concerning listing options: https://stackoverflow.com/questions/16851084/how-to-list-all-cmake-build-options-and-their-default-values

@x42
Copy link
Owner

x42 commented Apr 3, 2018

The lib compiles just fine on OSX 10.5 PPC -- that OS comes with make and autotools, but getting cmake -- or even cmake > 3.0 as you suggest -- going there is a major project. And yes, the library is being used on OSX 10.5 (actively by Ardour, and by various commercial legacy products).

I suggest to read the configure.ac, it is not about "EXPORT_ALL_SYMBOLS" but exporting dedicated symbols on all platforms; here: export-symbols-regex '^(ltc_).*' -- this allows to strip the library but offer separate debug symbols as well.

The library works on > 10 CPU architectures and all major OS; incl Windows (XP or later), OSX, macOS, *BSD and Linux. cross-compilation for windows works as well as multi-architecture/universal-binaries. I have not seen a single Cmake project that achieved the same level of compatibility (and yes, I do work with cmake for other projects unless I can avoid it)

tl;dr: sadly, autotools still sucks least.

@x42 x42 closed this Apr 3, 2018
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.

4 participants