Skip to content

Commit 95d2acb

Browse files
committed
adding cmake
1 parent 8ee5be4 commit 95d2acb

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

CMakeLists.txt

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
cmake_minimum_required(VERSION 3.10)
2+
project(FilterProject)
3+
4+
if (NOT CMAKE_BUILD_TYPE)
5+
message(STATUS "No build type selected, default to Release")
6+
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
7+
endif()
8+
9+
# Ensure git submodules are initialized
10+
find_package(Git QUIET)
11+
if(GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git")
12+
option(GIT_SUBMODULE "Check submodules during build" ON)
13+
if(GIT_SUBMODULE)
14+
message(STATUS "Submodule update")
15+
execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive
16+
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
17+
RESULT_VARIABLE GIT_SUBMOD_RESULT)
18+
if(NOT GIT_SUBMOD_RESULT EQUAL "0")
19+
message(FATAL_ERROR "git submodule update --init failed with ${GIT_SUBMOD_RESULT}, please checkout submodules")
20+
endif()
21+
endif()
22+
endif()
23+
24+
# Include directories
25+
include_directories(
26+
${CMAKE_SOURCE_DIR}/src
27+
${CMAKE_SOURCE_DIR}/dependencies
28+
${CMAKE_SOURCE_DIR}/dependencies/xor_singleheader/include
29+
${CMAKE_SOURCE_DIR}/dependencies/fastfilter_cpp/src
30+
)
31+
32+
set(CMAKE_CXX_STANDARD 11)
33+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
34+
35+
add_executable(query_filter src/query_filter.cpp)
36+
add_executable(build_filter src/build_filter.cpp)

0 commit comments

Comments
 (0)