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

[cmake] `add_subdirectory` support

Open
#47 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
cmake, cpp
Domain
build-system

Research direction

Start by reading the repository's CMakeLists.txt and compare its current structure with the proposed add_subdirectory setup in this issue. Clarify which inclusion and linking behavior the project should support; done means the intended CMake integration works for a consuming project.

Written by the indexing model from the issue text.

Description

Thank you library creators for protecting peoples minds from Microsoft C interfaces!

But why every 3rd library with CMakeLists.txt can't setup a sane project inclusion!?
It is was not hard to create one for this library.

# Setup: odbc-cpp-wrapper (C++ Wrapper for ODBC) #
if(MINGW)
  set(ODBC_INCLUDE_DIR "" CACHE PATH "[MinGW] prevent '../Windows Kits/..' inclusion from VS dev env")
endif()
find_package(ODBC REQUIRED)
file(GLOB_RECURSE ODBCCPP_SOURCE_FILES_ "${CMAKE_SOURCE_DIR}/deps/odbc-cpp-wrapper/src/*.cpp")
add_library               (odbccpp STATIC ${ODBCCPP_SOURCE_FILES_})
target_include_directories(odbccpp SYSTEM PUBLIC  "${CMAKE_SOURCE_DIR}/deps/odbc-cpp-wrapper/src")
target_compile_definitions(odbccpp        PUBLIC  ODBC_STATIC)
target_link_libraries     (odbccpp        PUBLIC  ODBC::ODBC)
set_target_properties     (odbccpp PROPERTIES CXX_STANDARD 11 CXX_STANDARD_REQUIRED ON)
target_link_libraries(${PROJECT_NAME} odbccpp)

Should I try to contribute to project's CMakeLists.txt?

Dominant language
C++
Stars
53
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 SAP/odbc-cpp-wrapper

All issues in SAP/odbc-cpp-wrapper

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.