14
« on: August 14, 2023, 10:03:13 pm »
The template I shared will work for you. The code in that CMakeLists.txt will download and build SFML for you so that you can get ride of most of the CMake code you wrote yourself. Your build script will become much smaller and the linker errors will go away if you're willing to at least try it. The README in that repo explains how to use it. For the most part you just grab that build script, tweak the .cpp files to match what you have, then run 2 CMake commands.
What you're doing is over complicating things and is prone to fail in ways that are pretty confusing unless you're already very familiar with how compiling and linking C++ works. If you've spent this long struggling with your current strategy, maybe it's time to reevaluate how you're approaching this problem.