-
Notifications
You must be signed in to change notification settings - Fork 515
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add telldir and seekdir functions #50
- Loading branch information
Showing
7 changed files
with
442 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ | |
/t-cplusplus | ||
/t-unicode | ||
/t-strverscmp | ||
/t-telldir | ||
/t-utf8 | ||
/updatedb | ||
/*.filters | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,64 @@ | ||
cmake_minimum_required (VERSION 2.8.12) | ||
project (dirent LANGUAGES C CXX) | ||
cmake_minimum_required(VERSION 2.8.12) | ||
project(dirent LANGUAGES C CXX) | ||
|
||
# User options | ||
option(DIRENT_BUILD_TESTS "Build bundled tests" ON) | ||
message(STATUS "Build test and example programs: ${DIRENT_BUILD_TESTS}") | ||
|
||
# Initialize C and C++ compilers | ||
enable_language (C CXX) | ||
enable_language(C CXX) | ||
|
||
# Compile in debug mode by default | ||
if (NOT CMAKE_BUILD_TYPE) | ||
set (CMAKE_BUILD_TYPE Debug | ||
if(NOT CMAKE_BUILD_TYPE) | ||
set(CMAKE_BUILD_TYPE Debug | ||
CACHE STRING | ||
"Type of build: None Debug Release RelWithDebInfo MinSizeRel." | ||
FORCE | ||
) | ||
endif (NOT CMAKE_BUILD_TYPE) | ||
endif(NOT CMAKE_BUILD_TYPE) | ||
|
||
# Use the include directory only on Windows | ||
if (WIN32) | ||
include_directories (${CMAKE_SOURCE_DIR}/include) | ||
endif (WIN32) | ||
if(WIN32) | ||
include_directories(${CMAKE_SOURCE_DIR}/include) | ||
endif(WIN32) | ||
|
||
# Install dirent.h | ||
if (WIN32) | ||
install (FILES include/dirent.h DESTINATION include) | ||
endif (WIN32) | ||
if(WIN32) | ||
install(FILES include/dirent.h DESTINATION include) | ||
endif(WIN32) | ||
|
||
# Add distclean target | ||
add_custom_target (distclean | ||
add_custom_target(distclean | ||
COMMAND ${CMAKE_BUILD_TOOL} clean | ||
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_SOURCE_DIR}/distclean.cmake | ||
) | ||
|
||
# Build example programs | ||
if(DIRENT_BUILD_TESTS) | ||
add_executable (find examples/find.c) | ||
add_executable (ls examples/ls.c) | ||
add_executable (locate examples/locate.c) | ||
add_executable (updatedb examples/updatedb.c) | ||
add_executable (scandir examples/scandir.c) | ||
add_executable (cat examples/cat.c) | ||
add_executable (dirls examples/dirls.c) | ||
add_executable (du examples/du.c) | ||
add_executable(find examples/find.c) | ||
add_executable(ls examples/ls.c) | ||
add_executable(locate examples/locate.c) | ||
add_executable(updatedb examples/updatedb.c) | ||
add_executable(scandir examples/scandir.c) | ||
add_executable(cat examples/cat.c) | ||
add_executable(dirls examples/dirls.c) | ||
add_executable(du examples/du.c) | ||
|
||
# Build test programs | ||
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} COMMAND $<TARGET_FILE:${TEST_NAME}>) | ||
add_dependencies (check ${TEST_NAME}) | ||
endfunction (add_test_executable) | ||
|
||
add_test_executable (t-compile tests/t-compile.c) | ||
add_test_executable (t-dirent tests/t-dirent.c) | ||
add_test_executable (t-scandir tests/t-scandir.c) | ||
add_test_executable (t-unicode tests/t-unicode.c) | ||
add_test_executable (t-cplusplus tests/t-cplusplus.cpp) | ||
add_test_executable (t-strverscmp tests/t-strverscmp.c) | ||
add_test_executable (t-utf8 tests/t-utf8.c) | ||
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} COMMAND $<TARGET_FILE:${TEST_NAME}>) | ||
add_dependencies(check ${TEST_NAME}) | ||
endfunction(add_test_executable) | ||
|
||
add_test_executable(t-compile tests/t-compile.c) | ||
add_test_executable(t-dirent tests/t-dirent.c) | ||
add_test_executable(t-scandir tests/t-scandir.c) | ||
add_test_executable(t-unicode tests/t-unicode.c) | ||
add_test_executable(t-cplusplus tests/t-cplusplus.cpp) | ||
add_test_executable(t-telldir tests/t-telldir.c) | ||
add_test_executable(t-strverscmp tests/t-strverscmp.c) | ||
add_test_executable(t-utf8 tests/t-utf8.c) | ||
endif(DIRENT_BUILD_TESTS) |
Oops, something went wrong.