Skip to content

Commit

Permalink
Add initial cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
pfultz2 committed Sep 10, 2016
1 parent 8f3bc61 commit d0fc025
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
cmake_minimum_required (VERSION 2.8)
project (dirent)

enable_language(C)

install(FILES include/dirent.h DESTINATION include)


include(CTest)
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C ${CMAKE_CFG_INTDIR})
function(add_test_executable TEST_NAME)
add_executable (${TEST_NAME} EXCLUDE_FROM_ALL ${ARGN})
add_test(NAME ${TEST_NAME} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/tests COMMAND $<TARGET_FILE:${TEST_NAME}>)
add_dependencies(check ${TEST_NAME})
target_include_directories(${TEST_NAME} PUBLIC ${CMAKE_SOURCE_DIR}/include)
endfunction(add_test_executable)

add_test_executable(t-compile tests/t-compile.c)
add_test_executable(t-dirent tests/t-dirent.c)

0 comments on commit d0fc025

Please sign in to comment.