mirror of
https://github.com/plasma-umass/coz.git
synced 2024-09-11 04:55:25 +03:00
Add an option to disable Coz install when embedding
This commit is contained in:
parent
ee410664f8
commit
c387678315
@ -8,13 +8,9 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH ${PROJECT_BINARY_DIR})
|
||||
|
||||
include(GNUInstallDirs)
|
||||
find_package(Threads REQUIRED)
|
||||
find_package(libelfin REQUIRED)
|
||||
|
||||
install(PROGRAMS coz DESTINATION bin)
|
||||
install(FILES LICENSE.md DESTINATION licenses)
|
||||
|
||||
add_compile_options(-gdwarf-3)
|
||||
|
||||
add_subdirectory(libcoz)
|
||||
@ -29,4 +25,10 @@ if(BUILD_BENCHMARKS)
|
||||
add_subdirectory(benchmarks)
|
||||
endif()
|
||||
|
||||
install(FILES coz-profilerConfig.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)
|
||||
option(INSTALL_COZ "Enable installation of coz. (Projects embedding coz may want to turn this OFF.)" ON)
|
||||
if(INSTALL_COZ)
|
||||
include(GNUInstallDirs)
|
||||
install(PROGRAMS coz DESTINATION bin)
|
||||
install(FILES LICENSE.md DESTINATION licenses)
|
||||
install(FILES coz-profilerConfig.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)
|
||||
endif()
|
||||
|
@ -18,15 +18,17 @@ target_include_directories(coz
|
||||
$<INSTALL_INTERFACE:include/coz>)
|
||||
target_link_libraries(coz PUBLIC dl rt Threads::Threads libelfin::libelfin)
|
||||
|
||||
install(TARGETS coz
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/coz)
|
||||
|
||||
add_library(coz-instrumentation INTERFACE)
|
||||
target_include_directories(coz-instrumentation
|
||||
INTERFACE
|
||||
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
|
||||
$<INSTALL_INTERFACE:include/coz>)
|
||||
target_link_libraries(coz-instrumentation INTERFACE -Wl,--push-state,--no-as-needed -ldl -Wl,--pop-state)
|
||||
|
||||
if(INSTALL_COZ)
|
||||
install(TARGETS coz
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/coz)
|
||||
endif()
|
||||
|
Loading…
Reference in New Issue
Block a user