Registered Member
|
Hi,
I'm trying to get CMake work with multiple subdirectories for the same target. I'm using add_subdirectory(...) and then I'm using set(...). The problem is that although the value of the variable being set is inherited. at the top level it is not changing. Presently the top level CMakeList looks like this:
In the ui subdirectory, I have another CMakeLists with the following content
I'm getting linker errors, and using message(${TestApp_SRCS}) after including the ui subdir, shows that mywidget.cpp was not appended to the variable. However at the ui level, mywidget.cpp is being appended properly. Can anyone please explain how this should be done? Thank you in advance |
Administrator
|
add_subdirectory() is only needed when having completely different executables, etc. across directories.
Therefore you should add everything from the top level CMakeLists.txt file, using directory/file in the set() command.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell