Commit e38fde64 by Chris Kennelly

Setup targets from each directory, rather than the top-level.

parent 9b5ece6e
...@@ -30,19 +30,6 @@ include_directories(${PROJECT_SOURCE_DIR}/include) ...@@ -30,19 +30,6 @@ include_directories(${PROJECT_SOURCE_DIR}/include)
include_directories(${PROJECT_SOURCE_DIR}/src) include_directories(${PROJECT_SOURCE_DIR}/src)
# Build the targets # Build the targets
FILE(GLOB SOURCE_FILES "src/*.cc") enable_testing()
add_library(benchmark STATIC ${SOURCE_FILES}) add_subdirectory(src)
add_subdirectory(test)
add_executable(benchmark_test test/benchmark_test.cc)
target_link_libraries(benchmark_test benchmark ${CMAKE_THREAD_LIBS_INIT})
# Install target (will install the library to specified CMAKE_INSTALL_PREFIX variable)
INSTALL(
TARGETS benchmark
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
COMPONENT library)
INSTALL(
DIRECTORY "${PROJECT_SOURCE_DIR}/include/benchmark"
DESTINATION include
FILES_MATCHING PATTERN "*.*h")
\ No newline at end of file
set(SOURCE_FILES "benchmark.cc" "colorprint.cc" "commandlineflags.cc" "sleep.cc" "sysinfo.cc" "walltime.cc")
add_library(benchmark STATIC ${SOURCE_FILES})
# Install target (will install the library to specified CMAKE_INSTALL_PREFIX variable)
install(
TARGETS benchmark
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
COMPONENT library)
install(
DIRECTORY "${PROJECT_SOURCE_DIR}/include/benchmark"
DESTINATION include
FILES_MATCHING PATTERN "*.*h")
# Demonstration executable
add_executable(benchmark_test benchmark_test.cc)
target_link_libraries(benchmark_test benchmark ${CMAKE_THREAD_LIBS_INIT})
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment