Skip to content

Unnecessary files from libshared are installed when used as submodule #122

Description

@wshanks

GothenburgBitFactory/timewarrior#706 changed from explicitly listing libshared source files to using add_subdirectory(${CMAKE_SOURCE_DIR}/src/libshared). This has the side effect of inheriting libshared's cmake install rules and causing files like lib/libshared.a and include/JSON.h to get installed along with bin/timew, etc.

I discovered these files while trying to make a conda package of timewarrior. For now, I am working around the issue by using this patch:

--- a/src/libshared/src/CMakeLists.txt
+++ b/src/libshared/src/CMakeLists.txt
@@ -56,10 +56,6 @@
 
 add_library (shared STATIC ${shared_SRCS})
 
-set (CMAKE_INSTALL_LIBDIR lib CACHE PATH "Output directory for libraries")
-install (TARGETS shared DESTINATION lib)
-install (FILES ${shared_HEADERS} DESTINATION include)
-
 add_executable (lex_executable lex.cpp)
 target_link_libraries (lex_executable shared)
 set_property (TARGET lex_executable PROPERTY OUTPUT_NAME "lex")

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