11# set the sources
2- set (SOURCES
3- ${CMAKE_CURRENT_SOURCE_DIR } /entry/entry.c
4- ${CMAKE_CURRENT_SOURCE_DIR } /entry/secondary.cpp
2+ set (SOURCES
3+ ${CMAKE_CURRENT_LIST_DIR } /entry/entry.c
4+ ${CMAKE_CURRENT_LIST_DIR } /entry/secondary.cpp
55)
66
77set (HEADERS_PRIVATE
8- ${CMAKE_CURRENT_SOURCE_DIR } /comm/streams/stream_base.hpp
9- ${CMAKE_CURRENT_SOURCE_DIR } /comm/streams/combined_stream.hpp
10- ${CMAKE_CURRENT_SOURCE_DIR } /comm/streams/istream.hpp
11- ${CMAKE_CURRENT_SOURCE_DIR } /comm/streams/ostream.hpp
8+ ${CMAKE_CURRENT_LIST_DIR } /comm/streams/stream_base.hpp
9+ ${CMAKE_CURRENT_LIST_DIR } /comm/streams/combined_stream.hpp
10+ ${CMAKE_CURRENT_LIST_DIR } /comm/streams/istream.hpp
11+ ${CMAKE_CURRENT_LIST_DIR } /comm/streams/ostream.hpp
1212)
1313
1414set (HEADERS_PUBLIC
15- ${CMAKE_CURRENT_SOURCE_DIR } /irq.hpp
16- ${CMAKE_CURRENT_SOURCE_DIR } /klib.hpp
17- ${CMAKE_CURRENT_SOURCE_DIR } /stream.hpp
15+ ${CMAKE_CURRENT_LIST_DIR } /irq.hpp
16+ ${CMAKE_CURRENT_LIST_DIR } /klib.hpp
17+ ${CMAKE_CURRENT_LIST_DIR } /stream.hpp
1818)
1919
2020# check if we need to add the segger rtt library
21- if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR } /comm/segger/src/)
21+ if (EXISTS ${CMAKE_CURRENT_LIST_DIR } /comm/segger/src/)
2222 message ("Segger RTT support enabled" )
2323
2424 # append the header implementation to the public headers
25- set (HEADERS_PUBLIC ${HEADERS_PUBLIC} ${CMAKE_CURRENT_SOURCE_DIR } /comm/segger/rtt.hpp)
26- set (HEADERS_PRIVATE ${HEADERS_PUBLIC} ${CMAKE_CURRENT_SOURCE_DIR } /comm/streams/rtt_stream.hpp)
25+ set (HEADERS_PUBLIC ${HEADERS_PUBLIC} ${CMAKE_CURRENT_LIST_DIR } /comm/segger/rtt.hpp)
26+ set (HEADERS_PRIVATE ${HEADERS_PUBLIC} ${CMAKE_CURRENT_LIST_DIR } /comm/streams/rtt_stream.hpp)
2727
2828 # add the segger library source files
29- set (SOURCES ${SOURCES} ${CMAKE_CURRENT_SOURCE_DIR } /comm/segger/src/RTT/SEGGER_RTT.c)
29+ set (SOURCES ${SOURCES} ${CMAKE_CURRENT_LIST_DIR } /comm/segger/src/RTT/SEGGER_RTT.c)
3030
3131 # check if we need to include the systemview sources
32- if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR } /comm/segger/src/SYSVIEW/)
32+ if (EXISTS ${CMAKE_CURRENT_LIST_DIR } /comm/segger/src/SYSVIEW/)
3333 # append the systemview sources
34- set (SOURCES ${SOURCES} ${CMAKE_CURRENT_SOURCE_DIR } /comm/segger/src/SYSVIEW/SEGGER_SYSVIEW.c)
35- set (SOURCES ${SOURCES} ${CMAKE_CURRENT_SOURCE_DIR } /comm/segger/src/SYSVIEW/SEGGER_SYSVIEW_Config_NoOS.c)
34+ set (SOURCES ${SOURCES} ${CMAKE_CURRENT_LIST_DIR } /comm/segger/src/SYSVIEW/SEGGER_SYSVIEW.c)
35+ set (SOURCES ${SOURCES} ${CMAKE_CURRENT_LIST_DIR } /comm/segger/src/SYSVIEW/SEGGER_SYSVIEW_Config_NoOS.c)
3636 endif ()
3737else ()
3838 message ("Segger RTT support disabled" )
@@ -99,7 +99,7 @@ endif()
9999
100100# enabled segger support in the defines to prevent a
101101# include of the segger files
102- if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR } /comm/segger/src/)
102+ if (EXISTS ${CMAKE_CURRENT_LIST_DIR } /comm/segger/src/)
103103 target_compile_definitions (klib PUBLIC "KLIB_SEGGER_SUPPORT=1" )
104104else ()
105105 target_compile_definitions (klib PUBLIC "KLIB_SEGGER_SUPPORT=0" )
@@ -111,7 +111,7 @@ endif()
111111# - header location in project: ${CMAKE_CURRENT_BINARY_DIR}/generated_headers
112112target_include_directories (
113113 klib PUBLIC
114- "$<BUILD_INTERFACE :${CMAKE_SOURCE_DIR } >"
115- "$<BUILD_INTERFACE :${CMAKE_SOURCE_DIR } >"
114+ "$<BUILD_INTERFACE :${CMAKE_CURRENT_LIST_DIR } /../ >"
115+ "$<BUILD_INTERFACE :${CMAKE_CURRENT_LIST_DIR } /../ >"
116116 "$<BUILD_INTERFACE :${GENERATED_HEADERS_DIR} >"
117117)
0 commit comments