Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -272,3 +272,5 @@ analysis-cppcheck-build-dir
ideas

desktop.iniimages/

.cache/
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ project(

# ---- Options ----
option(GLOB_USE_GHC_FILESYSTEM "Use ghc::filesystem instead of std::filesystem" OFF)
option(BUILD_TESTING "Build tests" OFF)

# ---- Include guards ----

Expand All @@ -32,6 +33,7 @@ CPMAddPackage(
VERSION 1.3
)

if(BUILD_TESTING)
CPMAddPackage(
NAME googletest
GITHUB_REPOSITORY google/googletest
Expand All @@ -41,6 +43,7 @@ CPMAddPackage(
)
# For Windows: Prevent overriding the parent project's compiler/linker settings
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
endif()

# ---- Add source files ----

Expand Down Expand Up @@ -93,6 +96,7 @@ packageProject(
)

# --- setup tests ---
if(BUILD_TESTING)
enable_testing()

add_executable(glob_tests test/rglob_test.cpp)
Expand All @@ -106,3 +110,4 @@ target_compile_definitions(glob_tests_single PRIVATE USE_SINGLE_HEADER=1)
target_link_libraries(glob_tests_single PRIVATE gtest_main)
target_include_directories(glob_tests_single PRIVATE single_include)
add_test(NAME glob_tests_single COMMAND glob_tests_single)
endif()
4 changes: 2 additions & 2 deletions build_and_run.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
cmake -Hall -Bbuild
cmake --build build
cmake -Hall -Bbuild -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
cmake --build build --parallel
./build/standalone/glob --help
2 changes: 1 addition & 1 deletion cmake/CPM.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(CPM_DOWNLOAD_VERSION 0.35.1)
set(CPM_DOWNLOAD_VERSION 0.42.0)

if(CPM_SOURCE_CACHE)
set(CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
Expand Down