Skip to content
Snippets Groups Projects
Select Git revision
  • 1eb83262cdaa9dbb35788225b6a74a2caf6303f0
  • master default protected
  • replaceYamlCppWithLibyaml
  • devel
  • tmp
  • doc
  • v2.4.2d
  • v2.4.2c
  • v2.4.2b
  • v2.4.2a
  • v2.4.1c
  • v2.4.1b
  • v2.4.1a
  • v2.4.0g
  • v2.4.0f
  • v2.4.0e
  • v2.4.0d
  • v2.4.0c
  • v2.4.0b
  • v2.4.0a
  • v2.3.6c
  • v2.3.6b
  • v2.3.6a
  • v2.3.5a
  • v2.3.4d
  • v2.3.4c
26 results

PreventInSourceBuilds.cmake

Blame
  • Forked from mlz / Frida
    608 commits behind the upstream repository.
    PreventInSourceBuilds.cmake 607 B
    # - Prevent in-source builds.
    
    function(prevent_in_source_builds)
      # make sure the user doesn't play dirty with symlinks
      get_filename_component(srcdir "${CMAKE_SOURCE_DIR}" REALPATH)
      get_filename_component(bindir "${CMAKE_BINARY_DIR}" REALPATH)
    
      # disallow in-source builds
      if("${srcdir}" STREQUAL "${bindir}")
        message(FATAL_ERROR "\
    
    CMake must not to be run in the source directory. \
    Rather create a dedicated build directory and run CMake there. \
    To clean up after this aborted in-place compilation:
      rm -r CMakeCache.txt CMakeFiles
    ")
      endif()
    endfunction()
    
    prevent_in_source_builds()