Skip to content
Browse files

Merge pull request #129 from xd009642/cmake_config

Initial version of coz-profileConfig.cmake
  • Loading branch information...
ccurtsinger committed Oct 20, 2019
2 parents d87e924 + b7c65bb commit 030f6742558a5e1959029ded71f81bc6c882c9dd
Showing with 31 additions and 0 deletions.
  1. +2 −0 Makefile
  2. +3 −0
  3. +26 −0
@@ -9,7 +9,9 @@ update-gh-pages:: all

install:: all
@echo $(LOG_PREFIX) Installing coz to prefix $(prefix) $(LOG_SUFFIX)
@sed 's@destdir@"${DESTDIR}${prefix}"@g' > coz-profilerConfig.cmake
@$(INSTALL) -D coz $(DESTDIR)$(bindir)/coz
@$(INSTALL) -D coz-profilerConfig.cmake $(DESTDIR)$(pkglibdir)/coz-profilerConfig.cmake
@$(INSTALL) -D libcoz/ $(DESTDIR)$(pkglibdir)/
@$(INSTALL) -D include/coz.h $(DESTDIR)$(incdir)/coz.h
@mkdir -p $(DESTDIR)$(man1dir)
@@ -67,6 +67,9 @@ To plot profile results, go to and load your
## Sample Applications
The `benchmarks` directory in this repository includes several small benchmarks with progress points added at appropriate locations. To build and run one of these benchmarks with `coz`, just browse to `benchmarks/{bench name}` and type `make bench` (or `make test` for a smaller input size). These programs may require several runs before coz has enough measurements to generate a useful profile. Once you have profiled these programs for several minutes, go to to load and plot your profile.

## CMake
When you install coz it installs a cmake config file. To add coz to a cmake project simply use the command `find_package(coz-profiler)`. This will import a target for the library and includes called `coz::coz` and a target for the coz binary `coz::profiler`. For guidance on how to use these targets refer to the CMake documentation.

## Limitations
Coz currently does not support interpreted or JIT-compiled languages such as Python, Ruby, or JavaScript. Interpreted languages will likely not be supported at any point, but support for JIT-compiled languages that produce debug information could be added in the future.

@@ -0,0 +1,26 @@

set(COZDIR destdir)

set(COZ_BIN ${COZDIR}/bin/coz)
set(COZ_INCLUDE_DIR ${COZDIR}/include)




add_library(coz::coz UNKNOWN IMPORTED)
set_target_properties(coz::coz PROPERTIES

set_target_properties(coz::coz PROPERTIES

add_executable(coz::profiler IMPORTED)

set_property(TARGET coz::profiler PROPERTY IMPORTED_LOCATION ${COZ_BIN})

0 comments on commit 030f674

Please sign in to comment.
You can’t perform that action at this time.