Skip to content

Commit

Permalink
adding cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
lemire committed Dec 9, 2024
1 parent 8ee5be4 commit 95d2acb
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
cmake_minimum_required(VERSION 3.10)
project(FilterProject)

if (NOT CMAKE_BUILD_TYPE)
message(STATUS "No build type selected, default to Release")
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
endif()

# Ensure git submodules are initialized
find_package(Git QUIET)
if(GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git")
option(GIT_SUBMODULE "Check submodules during build" ON)
if(GIT_SUBMODULE)
message(STATUS "Submodule update")
execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
RESULT_VARIABLE GIT_SUBMOD_RESULT)
if(NOT GIT_SUBMOD_RESULT EQUAL "0")
message(FATAL_ERROR "git submodule update --init failed with ${GIT_SUBMOD_RESULT}, please checkout submodules")
endif()
endif()
endif()

# Include directories
include_directories(
${CMAKE_SOURCE_DIR}/src
${CMAKE_SOURCE_DIR}/dependencies
${CMAKE_SOURCE_DIR}/dependencies/xor_singleheader/include
${CMAKE_SOURCE_DIR}/dependencies/fastfilter_cpp/src
)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

add_executable(query_filter src/query_filter.cpp)
add_executable(build_filter src/build_filter.cpp)

0 comments on commit 95d2acb

Please sign in to comment.