Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMakes library path cmake_install.cmake #131

Open
volga629-1 opened this issue Dec 2, 2022 · 1 comment
Open

CMakes library path cmake_install.cmake #131

volga629-1 opened this issue Dec 2, 2022 · 1 comment

Comments

@volga629-1
Copy link

Hello Everyone,
Can you please add, to allow library path flexibility.

  Manually-specified variables were not used by the project:

    CMAKE_INSTALL_LIBDIR

if(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/libks.so.1" AND
     NOT IS_SYMLINK "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/libks.so.1")
@volga629-1
Copy link
Author

That add flexibility to detect library installation dir

if (NOT KS_PLAT_WIN)

        # Set install targets
        install(TARGETS ks COMPONENT "runtime" EXPORT LibKSConfig DESTINATION **${CMAKE_INSTALL_LIBDIR})**
        install(DIRECTORY src/include/libks COMPONENT "runtime" DESTINATION include PATTERN src/include/libks/internal EXCLUDE)

        # Set path for pkg-config based on ARCH and distro type
        if("${CMAKE_OS_NAME}" STREQUAL "Centos") # pkg-config --variable pc_path pkg-config
                if(${CPACK_SYSTEM_NAME} MATCHES "x86_64")
                        install(FILES ${PROJECT_BINARY_DIR}/libks.pc COMPONENT "runtime" DESTINATION lib64/pkgconfig)
                else()
                        install(FILES ${PROJECT_BINARY_DIR}/libks.pc COMPONENT "runtime" DESTINATION lib/pkgconfig)
                endif()
        else()
                install(FILES ${PROJECT_BINARY_DIR}/libks.pc COMPONENT "runtime" DESTINATION **${CMAKE_INSTALL_LIBDIR}**/pkgconfig)
        endif()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant