summaryrefslogtreecommitdiffstatshomepage
path: root/examples/usercmodule/cppexample/micropython.cmake
blob: 6da972c94e3b51b4fdc45151114a443f5c0d54fc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# Create an INTERFACE library for our CPP module.
add_library(usermod_cppexample INTERFACE)

# Add our source files to the library.
target_sources(usermod_cppexample INTERFACE
    ${CMAKE_CURRENT_LIST_DIR}/example.cpp
    ${CMAKE_CURRENT_LIST_DIR}/examplemodule.c
)

# Add the current directory as an include directory.
target_include_directories(usermod_cppexample INTERFACE
    ${CMAKE_CURRENT_LIST_DIR}
)

# Link our INTERFACE library to the usermod target.
target_link_libraries(usermod INTERFACE usermod_cppexample)