Permalink
Browse files

Download gtest from cmakelist (#5)

* download gtest from cmakelist

* remove install-deps from travis

* fix cmakelist for unix
  • Loading branch information...
Cylix committed Mar 20, 2017
1 parent 5179a2a commit 59a50f151a180de2a07881146f4e32a2d14879a0
Showing with 18 additions and 23 deletions.
  1. +0 −1 .travis.yml
  2. +11 −7 CMakeLists.txt
  3. +0 −12 install_deps.sh
  4. +7 −3 tests/CMakeLists.txt
View
@@ -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
View
@@ -25,6 +25,7 @@
###
cmake_minimum_required(VERSION 2.8.7)
set(CMAKE_MACOSX_RPATH 1)
include(${CMAKE_ROOT}/Modules/ExternalProject.cmake)
###
@@ -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")
@@ -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)
@@ -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)
@@ -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)
View

This file was deleted.

Oops, something went wrong.
View
@@ -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})
###

0 comments on commit 59a50f1

Please sign in to comment.