How to build cocos using cmake?

I want to use cmake to build the example creating from “cocos new” command.
But I got some errors, it says " cannot open file ‘libpng-2015.lib’ "
( I think my problem is similar to these two: (Newbie) CMake + prebuilt libraries linkage & Cocos2dx v3.12 Prebuilt LNK2001 Scheduler PRIORITY_SYSTEM Error )

Then I tried to add these .lib files into cmakelists.txt using “TARGET_LINK_LIBRIES”, and I got unresolved external symbol errors.

I’m now using win7 + vs2015, and the latest cmake and qt version.

What could this caused by? Can someone help~
Thank you

Take a look at this PR

Thank you, I have seen that before~
Does it do the same thing as I manually add .lib files into cmakelists?
If so, then I will get unresolved errors…
I wonder whether I have linked the right file…

The CMake files find the libraries, you just need to provide the correct names. So don’t use absolute paths. The latest Cocos2dx version shouldn’t have this problem though, that PR was merged a long time ago.