11# export our linkerscript
2- set ( TARGET_LINKERSCRIPT "${CMAKE_CURRENT_SOURCE_DIR } /linkerscript.ld" PARENT_SCOPE )
2+ set_property ( GLOBAL PROPERTY TARGET_LINKERSCRIPT "${CMAKE_CURRENT_LIST_DIR } /linkerscript.ld" )
33
44# set the stm32f469 cpu options as a seperate target so the driver layer can link agains klib
55add_library (target_cpu_options INTERFACE )
@@ -9,7 +9,7 @@ set_target_properties(target_cpu_options PROPERTIES FOLDER "klib")
99add_library (${PROJECT_NAME } ::target_cpu_options ALIAS target_cpu_options )
1010
1111# include the arm directory for all the cmsis files
12- target_include_directories (target_cpu_options INTERFACE ${CMAKE_SOURCE_DIR } /targets /arm/ )
12+ target_include_directories (target_cpu_options INTERFACE ${CMAKE_CURRENT_LIST_DIR } /../.. /arm/ )
1313
1414# set the cpu options for the compiler
1515target_compile_options (target_cpu_options INTERFACE "-march=armv7e-m" )
@@ -33,7 +33,7 @@ target_compile_options(target_cpu_options INTERFACE "-fno-asynchronous-unwind-ta
3333
3434# cpu stm32f469 target drivers
3535set (SOURCES
36- ${CMAKE_CURRENT_SOURCE_DIR } /../../arm/vector_table/cortex-m4.cpp
36+ ${CMAKE_CURRENT_LIST_DIR } /../../arm/vector_table/cortex-m4.cpp
3737)
3838
3939set (HEADERS_PRIVATE
@@ -60,7 +60,7 @@ target_compile_features(target_cpu PUBLIC cxx_std_20)
6060
6161# set the target_cpu for klib
6262get_filename_component (TARGET_CPU_FOLDER ${CMAKE_CURRENT_LIST_DIR } NAME )
63- set ( TARGET_CPU ${TARGET_CPU_FOLDER} PARENT_SCOPE )
63+ set_property ( GLOBAL PROPERTY TARGET_CPU ${TARGET_CPU_FOLDER} )
6464target_compile_definitions (target_cpu PUBLIC "TARGET_CPU=${TARGET_CPU} " )
6565
6666# add target specific compile options
@@ -76,7 +76,6 @@ target_link_libraries(target_cpu PUBLIC klib)
7676# - header location in project: ${CMAKE_CURRENT_BINARY_DIR}/generated_headers
7777target_include_directories (
7878 target_cpu PUBLIC
79- "$<BUILD_INTERFACE :${CMAKE_CURRENT_SOURCE_DIR } >"
80- "$<BUILD_INTERFACE :${CMAKE_CURRENT_SOURCE_DIR } >"
79+ "$<BUILD_INTERFACE :${CMAKE_CURRENT_LIST_DIR } >"
8180 "$<BUILD_INTERFACE :${GENERATED_HEADERS_DIR} >"
8281)
0 commit comments