This commit is contained in:
edwin 2025-02-20 17:16:15 +01:00
parent 08e2bb7fb5
commit 426f9e9f24
3 changed files with 9 additions and 6 deletions

5
.gitignore vendored
View File

@ -1,5 +1,4 @@
build/*
build
lib/lvgl/*
lib/lv_drivers/*
lib/testlib .gitignore
lib/*
!lib/testlib .gitignore

View File

@ -15,6 +15,9 @@ add_compile_definitions(DLV_CONF_PATH="${CMAKE_CURRENT_SOURCE_DIR}/include/lv_co
add_compile_definitions(DLV_CONF_PATH="${CMAKE_CURRENT_SOURCE_DIR}/include/lv_drv_conf.h")
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include/)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/lib/sdl-cmake)
# set 1 to compile static (Standalone)
set(BIN_STATIC 1)
@ -40,7 +43,6 @@ endif()
set(SubProjects
testlib # Example subproject
lvgl
lv_drivers
)
# Create the main executable, specifying the source file
@ -62,9 +64,9 @@ foreach(Project IN LISTS SubProjects)
# Link the subproject to the main project executable
if(BIN_STATIC)
target_link_libraries(${PROJECT_NAME} PRIVATE ${Project} -static)
target_link_libraries(${PROJECT_NAME} PUBLIC ${Project} -static)
else()
target_link_libraries(${PROJECT_NAME} PRIVATE ${Project})
target_link_libraries(${PROJECT_NAME} PUBLIC ${Project})
endif()
endforeach()

View File

@ -25,3 +25,5 @@ This project is designed to learn how to structure a C project with CMake and in
./clean.sh
- TODO https://gitlab.com/aminosbh/sdl2-cmake-modules