diff --git a/api/CMakeLists.txt b/api/CMakeLists.txt index 893b3cc7e2..ab69cf66cd 100644 --- a/api/CMakeLists.txt +++ b/api/CMakeLists.txt @@ -99,6 +99,17 @@ endif() # Because CMake doesn't guess this from the .cc extension generated by protoc set_target_properties( kiapi PROPERTIES LINKER_LANGUAGE CXX ) +include( ${KICAD_CMAKE_MODULE_PATH}/KiCadVersion.cmake ) + +# Extract the major and minor build version as a string +string( REGEX MATCH + "([0-9]+)\\.([0-9]+)\\.([0-9]+)" + KICAD_MAJOR_MINOR_PATCH_VERSION + "${KICAD_VERSION}" + ) + +set_target_properties( kiapi PROPERTIES SOVERSION ${KICAD_MAJOR_MINOR_PATCH_VERSION} ) + target_include_directories( kiapi SYSTEM PUBLIC ${Protobuf_INCLUDE_DIRS} ) target_link_libraries( kiapi protobuf::libprotobuf )