Cmake edit with 'make install' target

This commit is contained in:
David Coeurjolly 2014-02-05 20:38:57 +01:00
parent be84ed0373
commit 25074512ff

View File

@ -3,10 +3,6 @@ project (benchmark)
find_package(Threads)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib)
set(CMAKE_CXX_FLAGS "-Wall -Werror -pedantic-errors --std=c++0x")
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -DDEBUG")
set(CMAKE_CXX_FLAGS_RELEASE "-fno-strict-aliasing -O3 -DNDEBUG")
@ -32,7 +28,6 @@ endif()
# Set up directories
include_directories(${PROJECT_SOURCE_DIR}/include)
include_directories(${PROJECT_SOURCE_DIR}/src)
link_directories(${PROJECT_SOURCE_DIR}/lib)
# Build the targets
FILE(GLOB SOURCE_FILES "src/*.cc")
@ -41,3 +36,9 @@ add_library(benchmark STATIC ${SOURCE_FILES})
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)