Skip to content

Commit

Permalink
Similarity
Browse files Browse the repository at this point in the history
  • Loading branch information
tusharpm committed Mar 12, 2017
1 parent 6cad731 commit 40c42cf
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions external/build_and_run.cmake
Original file line number Diff line number Diff line change
@@ -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}")
Expand All @@ -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})

Expand Down

0 comments on commit 40c42cf

Please sign in to comment.