Countly / Countly/countly-sdk-cpp

Using -DCMAKE_INSTALL_PREFIX with build produces flat include folder & does not include DLL

Open
#103 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
34
Forks
25
PR merge metrics
No merged PRs in 30d

Description

If you use -DCMAKE_INSTALL_PREFIX=[some folder] when generating the build files, and then use --target install, you get a badly formed output folder.

The DLL is the easiest one to fix.

install(TARGETS countly ARCHIVE DESTINATION lib PUBLIC_HEADER DESTINATION include/countly)

Should be

install(TARGETS countly ARCHIVE DESTINATION lib PUBLIC_HEADER DESTINATION include/countly RUNTIME DESTINATION bin)

This way, there will be a bin folder containing the countly.dll.

There are a few errors with the include setup. First, countly.hpp needs to be removed from COUNTLY_PUBLIC_HEADERS. While we're at it, add countly_configuration.hpp, which is missing!

Next, add this additional install step at the end of the file:

install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/countly.hpp DESTINATION include)

This will separately install countly.hpp in the root include folder in the install directory, creating the expected setup.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the CMake install(TARGETS countly...) block and the COUNTLY_PUBLIC_HEADERS definition shown in the issue. Run a configured build with CMAKE_INSTALL_PREFIX and the install target, then verify that the installed layout has countly.dll under bin, countly.hpp under include, and the expected public headers under include/countly.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp
Domain
build-system
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.