문제

in CMake, What's the difference between command SUBDIRS() and ADD_SUBDIRECTORY()

when i read PoDoFo src, i found some CMakeLists.txt use SUBDIRS some use ADD_SUBDIRECTORY, I am novice! thanks!

도움이 되었습니까?

해결책 2

subdirs is deprecated, use add_subdirectory

http://www.cmake.org/cmake/help/git-next/command/subdirs.html

다른 팁

From the CMake Mailing List:

ADD_SUBDIRECTORY() processes the subdir at the time it is called, whereas SUBDIRS() pushes the dirs onto a list which is processed at the end of the current CMakeLists file - this is the old behaviour and some vars are initialized 'out of order', or at least in unexpected order.

(...)

So, if you set variables in the parent directory they will not be seen in the subdir when SUBDIRS() is used.

Furthermore it is recommended in CMake's Documentation that you should use ADD_SUBDIRECTORY() instead, as SUBDIRS() is deprecated.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top