CMakeLists.txt demo

发布时间:2024年01月19日

project:

 CMakeLists.txt
 Config.h.in
 build-cmake/
 doc/
 hardware/
 include/
 kernel/
 readme.md
 tasks/
 test/

make

cmake_minimum_required(VERSION 3.15)

project(tos)
# project(tos VERSION 0.0.1)

# configure_file(Config.h.in TutorialConfig.h)

include_directories( ${PROJECT_SOURCE_DIR}/include  )

# string(TIMESTAMP COMPILE_TIME %Y%m%d-%H%M%S)



add_subdirectory(kernel)
add_subdirectory(tasks)
add_subdirectory(hardware)

set(SRC_LIST test/main.c)
# aux_source_directory(test SRC_LIST)

add_executable(${PROJECT_NAME} ${SRC_LIST})

target_link_libraries(${PROJECT_NAME} kernel tasks hardware)




# option(USE_MYMATH "Use tutorial provided math implementation" OFF)

# if(USE_MYMATH)
#   add_subdirectory(MathFunctions)
#   list(APPEND EXTRA_LIBS MathFunctions)
#   list(APPEND EXTRA_INCLUDES ${PROJECT_SOURCE_DIR}/MathFunctions)
# endif()

subdirectory:

aux_source_directory(. SRC)

add_library(kernel ${SRC})
文章来源:https://blog.csdn.net/liuxs2009/article/details/135689053
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。