dftlibs / numgrid

Numerical integration grid for molecules.
Mozilla Public License 2.0
47 stars 14 forks source link

Export numgrid as a CMake module #12

Closed robertodr closed 7 years ago

robertodr commented 7 years ago

Description

numgrid installation is now discoverable via a find_package command in CMake. To test this out:

project(dummy CXX)

find_package(numgrid REQUIRED) get_property(_loc TARGET numgrid::numgrid PROPERTY LOCATION) message("Location of numgrid: ${_loc}")

- run the following commands:

mkdir -p build cd build cmake .. -Dnumgrid_DIR=${prefix}/share/cmake/numgrid



## Other points covered by this PR
- [x] Use `M_PI` as defined in `cmath`, _i.e._ it's not hardcoded anymore
- [x] Use `std::` namespace to select C++ version of (some) math functions. 
   * **TODO** The error function is still taken from the C standard headers, I will submit a PR for moving the project to C++11 and modernize this point.
- [x] Update Autocmake and request CMake 3.0, at least.
- [x] Both dynamic and static libraries can be built now. `SHARED_LIBRARY_ONLY` and `STATIC_LIBRARY_ONLY` toggle the build of only one of the two options.
   * **TODO** When `STATIC_LIBRARY_ONLY` is selected, the Python interface will not work. How to deal with this case?
- [x] Dependencies of the project, _i.e._ the Lebedev-Laikov and Gtest code have been moved to subdirectories of `external/upstream`
bast commented 7 years ago

This will be very valuable - thanks a lot for doing this!

robertodr commented 7 years ago

Don't know why Travis is dying on this... I will investigate and I should be done with it by today. I will add other stuff in another PR, since this has become too big already. I can confirm that I can now do make install and then, in another CMakeLists.txt do find_package(numgrid) :smile_cat:

robertodr commented 7 years ago

@bast this is ready for review

bast commented 7 years ago

Thank you so much for the cleanup!