USNavalResearchLaboratory / norm

NACK-Oriented Reliable Multicast (NORM) implementation & tools (RFCs 5740, 5401)
https://www.nrl.navy.mil/Our-Work/Areas-of-Research/Information-Technology/NCS/NORM/
Other
96 stars 33 forks source link

Install norm into include instead of include/norm #11

Closed mjvankampen closed 4 years ago

mjvankampen commented 4 years ago

Does not break existing use of norm

bebopagogo commented 4 years ago

Does this install all of norm header files? Or just the "normApi.h" file? To use the NORM library, only the "normApi.h" file is needed. Also, I have thought about renaming that file to simply "norm.h" (although that of course would break existing code that expects "normApi.h"). Do you have an opinion on that?

mjvankampen commented 4 years ago

Ah will change so it only installs normApi.h.

I don't know how big your user base is. But if you at one point have multiple headers to for example separate functionality, it would make sense to have a norm folder in your include dir with norm.h

So you would do #include <norm/norm.h> to consume. But tbh I would also be fine leaving it as is. Especially as it is only that single header.

bebopagogo commented 4 years ago

It’s a good suggestion if that’s a more common convention for how things are organized. With the single header file (and I intend to keep it that way if possible), it doesn't seem worth it right away as I would need to update the Makefiles, waf and various Visual Studio files (also for other external projects including some set up with Projucer (for my JUCE projects) accordingly. Some of those do use the NORM code more directly for debugging convenience.

I have been looking into this a little bit with our move to GitHub. I read an article the other day with some guidelines for CMake projects. The ‘waf’ build creates a “build” directory where the build files go. I know CMake creates its “CMakeFiles” directory, but I am surprised it puts all the products up into a main directory. For the “makefiles”, I create “lib” and “bin” directories for the products (although I keep a copy in the makefiles directory, too).

It would probably be good to tackle all of that reorganization at one time?

mjvankampen commented 4 years ago

Ok this PR should be good to go now.

As for CMake behaviour. What I normally do is:

mkdir build
cd build
cmake ../
cmake --build . -j12
cmake --install .

Cmake allows you to build out-of-source. As soon as you've built it the package can be consumed by a different cmake project straight away but this is not very clean. Better is to install your project with cmake --install . This will give an output as below, resulting in everything being neatly installed in your usr folder.

afbeelding