をコンパイルするためにこれは私の作業ディレクトリで設定しはcmakelistが正しくプロジェクト
cmake_minimum_required(VERSION 3.5.1)
project(app)
include_directories(include)
file(GLOB SOURCES src/*.c)
add_executable(file3 src/file3.c)
target_link_libraries(file3 m ${SOURCES})
その後、私は次のようにします。
$cmake .
$make
しかし、エラーが発生する:
[ 50%] Building C object CMakeFiles/file3.dir/src/file3.c.o
[100%] Linking C executable file3
src/file3.c:1:19: fatal error: file1.h: File does not exist
file3.c
だけである:
#include "file1.h"
#include "file2.h"
int foo3(int a, int b){
return foo1(a,b) + foo2(a,b);
}
私が正しくCMakeListsを設定するにはどうすればよいですか?カレントディレクトリにしていない他の含まれたディレクトリにファイル.hため
#include "file1.h"
検索を使用して