vimpunk / mio

Cross-platform C++11 header-only library for memory mapped file IO
MIT License
1.71k stars 157 forks source link

Expanded CMake Support #13

Closed apmccartney closed 6 years ago

apmccartney commented 6 years ago

This commit introduces several features for the CMake build system.

To accomodate post-installation consumption, the include preprocessor statements in several library header files were updated to use paths relative to a root include directory rather than paths relative to the file itself.

apmccartney commented 6 years ago

Closes #11

vimpunk commented 6 years ago

@apmccartney Thank you so much for this! I will have time to look at this in more detail tomorrow or the day after at the latest, but it looks promising.

vimpunk commented 6 years ago

@apmccartney So I had some time to look through the changes and try it. I cloned your repo and tried mkdir build && cd build then cmake .. and it failed with:

CMake Error at CMakeLists.txt:65 (add_subdirectory):
  The source directory

    /tmp/mio/test

  does not contain a CMakeLists.txt file.

However, I'm not very good at CMake so it could be that I missed something. Would you be willing to extend the readme to include usage instructions for CMake noobs like myself? I'm thinking of both usage as a library from within another project (i.e. with find_package), as well as just installing it on the system for other projects to use.

apmccartney commented 6 years ago

Whoops! I apologize. I forgot to commit and push CMakeLists.txt file for that directory. At work at the moment but I'll push the file in ~30 minutes

apmccartney commented 6 years ago

The missing file has been committed and pushed. I made a small change to the .gitignore to allow git to track the file going forward as well.

apmccartney commented 6 years ago

Would you be willing to extend the readme to include usage instructions for CMake noobs like myself? I'm thinking of both usage as a library from within another project (i.e. with find_package), as well as just installing it on the system for other projects to use.

Sure! I'll add that content sometime this evening.

vimpunk commented 6 years ago

@apmccartney Awesome, it works as expected now. And sure, at your earliest convenience. Much appreciated!

vimpunk commented 6 years ago

@apmccartney This is exceptional work! Not only did this turn mio into a more complete library, it also taught me a great deal about CMake. Thank you so much!