Skip to content
This repository has been archived by the owner on Feb 7, 2018. It is now read-only.

Commit

Permalink
Automate fetching of testing plugins using CMake
Browse files Browse the repository at this point in the history
  • Loading branch information
Ortham committed Mar 21, 2016
1 parent 3c4d99a commit 73502c2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
4 changes: 0 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,10 @@ addons:
- gcc-5
- g++-5


before_script:
# Use GCC 5.
- if [ "$CXX" = "g++" ]; then export CXX="g++-5" CC="gcc-5"; fi
- mkdir build && cd build
# Fetch plugins to test with.
- wget https://github.com/WrinklyNinja/testing-plugins/archive/1.0.0.tar.gz -O - | tar -xz
- mv testing-plugins-1.0.0/* ./
# Travis machines are 64 bit, and the dependencies use dynamic linking.
- cmake .. -DPROJECT_STATIC_RUNTIME=OFF

Expand Down
16 changes: 15 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ ExternalProject_Get_Property(GTest SOURCE_DIR BINARY_DIR)
set (GTEST_INCLUDE_DIRS "${SOURCE_DIR}/include")
set (GTEST_LIBRARIES "${BINARY_DIR}/${BUILD_SUBDIRECTORY}/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}")

ExternalProject_Add(testing-plugins
PREFIX "external"
URL "https://github.com/WrinklyNinja/testing-plugins/archive/1.0.0.tar.gz"
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND "")

set(PROJECT_HEADERS "${CMAKE_SOURCE_DIR}/include/libespm/FormId.h"
"${CMAKE_SOURCE_DIR}/include/libespm/GameId.h"
"${CMAKE_SOURCE_DIR}/include/libespm/Group.h"
Expand Down Expand Up @@ -85,5 +92,12 @@ endif ()
##############################

add_executable (tests ${TESTER_SRC} ${PROJECT_HEADERS} ${TESTER_HEADERS})
add_dependencies (tests GTest)
add_dependencies (tests GTest testing-plugins)
target_link_libraries (tests ${GTEST_LIBRARIES} ${Boost_LIBRARIES} ${PROJECT_LIBRARIES})

# Copy testing plugins
ExternalProject_Get_Property(testing-plugins SOURCE_DIR)
add_custom_command(TARGET tests POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${SOURCE_DIR}
$<TARGET_FILE_DIR:tests>)

0 comments on commit 73502c2

Please sign in to comment.