-
Notifications
You must be signed in to change notification settings - Fork 399
Modern CMake configuration refactoring #130
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
Conversation
|
The latest CI builds of this PR are failing due to AppVeyor - https://ci.appveyor.com/project/dbaston/geos-rxhmj/builds/19662254
Travis CI - https://travis-ci.com/libgeos/geos/builds/88630941 |
|
FYI, updated lowering CMake requirement to 3.11, but it may be possible to lower it further eg. to 3.5. I just have no mean to test it against 3.5. |
|
I tried lowering to 3.10 and got:
CMake Error at tests/xmltester/CMakeLists.txt:15 (add_executable):
add_executable called with incorrect number of arguments
This is with version 3.10.2 which is what Ubuntu 18.04.1 LTS
ships (supported distribution till April 2020).
|
|
Thanks for testing. I've applied workaround to |
|
CMake 3.10.2 worked, and subsequent `make` invocation took:
real 3m36.079s
user 3m17.767s
sys 0m18.087s
Subsequent failed tests:
make: *** No rule to make target 'check'. Stop.
make: *** No rule to make target 'dist'. Stop.
make: *** No rule to make target 'distcheck'. Stop.
make: *** No rule to make target 'uninstall'. Stop.
The `install` rule worked, but I only see two library files
installed in /usr/local/lib/ with the current time:
-rw-r--r-- 1 root root 21007490 Oct 29 12:30 /usr/local/lib//libgeos.a
-rw-r--r-- 1 root root 756596 Oct 29 12:30 /usr/local/lib//libgeos_c.a
No .so files (maybe because they were found already present ?)
|
"With CPack enabled, "make help" will show all the valid targets" That, however, someone will have to work about.
By default, static libs are generated. Use CMake native BUILD_SHARED_LIBS to ask for shared. |
Minimal build and install features implemented according to Modern CMake best practices for all GEOS targets, libraries and tests. Require CMake 3.5 or later. Add cmake/CMakeSettings.json sample with convenient defaults for users of CMake integration in Visual Studio 2017 (usage: copy to root folder). Add cmake/geos-configure-file.cmake from Dan Baston (@dbaston).
|
@dbaston FYI, I've fixed the PR to make it single-commit again, as I prefer it. Future of this PRSince you have expressed interest to expand it, I think it may be a a good idea to consider either
Either way, I expect it to be easier for you to continue the work since I strongly prefer single-commit pull requests, so my workflow involves |
|
@mloskot I will continue work in a new branch: https://github.com/dbaston/libgeos/commits/modern-cmake |
|
@dbaston Great. Shall we close this PR? |
|
I'm going to close this PR and hope Dan's branch is active. |
|
Good idea. @dbaston Can I delete my |
Minimal build and install features implemented according to Modern CMake best practices for all GEOS targets, libraries and tests.
Require CMake 3.5 or later.
Add
cmake/CMakeSettings.jsonsample with convenient defaults for users of CMake integration in Visual Studio 2017 (usage: copy to root folder).Add cmake/geos-configure-file.cmake from Dan Baston (@dbaston).
I tested it with CMake 3.11+ on Linux (GCC, clang) and Windows (Visual Studio).
@robe2, @pramsey, @dbaston - following our discussions on IRC, here I pushed complete update of my ml/modern-cmake branch, rebased on the latest
master@ c818506Tasklist
Iteration of CMake script clean-ups adding missing
unset, removing any unnecessary bits and bobs (eg. variables), etc.Add GEOS client example configured with CMake as a test to verify
geos-config.cmakepackage configuration file deployment.Update README.md with building, testing, installation and using GEOS with CMake
Update
.travis.ymlwith complete workflow: configure, build, test, install, configure and build client. Install latest CMake. Remove Autotools jobs.Update
.appveyor.ymlwith workflow: configure, build, test. Install latest CMake. Remove NMake jobs.Update
.appveyor.ymlwith rest of workflow: install, configure and build client.Tag version with git hash, tag or
-dirtyindicator for modified working copy (see CMakeVersionSource.cmake and related scripts) in CMake's codebase)Review compilation flags for supported compilers for both consumers, client and developer
Replace ugly old-school
if-s setting flags per compiler with generator expressions passed totarget_compile_optionsandtarget_compile_definitions, for example:$<$<CXX_COMPILER_ID:GNU>:-Wall;-Wextra;-Wpedantic> $<$<CXX_COMPILER_ID:MSVC>:NOMINMAX>Add support for OSX Framework
Deal with
tools/CMakeLists.txtor remove alogn withgeos-configscriptAdd CPack integration
Add target for Doxygen build
...
Since I'm not sure if/when I'd be able to complete those TODOs, I'll hand the work over to you now.