From 40c42cfa737b6efb2fc12e35a3696d84098a137a Mon Sep 17 00:00:00 2001 From: Tushar Maheshwari Date: Wed, 8 Feb 2017 23:59:23 +0530 Subject: [PATCH] Similarity --- external/build_and_run.cmake | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/external/build_and_run.cmake b/external/build_and_run.cmake index 49894d9e..cf7d6afa 100644 --- a/external/build_and_run.cmake +++ b/external/build_and_run.cmake @@ -1,6 +1,9 @@ #!/usr/bin/env cmake -P cmake_minimum_required(VERSION 2.8.7) +set(BUILD_DIR ${CMAKE_CURRENT_LIST_DIR}/build) +file(MAKE_DIRECTORY ${BUILD_DIR}) + # for lack of an equivalent of `set -e` in bash macro(EXEC_CMD_CHECK) message("running ${ARGN}") @@ -19,16 +22,11 @@ if(DEFINED Generator) list(APPEND CMAKE_EXTRA_ARGS "-G${Generator}") endif() -set(BUILD_DIR ${CMAKE_CURRENT_LIST_DIR}/build) - # find_package(Git) # if(GIT_FOUND) # EXEC_CMD_CHECK(${GIT_EXECUTABLE} submodule update --init) # endif() -# mkdir -p build -EXEC_CMD_CHECK(${CMAKE_COMMAND} -E make_directory ${BUILD_DIR}) - # cd build && cmake .. && cd - EXEC_CMD_CHECK(${CMAKE_COMMAND} ${CMAKE_EXTRA_ARGS} ${CMAKE_CURRENT_LIST_DIR} WORKING_DIRECTORY ${BUILD_DIR})