Eksapsy
Eksapsy

Reputation: 1756

CMake-generated Makefile does not contain target

I'm using G++ MinGW for compiling. My Files :

main.cpp, linkedList.cpp, linkedList.h

My CMake file :

cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
set(CMAKE_LEGACY_CYGWIN_WIN32 0)
project (Tutorial)
set(CMAKE_CXX_FLAGS "-Wall -std=c++11")
enable_testing()

include_directories(include)
add_executable(Tutorial 
main.cpp
linkedList.cpp
linkedList.h
)

add_test(Tutorial tutorial)

The exact compile error from generated Makefile :

mingw32-make[2]: *** No rule to make target '../linkedList.h', needed by 'CMakeFiles/Tutorial.dir/main.cpp.obj'.  Stop.
mingw32-make[1]: *** [CMakeFiles/Tutorial.dir/all] Error 2
mingw32-make: *** [all] Error 2

Gist for CMake generated Makefile

Upvotes: 0

Views: 530

Answers (1)

usr1234567
usr1234567

Reputation: 23432

You target is Tutorial, not ../LinkedList.h

Go to your build directory and execute

make Tutorial

Upvotes: 1

Related Questions