[CMake] Cannot add target-level dependencies to non-existent target
Glenn Coombs
glenn.coombs at gmail.com
Fri Jul 3 03:40:45 EDT 2015
I've not come across the target_sources command before - is it new in 3.1.3
? From reading the documentation it looks like it allows one to add
sources to a target *after* the target has been created via add_library or
add_executable. If that is true then that could be a very useful command.
I will investigate further but it could be just what I need.
--
Glenn
On 30 June 2015 at 22:34, Stephen Kelly <steveire at gmail.com> wrote:
> Glenn Coombs wrote:
>
> > I am getting the error in the subject. The code I have looks like this:
> >
> > if (PRE_COMPILED_HEADERS_FOUND)
> > ADD_PRECOMPILED_HEADER(${header_pch} ${source_pch} sources
> > systemc)
> > endif()
> >
> > add_library(systemc ${sources} ${sources_no_pch} ${headers})
> >
>
> Use target_sources after the target is created.
>
> add_library(systemc ${sources} ${headers})
> if (PRE_COMPILED_HEADERS_FOUND)
> ADD_PRECOMPILED_HEADER(${header_pch} ${source_pch} pch_files systemc)
> target_sources(systemc PRIVATE ${pch_files})
> endif()
>
> Thanks,
>
> Steve.
>
>
> --
>
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20150703/bfb50e77/attachment.html>
More information about the CMake
mailing list