Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Issue 209, 275) Make library truly header-only #276

Merged
merged 8 commits into from
May 7, 2023
Merged
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: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,5 @@
build/
# ignore the packaging folder contents from git
packaging/
# graph config is automatically setup, so we can ignore this
include/CXXGraphConfig.h
# ignore vscode files
.vscode
46 changes: 38 additions & 8 deletions benchmark/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,47 @@ if(BENCHMARK)
GIT_TAG origin/main
)

FetchContent_MakeAvailable(googlebenchmark)
FetchContent_Declare(
openssl
GIT_REPOSITORY https://github.com/janbar/openssl-cmake.git
GIT_TAG origin/master
OPTIONS "WITH_APPS OFF"
)

FetchContent_Declare(
zlib
GIT_REPOSITORY https://github.com/madler/zlib.git
GIT_TAG v1.2.13
OPTIONS "CMAKE_POSITION_INDEPENDENT_CODE True"
)

set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest)

set(WITH_APPS OFF CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(openssl)

set(SAVE_CMAKE_POSITION_INDEPENDENT_CODE ${CMAKE_POSITION_INDEPENDENT_CODE})
set(CMAKE_POSITION_INDEPENDENT_CODE True)
FetchContent_MakeAvailable(zlib)
set(CMAKE_POSITION_INDEPENDENT_CODE ${SAVE_CMAKE_POSITION_INDEPENDENT_CODE})

file (GLOB BENCHMARK_FILES "*.cpp" "*.hpp")
add_executable(benchmark_exe ${BENCHMARK_FILES})

target_compile_definitions(benchmark_exe
PUBLIC WITH_COMPRESSION
)
target_include_directories(benchmark_exe PUBLIC
"${PROJECT_SOURCE_DIR}/include"
)
PUBLIC "${PROJECT_SOURCE_DIR}/include"
PUBLIC ${zlib_BINARY_DIR}
PUBLIC ${zlib_SOURCE_DIR}
PUBLIC ${openssl_SOURCE_DIR}/include
)
target_link_libraries(benchmark_exe
benchmark::benchmark
pthread
ssl
crypto
z)
PUBLIC benchmark::benchmark
PUBLIC pthread
PUBLIC ssl
PUBLIC crypto
PUBLIC zlibstatic)
endif(BENCHMARK)
4 changes: 4 additions & 0 deletions include/CXXGraphConfig.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// the configured options and settings for CXXGraph
#define CXXGraph_VERSION_MAJOR 1
#define CXXGraph_VERSION_MINOR 0
#define CXXGraph_VERSION_PATCH 0
Loading