-
Notifications
You must be signed in to change notification settings - Fork 89
CMake build #6
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
Merged
Merged
CMake build #6
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Features: - Export targets from BOTH the build AND install trees - README.md updated to reflect addition of CMake support TODO: - Add tests using json_example.f90 - Test on Linux (and Windows?) - Add uninstall target?
- README.md updated and reflowed - jsonfortran-${CMAKE_Fortran_COMPILER_ID} is now passed to `find_package()` by projects wishing to import jsonfortran - libraries and mod files installed under fortran/${CMAKE_Fortran_COMPILER_ID} to enable parallel installation of packages built by different compilers the package config logic ensures that the correct compiler is used
1. For some reason, CMake refuses to add the requisit linker flags (`-Wl,-rpath,/path/to/dylib`) when building executables against the imported dylib on Mac OS X and the Intel compilers. gfortran 4.9 seems to not trigger this CMake bug for some reason. Still investigating. 1. An option is present to select absolute install_name_dir vs @rpath on Mac when building the dylib. Since some issues with @rpath and CMake persist the `INSTALL_NAME_DIR` property is used rather than `@rpath` 1. However, if `DESTDIR=...` is defined when you `make install` the install name dir set at congigure time is no longer correct. Some install time CMake code was added to help fix this. 1. Some cached properties controling the build behavior were re- named to enable better grouping in `cmake-gui` and `ccmake`
More quoting of file names and directories to be defensive. @rpath seems to work all the time now, except when using DESTDIR to install. Also, the contents of <proj>-targets.cmake seem to be pointing to incorrect places to find targets, but this doesn't seem to cause any issues. (other than, perhaps, the @rpath issue)
…build This incorporates upstream changes from github.com:jacobwilliams/json-fortran made by @jacobwilliams. Conflicts: README.md
Introduced by accidental paragraph reflow
@@ -1,4 +1,5 @@ | |||
bin/ | |||
lib/ | |||
builds/ |
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 is what I use as my build directory, or dirs under this… Usually one for intel one for gfortran
mod files are now installed along library archives/objects, under `<prefix>/lib/<project>-<version>/<compilerID>/` Some variables were refactored to, to try to simplify the CMakeLists.txt file.
Pushed some CMake ugliness to included files
e.g. /usr/local/jsonfortran-intel-1.0.0
…into CMake-build
|
|
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I tried to test it pretty thoroughly on Mac and Linux. On Mac I tested with ifort beta 2015 and gfortran 4.9 stable. On linux I only tested with ifort 13.1.
The toughest bit was building the dynamic/shared libraries correctly and exporting the project so that other CMake projects can find them and link against them with the correct -rpath linker flag especially when DESTDIR is passed to
make install
make check
automated testingHopefully if y�ou download CMake you can give it a spin pretty easily.