kou commented on code in PR #1889:
URL: https://github.com/apache/orc/pull/1889#discussion_r1566550570
##########
c++/CMakeLists.txt:
##########
@@ -15,14 +15,26 @@
# specific language governing permissions and limitations
# under the License.
-include_directories (
- ${CMAKE_CURRENT_BINARY_DIR}/include
- "include"
- )
-
add_subdirectory(include)
add_subdirectory(src)
if (BUILD_CPP_TESTS)
add_subdirectory(test)
endif ()
+
+# Generate cmake package configuration files
+include(GNUInstallDirs)
+set(INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR}
+ CACHE PATH "Location of header files")
Review Comment:
In general, we don't need to define our version of
`CMAKE_INSTALL_INCLUDEDIR`.
We can just use `CMAKE_INSTALL_INCLUDEDIR`. Most packaging systems including
RPM specifies `CMAKE_INSTALL_INCLUDEDIR` automatically.
##########
c++/orcConfig.cmake.in:
##########
@@ -0,0 +1,29 @@
+# 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.
+#
+# This config sets the following variables in your project
+#
+# orc_FOUND - true if orc is found on the system
+# orc_VERSION - version of the found Orc
+# orc_INCLUDE_DIR - where to find the Orc headers
+
+@PACKAGE_INIT@
+
+set(orc_VERSION "@ORC_VERSION@")
Review Comment:
We don't need this because `write_basic_package_version_file()` does this
automatically.
##########
c++/orcConfig.cmake.in:
##########
@@ -0,0 +1,29 @@
+# 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.
+#
+# This config sets the following variables in your project
+#
+# orc_FOUND - true if orc is found on the system
+# orc_VERSION - version of the found Orc
+# orc_INCLUDE_DIR - where to find the Orc headers
+
+@PACKAGE_INIT@
+
+set(orc_VERSION "@ORC_VERSION@")
+set_and_check(orc_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@")
Review Comment:
We don't need this. We should provide `orc::orc` target instead.
If we provide `orc::orc` target, users can link to `liborc.*` by
`target_link_libraries(user_target orc::orc)`.
--
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]