CMake Environment
Answered
After git clone the project, the Clion cannot recognize CMakeLists.txt as the configuration for the cloned project. Can you help me how to fix this?
git clone https://gitlab.com/gangryunguh/SFML-Demo-windows10-CLion.git

Please sign in to leave a comment.
Hi! CMake tells you that some SFML dependencies are missing. SFML depends on a few other libraries, so before starting to configure you must have their development files installed. Please see the detailed instruction about compiling SFML with CMake - https://www.sfml-dev.org/tutorials/2.0/compile-with-cmake.php.
I am not quire sure of this. I created the CLion project and git push to the gitlab.
To validate the git. I pushed the working project to the git lab. After this, I cloned the pushed project to the same windows machine. Not sure what you meant by SFML dependencies are missing. I am trying to build main.c with CMakeLists.txt already exists in the project directory. The problem is CLion could not recognize the CMakeLists.txt as the configuration to build main. Why the build configuration tab does not show any?
Thanks for any help in advance.
The build configuration tab does not show any because the CMake project wasn't loaded successfully - there is a error message in the CMake console. The error message states that the CMake project wasn't loaded successfully because some SFML dependencies are missing which means that you don't have some required libraries on your machine. Please read https://www.sfml-dev.org/tutorials/2.0/compile-with-cmake.php and install the required libraries.
I removed the SFML from the local project directory and update the cmake_modules/FindSFML.cmake to have the following line:
set(SFML_ROOT, C:/SFML) <--- This is the place where I unpack
It works!
Thank you.
I have an another question. This time, I tried with the sfml media demo code (https://www.sfml-dev.org/documentation/2.4.2/). This demo code works on mac os x. However, I am having the following linking error on windows 10. I wonder whether I need extra setup. By the way, I don't have any D drive. I installed SFML to C:\SFML....
C:/SFML/lib/libsfml-window-s-d.a(Window.cpp.obj): In function `ZN2sf6WindowC2Ev':
D:/sfml-release/_Sources/SFML/src/SFML/Window/Window.cpp:48: undefined reference to `sf::Clock::Clock()'
D:/sfml-release/_Sources/SFML/src/SFML/Window/Window.cpp:48: undefined reference to `sf::Time::Zero'
D:/sfml-release/_Sources/SFML/src/SFML/Window/Window.cpp:48: undefined reference to `sf::Time::Zero'
C:/SFML/lib/libsfml-window-s-d.a(Window.cpp.obj): In function `ZN2sf6WindowC2ENS_9VideoModeERKNS_6StringEjRKNS_15ContextSettingsE':
D:/sfml-release/_Sources/SFML/src/SFML/Window/Window.cpp:59: undefined reference to `sf::Clock::Clock()'
....
Please do Tools | CMake | Reset Cache and Reload Project. Are there any errors in the CMake console after that or is everything built successfully?