I have been trying to search for documentation on windows build for benchmark for the last few months to no avail. I now understand why good programmers always document their code.
Anyways, I have this CMakeLists.txt this works well in linux but for some reason, it doesn't in windows. and more over it build(both in linux and windows) the library files inside the src folder not in the release folders!
here is my CMakeLists.txt
cmake_minimum_required (VERSION 3.14)
# setting cxx standard
set (CMAKE_CXX_STANDARD 11)
set (CMAKE_CXX_STANDARD_REQUIRED ON)
# project name
project (benchmark)
# set version numbers
set (benchmark_VERSION_MAJOR 0)
set (benchmark_VERSION_MINOR 1)
set (benchmark_VERSION_PATCH 0)
ExternalProject_Add(googlebenchmark
GIT_TAG master
PREFIX googlebenchmark
CMAKE_ARGS -DBENCHMARK_DOWNLOAD_DEPENDENCIES=ON
BUILD_COMMAND ${CMAKE_COMMAND} --build . --config Release
INSTALL_COMMAND ""
TEST_COMMAND ${CMAKE_CTEST_COMMAND} --build-config Release
)
ExternalProject_Get_Property (googlebenchmark SOURCE_DIR)
ExternalProject_Get_Property (googlebenchmark BINARY_DIR)
find_library (googlebenchmark_LIBRARIES NAMES benchmark HINTS ${BINARY_DIR}/src/Release)
message("library ${googlebenchmark_LIBRARIES}")
include_directories (googlebenchmark ${SOURCE_DIR}/include)
add_executable (benchmark try.cpp)
target_link_libraries (benchmark ${googlebenchmark_LIBRARIES})
#target_link_libraries (benchmark ${BINARY_DIR}/src/libbenchmark.a)
target_link_libraries (benchmark shlwapi)
add_dependencies (benchmark googlebenchmark)
in my Linux machine, I replaced shlwapi with pthread and it worked great, now for the windows machine I read the readme file and used the shlwapi library,
I can't seem to point to the weird place where the benchmark libraries are being built inside the src folder!
Any ideas would be helpful.(FOR WINDOWS PLEASE)
thanking everyone in advance,