<div dir="ltr">So I have all these third party libraries I keep a copy of... <div><a href="https://github.com/d3x0r/SACK/tree/master/src/contrib">https://github.com/d3x0r/SACK/tree/master/src/contrib</a><br></div><div><br></div><div>So libressl for example, has cmakelists.txt</div><div><br></div><div><a href="https://github.com/d3x0r/SACK/blob/master/CMakeLists.txt#L680">https://github.com/d3x0r/SACK/blob/master/CMakeLists.txt#L680</a><br></div><div>
<span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,92,197);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:pre;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial">add_subdirectory</span><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:pre;word-spacing:0px;background-color:rgb(255,251,221);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">( src/contrib/libressl/</span><span class="gmail-pl-smi" style="box-sizing:border-box;color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:pre;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial">${LIBRESSL_VERSION}</span><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:pre;word-spacing:0px;background-color:rgb(255,251,221);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"> )</span>
<br></div><div><br></div><div>which I aliased a bit for upgrade/migration/regression...</div><div><br></div><div>I also link optionally to bullet...</div><div><br></div><div>
<span class="gmail-pl-k" style="box-sizing:border-box;color:rgb(215,58,73);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:pre;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">IF</span><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:pre;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">( </span><span class="gmail-pl-k" style="box-sizing:border-box;color:rgb(215,58,73);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:pre;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">EXISTS</span><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:pre;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"> </span><span class="gmail-pl-smi" style="box-sizing:border-box;color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:pre;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">${BULLET_SOURCE}</span><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:pre;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">/CMakeLists.txt </span><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:pre;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">)</span>
<br></div><div> # setup a bunch of options... </div><div>
<span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:pre;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"> </span><span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,92,197);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:pre;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">add_subdirectory</span><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:pre;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">( </span><span class="gmail-pl-smi" style="box-sizing:border-box;color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:pre;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">${BULLET_SOURCE}</span><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:pre;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"> bullet )</span>
<br></div><div><br></div><div><br></div><div>In the second case, bullet is outside my source tree, (next to it with other top level projects), so I have to specify a name to be used in the CMAKE_BINARY_DIR (bullet) to use for temporary space to build...</div><div><br></div><div>and then just link like any other included target</div><div><br></div><div>target_link_libaraies( myThing bullet ssl tls crypto )</div><div> </div><div><br></div><div>it's really not that hard, and if you don't understand add_subdirectory.... well... I can't imagine such a world it's so good for breaking up things into related funcational groups...</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 9, 2018 at 4:10 PM, Christofer Jennings <span dir="ltr"><<a href="mailto:bozmoz@gmail.com" target="_blank">bozmoz@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Thanks for the reply. I haven't figured out how to use add_subdirectories like you suggested but I was able to get it working based on this <a href="https://github.com/josesj/rest-json-cpp-boilerplate" target="_blank">https://github.com/josesj/<wbr>rest-json-cpp-boilerplate</a><div><br></div><div>It uses find_package and etc. ... maybe a little overkill, I don't know. But at least I got off the ground. :)</div></div><div class="HOEnZb"><div class="h5"><br><div class="gmail_quote"><div dir="ltr">On Sat, May 5, 2018 at 12:09 PM J Decker <<a href="mailto:d3ck0r@gmail.com" target="_blank">d3ck0r@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">for such things I often include the sources in my tree and just 'add_subdirectory( "extra/restbed" )'<div>it's cleaner to do a external project rule... </div><div>which can download/checkout sources and then build those and the output is findable by other projects just by referencing the targets.</div><div><a href="https://cmake.org/cmake/help/latest/module/ExternalProject.html" target="_blank">https://cmake.org/cmake/help/<wbr>latest/module/ExternalProject.<wbr>html</a><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, May 5, 2018 at 11:21 AM, Christofer Jennings <span dir="ltr"><<a href="mailto:bozmoz@gmail.com" target="_blank">bozmoz@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi All,<div><br></div><div>How do you use a 3rd party dependency like restbed in a cmake build?</div><div><br></div><div>Total nube here. First dive into CMake and haven't done C++ for a long long time. So forgive my ignorance :) This could just as easily be an "I forgot C++" as an "I don't know CMake"...</div><div><br></div><div>I'm trying to use restbed. I've got it to compile and self test with `cmake, `make install`, and `make test` as directed on the site: <a href="https://github.com/Corvusoft/restbed#build" target="_blank">https://github.com/<wbr>Corvusoft/restbed#build</a></div><div>It makes a `distribution` folder with `include` and `library` sub-folders. The `library` has .a and .so or .dylib files. The `include` folder just has headers, and a `restbed` file with #includes in it.</div><div><br></div><div>I'm using the example on the same page as starting point: <a href="https://github.com/Corvusoft/restbed#example" target="_blank">https://github.com/<wbr>Corvusoft/restbed#example</a></div><div><br></div><div>... I could list out my failed attempts but I don't think it'd help. Basically find_package doesn't find it, and other things I've tried don't work. I'm digging around online but so far nothing seems to fit--which makes me think it's something really really simple that I just don't understand.</div><div><br></div><div>Thanks!</div><div>-Chris</div><div><br></div><div><br></div><div><br></div></div>
<br>-- <br>
<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" rel="noreferrer" target="_blank">http://www.cmake.org/Wiki/<wbr>CMake_FAQ</a><br>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/<wbr>support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/<wbr>consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/<wbr>training.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://cmake.org/mailman/listinfo/cmake" rel="noreferrer" target="_blank">https://cmake.org/mailman/<wbr>listinfo/cmake</a><br>
<br></blockquote></div><br></div>
</blockquote></div>
</div></div></blockquote></div><br></div>