This is the best cmake tutorial I ever seen on youtube, Thanks man. I have a one question, I currently working on project that uses "glfw3" as an external library, After precompiling It, when I use "find_package(glfw3 REQUIRED)". it does find that library but when I trying link with it.... it gives me a linker error... I'm doing something like this "target_link_libraries( PRIVATE glfw3)", I don't know what is going on, when I change "glfw3" to "glfw" it works, Is it something to do with library it self, or Is it me doing something wrong.....but my qustion is how can find the package name is, when i'm trying to use find_package function... and the other thing is "namespace" can you explain it little bit....
@hansdorfer3371Ай бұрын
Nice Video, you are accually the first guy on youtube who explained it. But I have a question: 20:40 - When I use this command, it says that the source directory does not appear to contain CMakeLists.txt - And indeed, there is no file like this in the whole file tree after using cmake --install. What should I do? I have to use Qt so its a bit different I quess
@constref1983Ай бұрын
Hey, there should be no CMakeLists.txt in the tree AFTER doing a --install. You are installing the library and the CMakeLists.txt file is the instructions on how to build/install. After installing, you would have the other scripts that I outline in the video which other projects would use to find all your headers and libs. What I'm showing at 20:40 is how one would pass the CMAKE_PREFIX_PATH variable to CMake if they weren't using Visual Studio/IDE and wanted to actually find and link with our library. This part of the video was a test project showing that we had set things up correctly and can actually find and link with our library. If you have gotten to that part, was able to build and install your library, and the files in installed directory match what I showed earlier in the video, congratulations, you did things correctly :)
@edwardzdankiewicz9068Ай бұрын
What happens to all that on Windows? Is there a Windows equivalent to the linux usr/lib system?
@constref1983Ай бұрын
The entire video is based in Windows. What are you having trouble with? There is no standard usr/lib equivalent, check the video again, I go over how to install a package and how to then find it on Windows.
@user-fj9hf4bu9fАй бұрын
Why even make a video when there's no github link to example project?
@constref1983Ай бұрын
Here you go: github.com/constref/cmake-examples/tree/master/cmake-library