Skip to content

Instantly share code, notes, and snippets.

@mlcollard
Created April 18, 2019 13:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mlcollard/091ab275945332027b2dd88d8195aa70 to your computer and use it in GitHub Desktop.
Save mlcollard/091ab275945332027b2dd88d8195aa70 to your computer and use it in GitHub Desktop.
CMake build file for StreamVideo project
# cmake for StreamVideo project
cmake_minimum_required(VERSION 3.0.0)
set(CMAKE_CXX_STANDARD 11)
file(DOWNLOAD https://github.com/catchorg/Catch2/releases/download/v2.7.0/catch.hpp ${CMAKE_SOURCE_DIR}/catch.hpp)
add_library(video OBJECT Video.cpp Stream.cpp Account.cpp)
add_executable(StreamingActivity StreamingActivity.cpp $<TARGET_OBJECTS:video>)
add_executable(Video_t Video_t.cpp $<TARGET_OBJECTS:video>)
add_executable(Stream_t Stream_t.cpp $<TARGET_OBJECTS:video>)
add_executable(Account_t Account_t.cpp $<TARGET_OBJECTS:video>)
# data file to run with
configure_file(${CMAKE_SOURCE_DIR}/videos.csv ${CMAKE_BINARY_DIR}/videos.csv COPYONLY)
# run
add_custom_target(run COMMAND ./StreamingActivity DEPENDS StreamingActivity)
# test
add_custom_target(test COMMAND ${CMAKE_BINARY_DIR}/Video_t
COMMAND ${CMAKE_BINARY_DIR}/Stream_t
COMMAND ${CMAKE_BINARY_DIR}/Account_t
DEPENDS Video_t Stream_t Account_t)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment