MaciejPatro / cmake-tidy

Project provides a set of tools that will ease the development process for code written in CMake.
MIT License
15 stars 0 forks source link

Archive destination should be treated as one keyword #52

Closed MaciejPatro closed 4 years ago

MaciejPatro commented 4 years ago

  install(TARGETS gtest gtest_main
    RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
    ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
    LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}")

now is handled as

install(TARGETS
        gtest
        gtest_main
    RUNTIME
    DESTINATION
        "${CMAKE_INSTALL_BINDIR}"
    ARCHIVE
    DESTINATION
        "${CMAKE_INSTALL_LIBDIR}"
    LIBRARY
    DESTINATION
        "${CMAKE_INSTALL_LIBDIR}"
)

improvement would be:

install(TARGETS
        gtest
        gtest_main
    RUNTIME DESTINATION
        "${CMAKE_INSTALL_BINDIR}"
    ARCHIVE DESTINATION
        "${CMAKE_INSTALL_LIBDIR}"
    LIBRARY DESTINATION
        "${CMAKE_INSTALL_LIBDIR}"
)

or even

install(TARGETS
        gtest
        gtest_main
    RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
    ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
    LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
)