SFML community forums

Help => General => Topic started by: Hydro on February 26, 2016, 07:53:14 pm

Title: CMake error for SFML 2.3.2
Post by: Hydro on February 26, 2016, 07:53:14 pm
Hello!
I'm trying to generate the makefile for SFML 2.3.2 with CMake, but I got this error:

CMake Error at CMakeLists.txt:6 (set):
  Syntax error in cmake code at

    C:/Users/MyUser/Downloads/SFML-2.3.2-sources/SFML-2.3.2/CMakeLists.txt:6

  when parsing string

    C:\Tools\Android\AndroidNDK\android-ndk-r9c

  Invalid escape sequence \T
Call Stack (most recent call first):
  CMakeLists.txt:24 (sfml_set_option)


What is wrong? And how do I fix this?
Thank you.
Title: Re: CMake error for SFML 2.3.2
Post by: eXpl0it3r on February 26, 2016, 07:58:23 pm
What's your CMake version? What compiler are you trying to use?
Title: Re: CMake error for SFML 2.3.2
Post by: Hydro on February 26, 2016, 08:09:00 pm
CMake 3.4.3 and I use MinGW (I also have clang installed)
Title: Re: CMake error for SFML 2.3.2
Post by: eXpl0it3r on February 27, 2016, 02:23:57 am
Did you enter C:\Tools\Android\AndroidNDK\android-ndk-r9c yourself?
CMake seems to fail parsing things, because of the backslashes which get interpreted as escape character or similar, i.e. don't use backslashes.
Title: Re: CMake error for SFML 2.3.2
Post by: Hydro on February 27, 2016, 05:37:43 pm
No, I didn't. It happens when I click in Generate.
Title: Re: CMake error for SFML 2.3.2
Post by: eXpl0it3r on February 27, 2016, 06:32:11 pm
CMake is pulling the NDK path from the environment settings which most likely has it set with backslashes and then CMake fails to parse them properly.
As a work around you might be able to set the ANDROID_NDK option yourself with forward slashes which in turn should get rid of the error.
Title: Re: CMake error for SFML 2.3.2
Post by: Mario on February 27, 2016, 06:34:01 pm
CMake doesn't like backslashes in paths, even on Windows. Provide the path in "ANDROID_NDK" with forward slashes, simply edit the variable in the CMake GUI.
Title: Re: CMake error for SFML 2.3.2
Post by: eXpl0it3r on February 27, 2016, 07:02:06 pm
CMake doesn't like backslashes in paths, even on Windows. Provide the path in "ANDROID_NDK" with forward slashes, simply edit the variable in the CMake GUI.
Since CMake gets the path on its own, shouldn't we make sure the path will always be accepted, i.e. conver backslashes to slahed on our own?
Title: Re: CMake error for SFML 2.3.2
Post by: Hydro on February 27, 2016, 07:41:25 pm
It's done! I used the "ANDROID_NDK"and it worked. Thank you very much!