I’ve read in a lot of topics that some ppl are trying to compile with cmake a clion, but I don’t know if someone has compiled successfully under Windows.
For making a point on this situation I want to enumerate my steps.
Maybe somebody can help with all these steps.
-
Downloaded latest build: cocos2dx v3.6
-
Downloaded MinGW from http://www.mingw.org/
-
Downloaded also PKG Config and installed using this guide http://www.gaia-gis.it/spatialite-3.0.0-BETA/mingw_how_to.html
-
Opened DOS Prompt and run setup.py
-
Double checked if all external deps are ok (also using download-deps.py)
-
Create a new project, the simple helloworld with:
cocos new Test -p com.test.mytest -l cpp -d mydir
-
Run CLion
-
Settings up with MinGW Home, bundled CMake v3.2.2, bundled GDB 7.8 (the toolchains seems ok)
-
I don’t know if in CMake options I have to set other.
-
Selected Import Project from Sources
-
Selected the top folder mydir the first one with CMakeLists.txt
-
It starts to running the process, but suddenly it return this error:
**Error:Could NOT find GLEW (missing: GLEW_INCLUDE_DIR GLEW_LIBRARY)**
-
Now I can edit the cache variable in CLion and manually set the paths, in this way I can manually set all the “include” and “prebuilt” library paths of the required external
-
This externals requested are: chipmunk, freetype2, glfw3, jpeg, tinyxml2, webp, zlib, gles, mp3decoder, ogg, vorbis, openal
-
And last but not least the unzip library, but this library seems to be old, infact I got an error for looking at this function unzGoToFirstFile2 that doesn’t exists in this library
In the cocos2d-x-3.6 folder in CMakeLists.txt I can read this:
"Minizip library on you system very old. Please use recent version from https://github.com/nmoinvaz/minizip or enable USE_PREBUILT_LIBS"
I can’t enable USE_PREBUILT_LIBS because I’m using MinGW, I’ve tried to download a recent version on minizip but it seems not to working.
So I’m stucked, even if I have manually set all the paths I’m blocked with unzip error.
The exact error is:
Error:Syntax error in cmake code at
C:/Program Files (x86)/CLion 1.0.1/bin/cmake/share/cmake-3.2/Modules/CheckLibraryExists.cmake:49
when parsing string
Looking for unzGoToFirstFile2 in C:\mydir\cocos2d\external\unzip
Invalid escape sequence \S
I thought it was an error of some paths that doesn’t work, but I’m using the standard helloworld templates.
I thought also that could be an error in pkg-config for finding the right package, infact I’ve tried to install it manually in mingw, but I don’t think this is the problem.
So please, if somebody can help me resolving this we can make compiling under Window with CLion possible
Thank you.