-
-
Notifications
You must be signed in to change notification settings - Fork 487
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
added cmake build #109
base: master
Are you sure you want to change the base?
added cmake build #109
Conversation
Hi @linux-fan-dave, do you mind sharing some details regarding the purpose of this PR? |
Looks like @linux-fan-dave prefers CMake over autotools, and I share this preference. |
Ups sorry. I thought I did provide a description. I simply added a CMake build file as a alternative to the autotools build. If you already use CMake it is really easy to add dependencies to other CMake projects. Autotools do not integrate quite as nice. |
This cmake script is not equivalent to the autotools one. Differences I can find:
|
Would the CMake build file be accepted if it were without the mentioned problems? |
@linux-fan-dave I am not a maintainer so I can't answer your overall question (but in general I like cmake more than autotools so +1 from me). Of course you should wait to see if the maintainer wants this change before doing more work on this. As to 1, there is this line in configure that queries Moreover, your parameter is not overridable in the command line. It should probably use the CACHE option, and provide a short help string. |
I don't get what dependencies you mean. Is there some other task than locating the |
In general, cmake allows you to easly "add_subproject()" which is useful when you want to link (for example statically) against another library, then cmake will build another cmake project as dependency and provide you the thing. Here however, patchelf is a application not library, so no much useful. This said, CMake sucks much less than Autotools and I am honestly surprised when i see a software that is not from '90 but decide to start with autotools. If I could I would replace autotools everywhere with CMake. :) |
I'm getting off-topic: my experience is that autotools-based tend to be more robust – when you have some "unusual" demands, and I was surprised by that. In particular I dealt with wanting to put different parts of the application to different prefixes ( EDIT: I don't mean to deny that much of autotools feels terribly hacky and it's showing its age, but I don't think the situation is as clear as "cmake is always better for new projects". (Besides, patchelf is over ten years old now.) |
In our case we have a cmake based project which needs to patch some binaries before beeing deployed. We therefore included patchelf as a third party project to our project and compile it. It therefore can be used in a postbuild step. |
to detect automatically Linux PAGE_SIZE you could write cmake execute_process! Something like this will do the trick
But untested though... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This misses install()
steps to actually place the compiled executable somewhere.
@@ -0,0 +1,28 @@ | |||
project(patchelf) | |||
cmake_minimum_required(VERSION 2.8) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simply require version 3.1 here and enable the C++11 mode with it unconditionally below.
I'm going to see if I can get this working... fingers crossed |
Both cmake and meson projects should be added, the community must address the bugs until the projects are 100% compatible with the autotools stuff. The maintainer only has to mention in the readme file that only the autotools project is officially supported, any bug in the other projects is ignored unless the community provides patches, sounds reasonable doesn't it? And perhaps to avoid any confusion, the projects should go inside a subdir, i.e. When it comes to cross-compiling, autotools offers the shortest solution (--build=xxx --host=yyy), but other build systems offer better syntax (specially meson), several times faster configure, out-of-tree builds, support for Windows and non-posix systems, etc... |
No description provided.