2022-12-23 13:50:27 -05:00
|
|
|
cmake_minimum_required(VERSION 3.24)
|
|
|
|
project(BLT)
|
|
|
|
|
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
|
|
|
|
|
|
option(BUILD_STD "Build the BLT standard utilities." ON)
|
|
|
|
option(BUILD_PROFILING "Build the BLT profiler extension" ON)
|
|
|
|
|
|
|
|
if(${BUILD_STD})
|
2022-12-25 23:25:32 -05:00
|
|
|
file(GLOB_RECURSE STD_FILES "${CMAKE_CURRENT_SOURCE_DIR}/src/blt/std/*.cpp")
|
2022-12-23 13:50:27 -05:00
|
|
|
else()
|
|
|
|
set(STD_FILES "")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(${BUILD_PROFILING})
|
2022-12-25 23:25:32 -05:00
|
|
|
file(GLOB_RECURSE PROFILING_FILES "${CMAKE_CURRENT_SOURCE_DIR}/src/blt/profiling/*.cpp")
|
2022-12-23 13:50:27 -05:00
|
|
|
else()
|
|
|
|
set(PROFILING_FILES "")
|
|
|
|
endif()
|
|
|
|
|
2022-12-27 00:51:37 -05:00
|
|
|
if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/libraries/parallel-hashmap/CMakeLists.txt)
|
|
|
|
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/libraries/parallel-hashmap/)
|
|
|
|
set(PHMAP_ENABLED ON)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
configure_file(include/blt/config.h.in blt/config.h @ONLY)
|
|
|
|
# include the config file
|
|
|
|
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
2022-12-27 00:53:30 -05:00
|
|
|
include_directories(${CMAKE_BINARY_DIR})
|
2022-12-27 00:55:50 -05:00
|
|
|
message(${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
|
2022-12-27 00:51:37 -05:00
|
|
|
|
2022-12-23 13:50:27 -05:00
|
|
|
include_directories(include/)
|
|
|
|
|
2022-12-25 23:23:12 -05:00
|
|
|
message("Standard Files ${STD_FILES}")
|
|
|
|
message("Profiler Files ${PROFILING_FILES}")
|
|
|
|
message("Source: ${CMAKE_SOURCE_DIR}")
|
2022-12-25 23:24:58 -05:00
|
|
|
message("Current Source: ${CMAKE_CURRENT_SOURCE_DIR}")
|
2022-12-25 23:23:12 -05:00
|
|
|
|
2022-12-23 13:50:27 -05:00
|
|
|
add_library(BLT ${STD_FILES} ${PROFILING_FILES})
|
2022-12-26 00:36:28 -05:00
|
|
|
target_include_directories(BLT PUBLIC include/)
|
2022-12-27 00:51:37 -05:00
|
|
|
target_link_libraries(BLT phmap)
|