Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Unnecessary files from libshared are installed when used as submodule

Open Beginner friendly
#122 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
75/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
cmake, cpp
Domain
build-system

Research direction

The issue is in src/libshared/src/CMakeLists.txt, where install rules for the shared library and headers cause unwanted files to be installed when libshared is used as a submodule. Start by examining that file around line 56, understand how add_subdirectory works, and verify the fix by building and checking the install directory. The patch provided shows the exact lines to remove; test by building timewarrior as a submodule and ensuring only intended files are installed.

Written by the indexing model from the issue text.

Description

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")
Dominant language
C++
Stars
7
Forks
30
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from GothenburgBitFactory/libshared

All issues in GothenburgBitFactory/libshared

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.