Skip to content
Permalink
Browse files
update submod to latest
  • Loading branch information
David committed May 8, 2019
1 parent 80888e1 commit c99ba70b7d3386a30e1ef680a309d2a06a0f5f38
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 7 deletions.
@@ -3,6 +3,13 @@ set(CMAKE_CXX_STANDARD 14)

project(cmake_example CXX)

# turns out that g++ will allow variable length arrays but I
# dont' want students getting dependant on non-standard features
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wvla -Werror=vla")

# limit number of errors shown to 1
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wfatal-errors")

# location of source code files
include_directories(${CMAKE_SOURCE_DIR})

@@ -14,12 +21,14 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin )
file(MAKE_DIRECTORY ${CMAKE_SOURCE_DIR}/lib)
SET(LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/lib)

# add tests
enable_testing()
add_subdirectory(Testing)
add_subdirectory(Lecture)

add_library( print_two print_two.cpp )

add_executable( main main.cpp )
target_link_libraries( main print_two )

# add tests
enable_testing()
add_subdirectory(Testing)
add_subdirectory(Lecture)

@@ -4,12 +4,12 @@ file(MAKE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin )

# tell cmake where to find the catch2 library
set(CATCH_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/catch)
set(CATCH_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/helper/catch)
add_library(Catch INTERFACE)
target_include_directories(Catch INTERFACE ${CATCH_INCLUDE_DIR})

# tell cmake where to find the captureio library
set(CAPIO_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/captureio)
set(CAPIO_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/helper/captureio)
add_library(Capio INTERFACE)
target_include_directories(Capio INTERFACE ${CAPIO_INCLUDE_DIR})

@@ -33,3 +33,11 @@ foreach(filename ${files})
COMMAND ${TEST_RUNNER} )
endforeach()

file(GLOB files "${CMAKE_CURRENT_SOURCE_DIR}/test_*.py")
foreach(filename ${files})
# if test file is "test_thingy.py" then created test will be called "test_thingy"
get_filename_component(THIS_TEST ${filename} NAME_WE)
set(TEST_RUNNER ${THIS_TEST})

add_test(${THIS_TEST} "python3" ${filename})
endforeach()

0 comments on commit c99ba70

Please sign in to comment.