dpt/The-Great-Escape-in-C

CMake build

dpt opened this issue · 3 comments

dpt commented

Complete the CMake build work. In particular CMake builds on Windows will need to be supported.

efa commented

hello Spectrum enthusiast.
On first try on Linux Debian, I got this error:

efa@08i7-2500:~/c/The-Great-Escape-in-C$ build.sh 
Configuring...
-- The C compiler identification is GNU 12.2.0
-- The CXX compiler identification is GNU 12.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at platform/generic/CMakeLists.txt:3 (add_executable):
  add_executable cannot create target "TheGreatEscape" because another target
  with the same name already exists.  The existing target is a static library
  created in source directory
  "/home/efa/c/The-Great-Escape-in-C/libraries/TheGreatEscape".  See
  documentation for policy CMP0002 for more details.

-- Configuring incomplete, errors occurred!
See also "/home/efa/c/The-Great-Escape-in-C/build/CMakeFiles/CMakeOutput.log".

I cannot identify what is the "existing target is a static library", there is only directories in /libraries

dpt commented

There's a clash between library and executable in that build. I've pushed a fix which renames the executable.

efa commented

OK thank you, now work well:

The-Great-Escape-in-C/build/platform/generic$ TheGreatEscapeApp 
THE GREAT ESCAPE
================
Initialising...
Running setup 1...
Running menu...
(ran 2 iterations)
Running setup 2...
Running game...
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
100000 iterations in 385ms = 259740.26iters/sec
(quit)