Skip to content

Commit

Permalink
add catch as an external project
Browse files Browse the repository at this point in the history
  • Loading branch information
pimentel committed Jan 28, 2015
1 parent 98baec8 commit 51013c1
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
9 changes: 7 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@ cmake_minimum_required(VERSION 3.0)

project(kallisto)

set(EXT_PROJECTS_DIR ${PROJECT_SOURCE_DIR}/ext)

# Includes Catch in the project:
add_subdirectory(${EXT_PROJECTS_DIR}/catch)
include_directories(${CATCH_INCLUDE_DIR} ${COMMON_INCLUDES})
enable_testing(true) # Enables unit-testing.

# add_compile_options(-Wall)
add_compile_options(-std=c++11)
Expand All @@ -11,5 +16,5 @@ add_compile_options(-Wdeprecated-register)
add_subdirectory(src)

add_subdirectory(test)
enable_testing()
add_test(MainTest test/tests)
# enable_testing()
# add_test(MainTest test/tests)
20 changes: 20 additions & 0 deletions ext/catch/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
cmake_minimum_required(VERSION 2.8.8)
project(catch_builder CXX)
include(ExternalProject)
find_package(Git REQUIRED)

ExternalProject_Add(
catch
PREFIX ${CMAKE_BINARY_DIR}/catch
GIT_REPOSITORY https://github.com/philsquared/Catch.git
TIMEOUT 10
UPDATE_COMMAND ${GIT_EXECUTABLE} pull
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
LOG_DOWNLOAD ON
)

# Expose required variable (CATCH_INCLUDE_DIR) to parent scope
ExternalProject_Get_Property(catch source_dir)
set(CATCH_INCLUDE_DIR ${source_dir}/include CACHE INTERNAL "Path to include folder for Catch")

0 comments on commit 51013c1

Please sign in to comment.