billyquith / ponder

C++ reflection library with Lua binding, and JSON and XML serialisation.
http://billyquith.github.io/ponder/
Other
633 stars 92 forks source link

Add the include directory to the ponder target #96

Closed leolchat closed 6 years ago

billyquith commented 6 years ago

Thanks for the PR. - I was wondering why you had used the runtime branch?

leolchat commented 6 years ago

I am not really sure, I was just integrating your lib to our system, with the requested branch. One thing too was that the main branch tests do not compile on linux.

leolchat commented 6 years ago

The changes in this branch can easily be ported to the main one too, you decide :)

billyquith commented 6 years ago

The changes in this branch can easily be ported to the main one too, you decide :)

Sure! Thanks for the fixes! - It's just the tests are broken at the moment in that branch, but no matter, I can patch it up. I think I was midway through something. If you're integrating the lib you are integrating an unstable branch that may change substantially.

billyquith commented 6 years ago
target_include_directories(ponder PUBLIC
+    $<BUILD_INTERFACE:${PONDER_SOURCE_DIR}/include>
+    $<INSTALL_INTERFACE:include>
+)

What is the purpose of this? I'm passable at cmake. Certainly don't know all its features!

leolchat commented 6 years ago

The goal is that if linking to the target target_link_libraries(<my_target> ponder::ponder), the include directories are automatically (and transitively) added to building my_target. The 2 lines are to state that when building the library the include folder is local and once installed the include header is the folder include (matching your install commands). This is why the pull request also remove the include_directories calls from your tests.