Hi Filip,
I'm still struggling with this problem.
I can't find a good explanation how to include a .memake thing into my cmakelist.txt, or in other words, how to utilize the sprintf legacy library with cmake.
I think this should be a very common issue, but even in this forum there seems to be no good example.
The migration from make to cmake could be something for a tutorial, as a lot of people are using either concept.
Please give me your advice, best would be a short example, how to include the sprintf library in my cmakelist file.
Here is my current cmakelist.txt, used with a mikromedia 3 and a PIC32MZ processor:
Code: Select all
cmake_minimum_required(VERSION 3.21)
if (${TOOLCHAIN_LANGUAGE} MATCHES "MikroC")
project(Brushless23_PIC32_Display LANGUAGES MikroC)
else()
project(Brushless23_PIC32_Display LANGUAGES C ASM)
endif()
include(mikroeUtils)
set(PROJECT_TYPE "designer" CACHE STRING "" FORCE)
add_executable(Brushless23_PIC32_Display
main.c
main_screen.c
main_screen.h
main_screen.mscr
motor.h
brushless23_options.h
motor_act42blf01.h
motor.h
brushless23_screen.c
brushless23_screen.h
__Lib_Sprintf/__Lib_Sprintf.mcl
)
############################ Brushless23_PIC32_Display GENERATED CODE START ###########################
add_subdirectory(lib_brushless23)
target_link_libraries(Brushless23_PIC32_Display PUBLIC Click.Brushless23)
find_package(MikroSDK.VisualTft REQUIRED)
target_link_libraries(Brushless23_PIC32_Display PUBLIC MikroSDK.VisualTft)
find_package(MikroSDK.TouchController REQUIRED)
target_link_libraries(Brushless23_PIC32_Display PUBLIC MikroSDK.TouchController)
find_package(MikroSDK.GraphicLibrary REQUIRED)
target_link_libraries(Brushless23_PIC32_Display PUBLIC MikroSDK.GraphicLibrary)
find_package(MikroC.Core REQUIRED)
target_link_libraries(Brushless23_PIC32_Display PUBLIC MikroC.Core)
############################ Brushless23_PIC32_Display GENERATED CODE END ###########################
designer_generator(Brushless23_PIC32_Display resource.mres main_screen.mscr)
Obviously this couldn't work, as there is no include file for the function definitions of the sprintf library.
Even if I would ( I tried it ), it doesn't recognise the __Lib_Sprintf.mcl content.
Thanks and kind regards
Frank