Skip to content

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

@AndrewAtAvenza

Description

@AndrewAtAvenza

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions