Cannot create proper CMakeLists.txt file - Cmake tells that
CMake Error: Cannot determine link language for target "GLFW". CMake Error: CMake can not determine linker language for target: GLFW Generating done (0.0s) CMake Generate step failed. Build files cannot be regenerated correctly.
#include <iostream>
#include "include/GLFW/glfw3.h"
#include "include/GLFW/glfw3native.h"
int main()
{
return 0;
}
~
cmake_minimum_required(VERSION 3.15...3.25)
project(MyProject
VERSION
1.0
DESCRIPTION
"Very nice project"
LANGUAGES
CXX
)
add_library(GLFW
include/GLFW/glfw3.h
include/GLFW/glfw3native.h
lib/libglfw3.a
)
add_executable(myexample letter.cpp)
target_link_libraries(myexample PRIVATE GLFW)
tree looks like:
a1312@MacBook-Air-1312 source % tree
.
├── CMakeLists.txt
├── include
│ └── GLFW
│ ├── glfw3.h
│ └── glfw3native.h
├── letter
├── letter.cpp
├── letters.cpp
└── lib
├── libglfw.3.dylib
└── libglfw3.a
4 directories, 8 files
What am I doing wrong?
Already tried steps from glfw-site, but it not helped