assignUser commented on code in PR #406:
URL: https://github.com/apache/arrow-nanoarrow/pull/406#discussion_r1531449200


##########
CMakeLists.txt:
##########
@@ -154,13 +154,48 @@ else()
     endif()
   endif()
 
-  install(TARGETS nanoarrow DESTINATION lib)
+  install(TARGETS nanoarrow
+          DESTINATION lib
+          EXPORT nanoarrow-exports)
+  install(TARGETS coverage_config
+          DESTINATION lib
+          EXPORT nanoarrow-exports)

Review Comment:
   That's what the 
[NAMESPACE](https://cmake.org/cmake/help/latest/command/install.html#export) is 
for, it is considered good practice to use namespaced targets like 
`nanoarrow::coverage_config` even within projects (which requires creating an 
ALIAS) but def for exported targets. We should use that here as well. 



##########
CMakeLists.txt:
##########


Review Comment:
   I don't quite understand the approach you are taking with this two step 
process. IIRC that shouldn't be necessary but I'll have to come back to this 
after going through the documentation and test some things.



##########
cmake/config.cmake.in:
##########
@@ -0,0 +1,28 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+
+@PACKAGE_INIT@
+
+cmake_minimum_required(VERSION @CMAKE_MINIMUM_REQUIRED_VERSION@)

Review Comment:
   That's probably in the fetch content version picking up 3.25 from the 
example cml due to 
   > The <min> version of CMake given to the most recent call to the 
[cmake_minimum_required(VERSION)](https://cmake.org/cmake/help/latest/command/cmake_minimum_required.html#command:cmake_minimum_required)
 command in the current variable scope or any parent variable scope.
   



##########
examples/build_tests/CMakeLists.txt:
##########
@@ -0,0 +1,50 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+message(STATUS "Building using CMake version: ${CMAKE_VERSION}")
+# Setting minimum to 3.12 for CMP0074
+cmake_minimum_required(VERSION 3.25)

Review Comment:
   This seems unnecessarily high? 3.16 should be fine or am I missing anything 
that requires 3.25? (It could confuse potential users too)



##########
examples/build_tests/src/library.c:
##########
@@ -0,0 +1,18 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#include "nanoarrow/nanoarrow.h"

Review Comment:
   I would add some minor bit of example code to both files. (no idea what 
thought ^^) This would make for a better example (e.g. custom namespace usage) 
and properly exercise linking.



-- 
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]

Reply via email to