Which suggestions? There were two related to the problem and one
unrelated ("BTW: ...").
Please be more specific, otherwise helping you becomes tedious (and
people trying to help may lose their patience).
"the same conclusion" is not very helpful. Even if this seems to be
"the same" for you someone else (like me) might read more out of it.
That all said ... I'm sorry,
I forgot to
post yet another tiny modification :-(
See comment in full file shown below:
$ cat 2/app/CMakeLists.txt
add_executable(trial-02
dual.cpp
)
target_include_directories(trial-02 PUBLIC
${FLTK_INCLUDE_DIRS}
${CAIRO_INCLUDE_DIRS}
../cairo-code
)
target_link_libraries(trial-02 PUBLIC
cairo-code # <<< needs to be changed as shown here !!!
Threads::Threads
fltk
${CAIRO_LIBRARIES}
)
# set install directories
install(TARGETS trial-02 RUNTIME DESTINATION ~/.local/bin)
[end of file]
This missing change explains the error message you posted above
because you used syntax for a directory (
../cairo-code)
whereas this statement requires libraries. In many cases you can use
target names like `
cairo-code` which
is the library target you built in the subdirectory.
While we're at it: you may also want to replace `
fltk` with `
fltk::fltk`
which is the "modern CMake" notation of imported targets
(libraries), just as in `
Threads::Threads`
[1], whereas `
${CAIRO_LIBRARIES}` may
be anything that can be interpreted as one or more (i.e. a list of)
libraries.
HTH
Albrecht
[1] if the imported library supports this (FLTK does, if it is used
in CONFIG mode)