diff --git a/CMakeLists.txt b/CMakeLists.txt index 8c6845cb..27c1f4a2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -812,14 +812,8 @@ set_target_properties(libtesseract set_target_properties(libtesseract PROPERTIES SOVERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}) -if(WIN32) - set_target_properties(libtesseract - PROPERTIES OUTPUT_NAME tesseract${VERSION_MAJOR}${VERSION_MINOR}) - set_target_properties(libtesseract - PROPERTIES DEBUG_OUTPUT_NAME tesseract${VERSION_MAJOR}${VERSION_MINOR}d) -else() - set_target_properties(libtesseract PROPERTIES OUTPUT_NAME tesseract) -endif() +set_target_properties(libtesseract + PROPERTIES OUTPUT_NAME tesseract$<$:${VERSION_MAJOR}${VERSION_MINOR}$<$:d>>) if(SW_BUILD) target_link_libraries(libtesseract PUBLIC org.sw.demo.danbloomberg.leptonica @@ -884,8 +878,10 @@ get_target_property(tesseract_NAME libtesseract NAME) get_target_property(tesseract_VERSION libtesseract VERSION) get_target_property(tesseract_OUTPUT_NAME libtesseract OUTPUT_NAME) -configure_file(tesseract.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/tesseract.pc +configure_file(tesseract.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/tesseract.pc.in @ONLY) +# to resolve generator expression in OUTPUT_NAME +file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/tesseract.pc INPUT ${CMAKE_CURRENT_BINARY_DIR}/tesseract.pc.in) configure_package_config_file( cmake/templates/TesseractConfig.cmake.in