Skip to content
This repository has been archived by the owner on Apr 6, 2019. It is now read-only.

Download gtest from cmakelist #5

Merged
merged 3 commits into from
Mar 20, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,5 @@ before_install:

install:
- if [ "$CXX" = "g++" ]; then export CXX="g++-4.8" CC="gcc-4.8"; fi
- ./install_deps.sh

script: mkdir build && cd build && cmake .. -DBUILD_TESTS=true -DBUILD_EXAMPLES=true && make && ./bin/tacopie_tests
18 changes: 11 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
###
cmake_minimum_required(VERSION 2.8.7)
set(CMAKE_MACOSX_RPATH 1)
include(${CMAKE_ROOT}/Modules/ExternalProject.cmake)


###
Expand All @@ -51,7 +52,7 @@ IF (WIN32)

IF ("${MSVC_RUNTIME_LIBRARY_CONFIG}" STREQUAL "")
set(MSVC_RUNTIME_LIBRARY_CONFIG "/MT")
ENDIF()
ENDIF()

foreach (flag_var CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE)
IF ("${MSVC_RUNTIME_LIBRARY_CONFIG}" STREQUAL "/MT")
Expand All @@ -75,9 +76,8 @@ ENDIF (WIN32)
###
# variables
###
IF (NOT GTEST_INCLUDES)
set(GTEST_INCLUDES ${PROJECT_SOURCE_DIR}/deps/src/googletest/googletest/include)
ENDIF (NOT GTEST_INCLUDES)
set(DEPS_INCLUDES ${PROJECT_SOURCE_DIR}/deps/include)
set(DEPS_LIBRARIES ${PROJECT_SOURCE_DIR}/deps/lib)
set(TACOPIE_INCLUDES ${PROJECT_SOURCE_DIR}/includes)


Expand Down Expand Up @@ -146,6 +146,10 @@ ENDIF(IO_SERVICE_NB_WORKERS)
###
# install
###
# ensure lib and bin directories exist
install(DIRECTORY DESTINATION ${CMAKE_BINARY_DIR}/lib/)
install(DIRECTORY DESTINATION ${CMAKE_BINARY_DIR}/bin/)
# install tacopie
install (DIRECTORY ${CMAKE_BINARY_DIR}/lib/ DESTINATION lib USE_SOURCE_PERMISSIONS)
install (DIRECTORY ${CMAKE_BINARY_DIR}/bin/ DESTINATION bin USE_SOURCE_PERMISSIONS)
install (DIRECTORY ${TACOPIE_INCLUDES}/ DESTINATION include USE_SOURCE_PERMISSIONS)
Expand All @@ -164,7 +168,7 @@ ENDIF(BUILD_EXAMPLES)
###
IF (BUILD_TESTS)
add_subdirectory(tests)
IF (EXISTS ${PROJECT_SOURCE_DIR}/deps/src/googletest)
add_subdirectory(${PROJECT_SOURCE_DIR}/deps/src/googletest)
ENDIF ()
ExternalProject_Add("googletest"
GIT_REPOSITORY "https://github.com/google/googletest.git"
CMAKE_ARGS "-DCMAKE_INSTALL_PREFIX=${PROJECT_SOURCE_DIR}/deps")
ENDIF(BUILD_TESTS)
12 changes: 0 additions & 12 deletions install_deps.sh

This file was deleted.

10 changes: 7 additions & 3 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,13 @@ ENDIF (NOT WIN32)
###
# includes
###
include_directories(SYSTEM ${PROJECT_SOURCE_DIR}/includes
${TACOPIE_INCLUDES}
${GTEST_INCLUDES})
include_directories(${DEPS_INCLUDES} ${TACOPIE_INCLUDES})


###
# libraries
###
link_directories(${DEPS_LIBRARIES})


###
Expand Down