Unnecessary files from libshared are installed when used as submodule
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from GothenburgBitFactory/libshared
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
GothenburgBitFactory/libshared#112 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
GothenburgBitFactory/libshared#77 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
GothenburgBitFactory/libshared#49 · 2 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
All issues in GothenburgBitFactory/libshared
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
ros2/message_filters#338 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
subsurface/subsurface#4984 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
flutter-webrtc/flutter-webrtc#2206 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
google-ai-edge/LiteRT-LM#3739 ·