KhronosGroup / OpenCL-SDK

OpenCL SDK
Apache License 2.0
577 stars 120 forks source link

Build error following instructions from README #56

Closed juliohm closed 2 years ago

juliohm commented 2 years ago

The following error message is being generated by the default instructions:

CMake Error at _deps/freetype-external-src/CMakeLists.txt:222 (message):
  In-source builds are not permitted! Make a separate folder for building,
  e.g.,

    cmake -E make_directory build
    cmake -E chdir build cmake ..

  Before that, remove the files created by this failed run with

    cmake -E remove CMakeCache.txt
    cmake -E remove_directory CMakeFiles

This is happening when I type cmake . in the top OpenCL-SDK folder after cloning all submodules as suggested. Appreciate if you can help with this issue. We are trying to precompile OpenCL for Julia users again.

juliohm commented 2 years ago

Solved the issue by creating a separate build directory before calling the parent CMakeLists.txt file.

MathiasMagnus commented 2 years ago

Yes, CMake discourages in-source building (when source files mingle with build artifacts and side-effect) to a point some projects outright throwing an error when they detect it. (It may be known to cause issues with said projects.) In your case it was in FreeType, a transitive dependency of SFML.

If you used Vcpkg (like the readme), I believe this should not happen, because the build never sees the build files of FreeType. Moreover, the readme does suggest using a separate folder as a build folder.

Anyhow, glad you sorted it out.