开发者

CMake and including other makefiles

Lets say I have a CMakeLists.txt and I want to call another include another makefile in that file (simi开发者_运维技巧lar to the #include syntax in C), how would I accomplish this?


From the CMake documentation:

  • include: Read CMake listfile code from the given file.

    include(<file|module> [OPTIONAL] [RESULT_VARIABLE <VAR>]
                        [NO_POLICY_SCOPE])
    

Example use:

CMakeLists.txt:

cmake_minimum_required(VERSION 2.8)
include (Project.txt)

Project.txt:

project (Project)
add_executable(Project project.c)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜