summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2018-05-30 07:20:00 +0200
committerStanislaw Halik <sthalik@misaki.pl>2018-05-30 07:20:00 +0200
commit73032cf0e8df0b942b3617cd06f1d50078ee085a (patch)
tree52d8292228e02553ad8f5c7c6b017294ded84fa4
parent54266dc1ea71411168f5275f066111cef4ac8314 (diff)
cmake: disable in-source builds the right way
-rw-r--r--CMakeLists.txt2
-rw-r--r--cmake/opentrack-check-build-directory.cmake7
2 files changed, 1 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 19e7d551..3277fd4d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -21,8 +21,8 @@
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
+set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
-include(opentrack-check-build-directory)
include(opentrack-mrproper)
project(opentrack)
diff --git a/cmake/opentrack-check-build-directory.cmake b/cmake/opentrack-check-build-directory.cmake
deleted file mode 100644
index a9351b6a..00000000
--- a/cmake/opentrack-check-build-directory.cmake
+++ /dev/null
@@ -1,7 +0,0 @@
-get_filename_component(_abs_src_path ${CMAKE_SOURCE_DIR} REALPATH)
-string(TOLOWER ${_abs_src_path} _abs_src_path)
-get_filename_component(_abs_build_path ${CMAKE_BINARY_DIR} REALPATH)
-string(TOLOWER ${_abs_build_path} _abs_build_path)
-if(_abs_src_path STREQUAL _abs_build_path)
- message(FATAL_ERROR "source directory has to be different than build directory")
-endif()