Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CMake and including other makefiles

Lets say I have a CMakeLists.txt and I want to call another include another makefile in that file (similar to the #include syntax in C), how would I accomplish this?

like image 487
joemoe Avatar asked Feb 15 '10 23:02

joemoe


1 Answers

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)
like image 103
Carl Norum Avatar answered Sep 24 '22 07:09

Carl Norum