Skip to content
Snippets Groups Projects
Commit 9e56a186 authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Prevent compilation in source dir.

Only allows compilation is top-src-dir/build
parent 6aed3c40
Branches
Tags
No related merge requests found
*~
build/
CMakeFiles/
CMakeCache.txt
cmake_minimum_required (VERSION 2.6)
cmake_minimum_required (VERSION 3.4)
if (${CMAKE_BINARY_DIR} MATCHES "^${CMAKE_SOURCE_DIR}")
if (NOT ${CMAKE_BINARY_DIR} MATCHES "^${CMAKE_SOURCE_DIR}/build")
message("")
message("##############################################")
message(" In-source building is not allowed! ")
message("##############################################")
message("")
message(" Run cmake outside from source directory ")
message(" or from ${CMAKE_SOURCE_DIR}/build")
message("")
message("----------------------------------------------")
message(" warning: remaining generated files!")
message(" ${CMAKE_BINARY_DIR}/CMakeCache.txt")
message(" ${CMAKE_BINARY_DIR}/CMakeFiles")
message("----------------------------------------------")
message("")
message(" Please remove remaining generated files ")
message(" and run cmake from an appropriate location")
message("")
message(FATAL_ERROR "\n** CMake aborted **")
endif()
endif()
project (Pastis)
add_executable(pastis main.cpp)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment