kou commented on code in PR #6:
URL: https://github.com/apache/iceberg-cpp/pull/6#discussion_r1902260652


##########
cmake_modules/BuildUtils.cmake:
##########
@@ -201,17 +202,26 @@ function(ADD_ICEBERG_LIB LIB_NAME)
                             PUBLIC 
"$<BUILD_INTERFACE:${ARG_STATIC_LINK_LIBS}>")
     endif()
 
-    install(TARGETS ${LIB_NAME}_static ${INSTALL_IS_OPTIONAL}
-            EXPORT ${LIB_NAME}_targets
+    install(TARGETS ${LIB_NAME}_static
+            EXPORT iceberg_targets
             ARCHIVE DESTINATION ${INSTALL_ARCHIVE_DIR}
             LIBRARY DESTINATION ${INSTALL_LIBRARY_DIR}
             RUNTIME DESTINATION ${INSTALL_RUNTIME_DIR}
             INCLUDES
             DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
   endif()
 
-  if(ARG_CMAKE_PACKAGE_NAME)
-    iceberg_install_cmake_package(${ARG_CMAKE_PACKAGE_NAME} 
${LIB_NAME}_targets)
+  # generate export header file
+  string(TOUPPER ${LIB_NAME} LIB_NAME_UPPER)
+  if(BUILD_SHARED)
+    generate_export_header(${LIB_NAME}_shared BASE_NAME ${LIB_NAME_UPPER})
+    target_compile_definitions(${LIB_NAME}_shared PUBLIC 
${LIB_NAME}_shared_EXPORTS)

Review Comment:
   
https://github.com/apache/iceberg-cpp/actions/runs/12584082126/job/35072964038#step:3:410
   
   ```text
   LINK : fatal error LNK1104: cannot open file '..\Debug\iceberg.lib' 
[D:\a\iceberg-cpp\iceberg-cpp\build\src\iceberg\arrow\iceberg_arrow_shared.vcxproj]
     Building Custom Rule 
D:/a/iceberg-cpp/iceberg-cpp/src/iceberg/CMakeLists.txt
     demo_table.cc
     iceberg_static.vcxproj -> 
D:\a\iceberg-cpp\iceberg-cpp\build\src\iceberg\Debug\iceberg_static.lib
     Building Custom Rule 
D:/a/iceberg-cpp/iceberg-cpp/src/iceberg/arrow/CMakeLists.txt
     demo_arrow.cc
     iceberg_arrow_static.vcxproj -> 
D:\a\iceberg-cpp\iceberg-cpp\build\src\iceberg\arrow\Debug\iceberg_arrow_static.lib
     Building Custom Rule 
D:/a/iceberg-cpp/iceberg-cpp/src/iceberg/puffin/CMakeLists.txt
     demo_puffin.cc
   LINK : fatal error LNK1104: cannot open file '..\Debug\iceberg.lib' 
[D:\a\iceberg-cpp\iceberg-cpp\build\src\iceberg\puffin\iceberg_puffin_shared.vcxproj]
   ```
   
   I think that it's a different problem. Could you share the URL of the commit?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to