Skip to content

Commit

Permalink
🏗️ (cmake): Link general purpose libraries to all targets
Browse files Browse the repository at this point in the history
This change allows all targets to use the aforementioned libraries by
just including their header.

There is not need to use target_link_libraries anymore.
  • Loading branch information
ladislas committed Jun 3, 2021
1 parent 6e960aa commit 2c107fc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
15 changes: 15 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,21 @@ include_directories(BEFORE
${INCLUDE_DIR}
)

# Link libraries to all targets
add_subdirectory(${LIBS_DIR}/Utils)
add_subdirectory(${LIBS_DIR}/LogKit)
add_subdirectory(${LIBS_DIR}/HelloWorld)
add_subdirectory(${LIBS_DIR}/CircularBuffer)
add_subdirectory(${LIBS_DIR}/CriticalSection)

link_libraries(
Utils
LogKit
HelloWorld
CircularBuffer
CriticalSection
)

# Add drivers & libraries
add_subdirectory(${DRIVERS_DIR})
add_subdirectory(${LIBS_DIR})
Expand Down
7 changes: 0 additions & 7 deletions libs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ add_subdirectory(${LIBS_DIR}/FileManager)
add_subdirectory(${LIBS_DIR}/HardwareTest/LekaSD)
add_subdirectory(${LIBS_DIR}/HardwareTest/LekaMotors)

add_subdirectory(${LIBS_DIR}/HelloWorld)

add_subdirectory(${LIBS_DIR}/InvestigationDay/BLE)
add_subdirectory(${LIBS_DIR}/InvestigationDay/LekaRFID)
add_subdirectory(${LIBS_DIR}/InvestigationDay/LekaWifi)
Expand All @@ -21,9 +19,4 @@ add_subdirectory(${LIBS_DIR}/LKAnimationKit)

add_subdirectory(${LIBS_DIR}/LKCalculatorKit)

add_subdirectory(${LIBS_DIR}/Utils)
add_subdirectory(${LIBS_DIR}/LogKit)
add_subdirectory(${LIBS_DIR}/CircularBuffer)
add_subdirectory(${LIBS_DIR}/CriticalSection)

add_subdirectory(${LIBS_DIR}/PrettyPrinter)

0 comments on commit 2c107fc

Please sign in to comment.