CMakeLists.txt demo

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})

你可能感兴趣的:(linux,运维,服务器)