diff --git a/ports/linux/gnu/CMakeLists.txt b/ports/linux/gnu/CMakeLists.txt index 4b5179402..aa865b7c7 100644 --- a/ports/linux/gnu/CMakeLists.txt +++ b/ports/linux/gnu/CMakeLists.txt @@ -19,4 +19,8 @@ target_include_directories(${PROJECT_NAME} ${CMAKE_CURRENT_LIST_DIR}/inc ) -target_compile_definitions(${PROJECT_NAME} PUBLIC "-D_GNU_SOURCE -DTX_LINUX_DEBUG_ENABLE") \ No newline at end of file +target_compile_definitions(${PROJECT_NAME} PUBLIC "-D_GNU_SOURCE -DTX_LINUX_DEBUG_ENABLE") + +if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/example_build/CMakeLists.txt) + add_subdirectory(example_build) +endif() diff --git a/ports/linux/gnu/example_build/CMakeLists.txt b/ports/linux/gnu/example_build/CMakeLists.txt new file mode 100644 index 000000000..37ca00186 --- /dev/null +++ b/ports/linux/gnu/example_build/CMakeLists.txt @@ -0,0 +1,15 @@ +# Build sample_threadx program + +project(sample_threadx) +set(SRCS sample_threadx.c) + +add_executable(${PROJECT_NAME}) +target_sources(${PROJECT_NAME} PRIVATE ${SRCS}) +set_target_properties( + ${PROJECT_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/../../../../) +target_include_directories( + ${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/../inc + ${CMAKE_CURRENT_LIST_DIR}/../../../../common/inc) + +target_link_libraries(${PROJECT_NAME} PRIVATE threadx)