Hi Dushara and all ,
I am another Aussie working on something similar ( each of our
applications also has a test application also ) ..
At the moment we have :
add_subdirectory in the top level cmakelists file
In each subdirectory the cmakelists file adds targets ..
some of the subdirectories are for libraries
some are for executables .
As well as our own library we also use other libraries like gtest,
boost, libmusicxml
We have had a bit of luck but getting everything to link properly is tricky.
Please let me know if you get anywhere!
If anyone can shed some light it might save me a lot of time ..
Linking boost or gtest are pretty simple its the shared library we
have written ourselves which is giving me a headache!

Best Sean


On Sun, Jun 18, 2017 at 10:02 PM, Dushara Jayasinghe
<dush...@successful.com.au> wrote:
> Hi all,
>
> Here's a little puzzle that's got me scratching my head a bit. I've got a
> CMake project that is composed of two separate applications - let's call
> them system and recovery - that share a common library framework. I'd like
> to keep it all within a single repository.
>
> The applications are composed of multiple executables and shared libraries.
> What I would like to be able to do is to produces two install trees for the
> two applications with their respective library dependencies.
>
> Things I have attempted so far are:
>
> 1. Perform the build + install in sub-directories of each application:
>    With this approach, the shared library files that the applications
>    depend on don't get installed (they're in a sibling directory of the
>    applications)
> 2. Creating two top level custom targets with the the application
>    binaries as their dependencies: The build part works great (only the
>    required binaries and libraries are built), but the install rule
>    causes everything to be built (due to it's dependency on ALL)
>
> Method 2 seems promising if I can have a rule such as install/recovery or
> some such, but that doesn't seem possible for a custom target that doesn't
> generate anything.
>
> Has anyone else solved something like this before? Any suggestions?
>
> Thank you,
>
> Dushara
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake



-- 
www.seanwayland.com

Sean Wayland

licensed real estate salesperson
phone: 3475231455
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Reply via email to