Apart from the name of the project, the root CMakeLists.txt file is unchanged. Let us first look at the CMakeLists.txt file in the src subdirectory, where all the additional work actually happens. We will highlight the changes with respect to the file in the previous recipe:
- We declare our SHARED library target and its sources for the messaging library. Note that compile definitions and link libraries are unchanged:
add_library(message-shared SHARED "")target_sources(message-shared PRIVATE ${CMAKE_CURRENT_LIST_DIR}/Message.cpp )target_compile_definitions(message-shared PUBLIC $<$<BOOL:${UUID_FOUND}>:HAVE_UUID> )target_link_libraries(message-shared PUBLIC $<$<BOOL:${UUID_FOUND}>:PkgConfig::UUID> )
- We also set target properties. ...