Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(96)

Side by Side Diff: third_party/google_benchmark/src/CMakeLists.txt

Issue 2865663003: Adding Google benchmarking library. (Closed)
Patch Set: Sketch. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/google_benchmark/mingw.py ('k') | third_party/google_benchmark/src/arraysize.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # Allow the source files to find headers in src/
2 include_directories(${PROJECT_SOURCE_DIR}/src)
3
4 if (DEFINED BENCHMARK_CXX_LINKER_FLAGS)
5 list(APPEND CMAKE_SHARED_LINKER_FLAGS ${BENCHMARK_CXX_LINKER_FLAGS})
6 list(APPEND CMAKE_MODULE_LINKER_FLAGS ${BENCHMARK_CXX_LINKER_FLAGS})
7 endif()
8
9 file(GLOB
10 SOURCE_FILES
11 *.cc
12 ${PROJECT_SOURCE_DIR}/include/benchmark/*.h
13 ${CMAKE_CURRENT_SOURCE_DIR}/*.h)
14
15 add_library(benchmark ${SOURCE_FILES})
16 set_target_properties(benchmark PROPERTIES
17 OUTPUT_NAME "benchmark"
18 VERSION ${GENERIC_LIB_VERSION}
19 SOVERSION ${GENERIC_LIB_SOVERSION}
20 )
21
22 # Link threads.
23 target_link_libraries(benchmark ${BENCHMARK_CXX_LIBRARIES} ${CMAKE_THREAD_LIBS_ INIT})
24 find_library(LIBRT rt)
25 if(LIBRT)
26 target_link_libraries(benchmark ${LIBRT})
27 endif()
28
29 # We need extra libraries on Windows
30 if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
31 target_link_libraries(benchmark Shlwapi)
32 endif()
33
34 set(include_install_dir "include")
35 set(lib_install_dir "lib/")
36 set(bin_install_dir "bin/")
37 set(config_install_dir "lib/cmake/${PROJECT_NAME}")
38
39 set(generated_dir "${CMAKE_CURRENT_BINARY_DIR}/generated")
40
41 set(version_config "${generated_dir}/${PROJECT_NAME}ConfigVersion.cmake")
42 set(project_config "${generated_dir}/${PROJECT_NAME}Config.cmake")
43 set(targets_export_name "${PROJECT_NAME}Targets")
44
45 set(namespace "${PROJECT_NAME}::")
46
47 include(CMakePackageConfigHelpers)
48 write_basic_package_version_file(
49 "${version_config}" VERSION ${GIT_VERSION} COMPATIBILITY SameMajorVersion
50 )
51
52 configure_file("${PROJECT_SOURCE_DIR}/cmake/Config.cmake.in" "${project_config}" @ONLY)
53
54 # Install target (will install the library to specified CMAKE_INSTALL_PREFIX var iable)
55 install(
56 TARGETS benchmark
57 EXPORT ${targets_export_name}
58 ARCHIVE DESTINATION ${lib_install_dir}
59 LIBRARY DESTINATION ${lib_install_dir}
60 RUNTIME DESTINATION ${bin_install_dir}
61 INCLUDES DESTINATION ${include_install_dir})
62
63 install(
64 DIRECTORY "${PROJECT_SOURCE_DIR}/include/benchmark"
65 DESTINATION ${include_install_dir}
66 FILES_MATCHING PATTERN "*.*h")
67
68 install(
69 FILES "${project_config}" "${version_config}"
70 DESTINATION "${config_install_dir}")
71
72 install(
73 EXPORT "${targets_export_name}"
74 NAMESPACE "${namespace}"
75 DESTINATION "${config_install_dir}")
OLDNEW
« no previous file with comments | « third_party/google_benchmark/mingw.py ('k') | third_party/google_benchmark/src/arraysize.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698