project/
├── CMakeLists.txt
├── app/
│ ├── CMakeLists.txt
│ └── myfunc.c
├── include/
│ ├── myfunc.h
│ └── unity.h
├── test/
│ ├── CMakeLists.txt
│ └── test_myfunc.c
└── unity/
├── unity.c
└── unity.h
├── CMakeLists.txt
├── app/
│ ├── CMakeLists.txt
│ └── myfunc.c
├── include/
│ ├── myfunc.h
│ └── unity.h
├── test/
│ ├── CMakeLists.txt
│ └── test_myfunc.c
└── unity/
├── unity.c
└── unity.h
project/CMakeLists.txt
cmake_minimum_required(VERSION 3.16)
# Set project name and version
project(my_project VERSION 1.0)
# Add app and test subdirectories
add_subdirectory(app)
add_subdirectory(test)
# Set project name and version
project(my_project VERSION 1.0)
# Add app and test subdirectories
add_subdirectory(app)
add_subdirectory(test)
project/test/CMakeLists.txt
# Add executable target
add_executable(my_test test_myfunc.c)
# Add include directories
target_include_directories(my_test PRIVATE ${PROJECT_SOURCE_DIR}/include)
# Link with Unity and app libraries
target_link_libraries(my_test PRIVATE unity my_app)
add_executable(my_test test_myfunc.c)
# Add include directories
target_include_directories(my_test PRIVATE ${PROJECT_SOURCE_DIR}/include)
# Link with Unity and app libraries
target_link_libraries(my_test PRIVATE unity my_app)
댓글 없음:
댓글 쓰기