Skip to content

build error (and suggested fix): add ARCHIVE DESTINATION for static libs #2

Description

@geoffthorpe

In my environment I hit build errors with the following two lines of CMakeLists.txt;

install(TARGETS execs_static LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(TARGETS execs-embedded_static LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})

For those two targets (the only ones declared as static libraries), it seems cmake needed ARCHIVE DESTINATION, in addition to (or instead of) LIBRARY DESTINATION.

The following local change allows the build to complete successfully;

 install(TARGETS execs LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
 install(TARGETS execs-embedded LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
-install(TARGETS execs_static LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
-install(TARGETS execs-embedded_static LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
+install(TARGETS execs_static LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+       ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
+install(TARGETS execs-embedded_static LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+       ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
 install(FILES execs.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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