|
|
|
|
|
by cheesedoodle
1907 days ago
|
|
I really appreciate the advice from Daniel Pfeifer [0] where you treat all your build-tree sub-projects as out of tree dependencies, by overriding the `find_package` macro.
This way, you can just find project dependencies using the `find_package` as if you were referring to something pre-built. Save a lot of hassle. macro(find_package)
if(NOT "${ARG0}" IN_LIST as_subproject)
_find_package(${ARGV})
endif()
endmacro()
[0] C++Now 2017: Daniel Pfeifer “Effective CMake"
https://www.youtube.com/watch?v=bsXLMQ6WgIk&vl=en
slides: https://github.com/boostcon/cppnow_presentations_2017/blob/m... |
|
We shouldn't have to do macro/function overrides, but I'm glad they exist in CMake. Current status quo is "it's really annoying and a huge headache to do, but at least CMake allows me to do it, unlike others".