5 ms·
If you mean the extra work is exporting your libraries and having a list of all your sub_projects in the root CMakeLists.txt, then yes. I think it's minimal wo
by cheesedoodle 6y ago
If you mean the extra work is exporting your libraries and having a list of all your sub_projects in the root CMakeLists.txt, then yes.
I think it's minimal work, as I would like to have all my libraries imported and linked anyway:
find_package(MyLib)
target_link_libraries(${PROJECT_NAME} PRIVATE MyLib::MyLib)
This looks tidy any more explicit, avoids transitive leakage and more.
What is it that does not often work as you expect?
- junon 6y agoBecause you're ignoring how find_package works and how dependencies use the variables inside of them. Not every find script creates some sort of target.