<div dir="ltr">that's actually a good point. Currently as I am developing this i am doing an out of source build and just testing it from there but eventually what I want is a shared library that can be used by other programs.<div><br></div><div>currently though my other programs is just a simple main.c that includes the main library which includes all the sub libraries.</div><div><br></div><div>One of the reasons why I chose to just set the paths as I did was that I couldn't get the install command to work, not sure why exactly at that time I was just getting started with cmake so most likely user error. It's been working so far and the main concern right now is to get this c program working then refine the cmake build as I go.</div><div><br></div><div>I just moved the bin directory to my desktop for testing, that seemed to work but this is something to keep in mind.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 10, 2015 at 4:20 PM, Raymond Wan <span dir="ltr"><<a href="mailto:rwan.work@gmail.com" target="_blank">rwan.work@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Owen,<br>
<br>
Sorry to jump into the discussion, but what you're talking is<br>
something I was thinking of just recently...<br>
<br>
I think the choice between this:<br>
<span class=""><br>
<br>
On Thu, Dec 10, 2015 at 3:48 PM, Owen Alanzo Hogarth<br>
<<a href="mailto:gurenchan@gmail.com">gurenchan@gmail.com</a>> wrote:<br>
> set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)<br>
> set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)<br>
> set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)<br>
<br>
<br>
</span>and this:<br>
<span class=""><br>
<br>
> it seems like this line in your reply above<br>
> install( TARGETS lib1 lib2 DESTINATION lib )<br>
</span><span class="">> install( FILES lib1/headers/lib1.h lib2/headers/lib2.h DESTINATION include )<br>
<br>
<br>
</span>comes down to whether you want to compile other programs with these<br>
libraries.  If you will not, then you can set the paths to<br>
CMAKE_BINARY_DIR, which is the path to the top of the build tree.  As<br>
far as I know, after you compile your program, you can/should delete<br>
the build tree (i.e., assuming an out-of-source build).<br>
<br>
So, most likely, you'd want to pick the second option if you need the<br>
header files and archives to build something else.  This is because<br>
when you run cmake, you can set the prefix to install files to (i.e.,<br>
using "make install").  In my case, I only need header files and<br>
archives to build something within a single build (i.e., various<br>
inter-related subdirectories, all under one CMakeLists.txt).  So, I do<br>
something similar to the first option.<br>
<br>
I did toy with the second option a bit but, in the end, realized that<br>
much of what I wrote won't be reused by another project of mine.  At<br>
least, that's my understanding of the two options above...<br>
<br>
Ray<br>
</blockquote></div><br></div>