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

Author Topic: "Unknown CMake command 'build_chapter'"  (Read 1268 times)

0 Members and 1 Guest are viewing this topic.

supernintendo64

  • Newbie
  • *
  • Posts: 3
    • View Profile
"Unknown CMake command 'build_chapter'"
« on: February 06, 2022, 05:42:18 pm »
I'm trying to compile the example project files that came with the SFML Game Development book (the one with the ocean and rock on the cover). I'm using Visual Studio 2022. I went to "Open CMake" and ran the CMakeLists that was in the project directory and got an error on Line 6:

Code: [Select]
CMake Error at G:\[Name]\Documents\Packt\SFML Game Development\01_Intro\Source\CMakeLists.txt:6 (build_chapter): Unknown CMake command "build_chapter".

What am I doing wrong?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10801
    • View Profile
    • development blog
    • Email
Re: "Unknown CMake command 'build_chapter'"
« Reply #1 on: February 07, 2022, 08:21:28 am »
You need to run the top-level CMake script, which is also the one that defines the build_chapter macro

https://github.com/SFML/SFML-Game-Development-Book/blob/master/CMakeLists.txt#L89
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

 

anything