gaborkaszab commented on code in PR #3:
URL: https://github.com/apache/iceberg-cpp/pull/3#discussion_r1867249560


##########
CMakeLists.txt:
##########
@@ -0,0 +1,63 @@
+# 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.
+
+cmake_minimum_required(VERSION 3.25)
+
+if(NOT CMAKE_BUILD_TYPE)
+  set(CMAKE_BUILD_TYPE Release)
+endif()
+
+list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules")
+
+project(
+  iceberg
+  VERSION 0.1.0
+  DESCRIPTION "Iceberg C++ Project"
+  LANGUAGES CXX)
+
+set(CMAKE_CXX_STANDARD 20)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
+set(CMAKE_CXX_EXTENSIONS OFF)
+set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
+
+option(ICEBERG_BUILD_STATIC "Build static library" ON)
+option(ICEBERG_BUILD_SHARED "Build shared library" OFF)
+option(ICEBERG_BUILD_TESTS "Build tests" ON)
+
+include(CMakePackageConfigHelpers)
+include(CMakeParseArguments)
+include(BuildUtils)
+include(ExternalProject)
+include(FindPackageHandleStandardArgs)
+include(GNUInstallDirs)
+
+set(ICEBERG_API_DIR "${CMAKE_SOURCE_DIR}/api")
+set(ICEBERG_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}")
+set(ICEBERG_INSTALL_BINDIR "${CMAKE_INSTALL_BINDIR}")
+set(ICEBERG_INSTALL_INCLUDEDIR "${CMAKE_INSTALL_INCLUDEDIR}")
+set(ICEBERG_INSTALL_CMAKEDIR "${CMAKE_INSTALL_LIBDIR}/cmake")
+set(ICEBERG_INSTALL_DOCDIR "share/doc/${PROJECT_NAME}")
+
+add_subdirectory(api)
+add_subdirectory(src)

Review Comment:
   Shouldn't we add example too as a subdirectory?



##########
CMakeLists.txt:
##########
@@ -0,0 +1,63 @@
+# 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.
+
+cmake_minimum_required(VERSION 3.25)
+
+if(NOT CMAKE_BUILD_TYPE)

Review Comment:
   I don't read CMake files regularly so I might be wrong here, but does this 
mean that in case we simply build without providing any param we get a release 
build? The other way around would be more natural for me, to get debug build by 
default and release build would require giving a param.



##########
src/core/demo_table.h:
##########
@@ -0,0 +1,34 @@
+/*
+ * 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.
+ */
+
+#pragma once
+
+#include "iceberg/table.h"

Review Comment:
   Not sure how we can set it up, but would it make sense to have an include 
like "api/table.h"? It would be more intuitive to see that this includes 
something from the API module. In another comment I also expressed that the 
api/iceberg/ subfolders seems confusing for me.



##########
src/core/icebergConfig.cmake.in:
##########
@@ -0,0 +1,22 @@
+# 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.
+#

Review Comment:
   The name of this file is icebergConfig.cmake.in and in the puffin/ folder we 
have puffinConfig.cmake.in Wouldn't it make sense to name this to 
coreConfig.cmake.in to keep consistency?



##########
CMakeLists.txt:
##########
@@ -0,0 +1,63 @@
+# 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.
+
+cmake_minimum_required(VERSION 3.25)
+
+if(NOT CMAKE_BUILD_TYPE)
+  set(CMAKE_BUILD_TYPE Release)
+endif()
+
+list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules")
+
+project(
+  iceberg
+  VERSION 0.1.0
+  DESCRIPTION "Iceberg C++ Project"
+  LANGUAGES CXX)
+
+set(CMAKE_CXX_STANDARD 20)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
+set(CMAKE_CXX_EXTENSIONS OFF)
+set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
+
+option(ICEBERG_BUILD_STATIC "Build static library" ON)
+option(ICEBERG_BUILD_SHARED "Build shared library" OFF)
+option(ICEBERG_BUILD_TESTS "Build tests" ON)
+
+include(CMakePackageConfigHelpers)
+include(CMakeParseArguments)
+include(BuildUtils)
+include(ExternalProject)
+include(FindPackageHandleStandardArgs)
+include(GNUInstallDirs)
+
+set(ICEBERG_API_DIR "${CMAKE_SOURCE_DIR}/api")

Review Comment:
   I'm not sure which config controls this but I built the project locally and 
I see that there are generated files all over the place next to the source 
files. I think it would be way cleaner to put these files into a build/ or such 
folder.
   I'm open to where this build/ folder should live. The Java code is 
structured a bit differently as I see, they have for instance:
   ```
   api/
       - build/
       - src/
   core/
       - build/
       - src/
   ...
   ```
   We decided to follow a bit different structure, so following that logic we 
could have the build/ folder on the top level next to test/, src/ and such.
   And then build/ could still have subfolders for the different modules.
   What do you think?
   



##########
api/CMakeLists.txt:
##########
@@ -0,0 +1,22 @@
+# 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.
+
+install(
+  DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/iceberg"

Review Comment:
   I see there is an iceberg/ subfolder within the api/ folder. I don't see the 
reason to have that extra layer. Do we expect other subfolders within api/ ?



##########
cmake_modules/BuildUtils.cmake:
##########
@@ -0,0 +1,212 @@
+# 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.
+
+# Borrowed the file from Apache Arrow:
+# https://github.com/apache/arrow/blob/main/cpp/cmake_modules/BuildUtils.cmake
+
+function(iceberg_install_cmake_package PACKAGE_NAME EXPORT_NAME)

Review Comment:
   I now realise that my CMake skills aren't as great TBH :)
   This seems a lot of code, so my question is do we need all of this to 
kickstart the project? Additionally, could you help me understand the purpose 
of all these?



##########
example/CMakeLists.txt:
##########
@@ -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.
+
+# Please set CMAKE_PREFIX_PATH to the install prefix of iceberg.
+cmake_minimum_required(VERSION 3.25)
+
+project(demo_example)

Review Comment:
   I think the name of the project should follow the name of the folder for 
more clarity. 'example' instead of 'demo_example'.



##########
README.md:
##########
@@ -21,6 +21,11 @@
 
 C++ implementation of [Apache Iceberg™](https://iceberg.apache.org/).
 
+## Requirements

Review Comment:
   The Readme for the Java project gives basic instruction on how to build the 
project, how to build sub-projects, how to run tests, etc. I think it would be 
useful here too to have something similar for anyone that gets going on the 
project.
   See: https://github.com/apache/iceberg



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to