質問

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