Skip to content

Commit 93629bb

Browse files
feat(core): allow installation as a system lib
1 parent bf30684 commit 93629bb

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

core/CMakeLists.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,25 @@ if(NOT CODSPEED_MODE STREQUAL "off")
9797
endif()
9898
endif()
9999

100+
# Install the codspeed.h header
101+
install(
102+
FILES
103+
include/codspeed.h # or wherever codspeed.h is located in core/
104+
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/benchmark
105+
# Or possibly: DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
106+
)
107+
108+
# If there's also a library to install:
109+
install(
110+
TARGETS
111+
codspeed_core # whatever the target name is
112+
EXPORT codspeed-targets
113+
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
114+
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
115+
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
116+
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
117+
)
118+
100119
message(STATUS "Codspeed mode: ${CODSPEED_MODE}")
101120

102121
option(ENABLE_TESTS "Enable building the unit tests which depend on gtest" OFF)

0 commit comments

Comments
 (0)