Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: CMake error for SFML 2.3.2  (Read 3417 times)

0 Members and 1 Guest are viewing this topic.

Hydro

  • Newbie
  • *
  • Posts: 6
    • View Profile
CMake error for SFML 2.3.2
« 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.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: CMake error for SFML 2.3.2
« Reply #1 on: February 26, 2016, 07:58:23 pm »
What's your CMake version? What compiler are you trying to use?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Hydro

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: CMake error for SFML 2.3.2
« Reply #2 on: February 26, 2016, 08:09:00 pm »
CMake 3.4.3 and I use MinGW (I also have clang installed)

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: CMake error for SFML 2.3.2
« Reply #3 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.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Hydro

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: CMake error for SFML 2.3.2
« Reply #4 on: February 27, 2016, 05:37:43 pm »
No, I didn't. It happens when I click in Generate.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: CMake error for SFML 2.3.2
« Reply #5 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.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Mario

  • SFML Team
  • Hero Member
  • *****
  • Posts: 879
    • View Profile
Re: CMake error for SFML 2.3.2
« Reply #6 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.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: CMake error for SFML 2.3.2
« Reply #7 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?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Hydro

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: CMake error for SFML 2.3.2
« Reply #8 on: February 27, 2016, 07:41:25 pm »
It's done! I used the "ANDROID_NDK"and it worked. Thank you very much!