Closed Lectem closed 4 years ago
Please make the installation optional, so that it is not installed alongside projects that use add_subdirectory to integrate Optick.
It seems the appveyor build failure is unrelated (some warning treated as error), would it be possible to retrigger the build against latest master
?
Those changes add installation to the CMakeLists.txt. This way a user can build the
install
target and on the consumer side do for example:Note that I had to add the version to the project command which will need to be kept up to date, and
SameMajorVersion
inwrite_basic_package_version_file
assuming semantic versioning. If it is not the case, you can check https://cmake.org/cmake/help/latest/module/CMakePackageConfigHelpers.html#command:write_basic_package_version_file for the list of possible version compatibility modes.Also, this should work on old versions of CMake, but I am not sure if all the other commands already used in the rest of the file are available in 3.2. It might be better to update the CMake required version (I'd suggest a minimum of 3.8, ideally 3.14). I tested this on CMake 3.14+ only.