You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datasketches.apache.org by jm...@apache.org on 2019/06/20 23:24:03 UTC

[incubator-datasketches-cpp] 01/01: cmake cleanup, mostly changing HLL to an interface library

This is an automated email from the ASF dual-hosted git repository.

jmalkin pushed a commit to branch hll_as_interface
in repository https://gitbox.apache.org/repos/asf/incubator-datasketches-cpp.git

commit 89f26a68c88555420f594b3c329298a5490aae92
Author: jmalkin <jm...@users.noreply.github.com>
AuthorDate: Thu Jun 20 16:23:43 2019 -0700

    cmake cleanup, mostly changing HLL to an interface library
---
 fi/CMakeLists.txt  |   5 +--
 hll/CMakeLists.txt | 107 +++++++++++++++++++++++++++++------------------------
 kll/CMakeLists.txt |   5 +--
 setup.py           |   1 -
 4 files changed, 61 insertions(+), 57 deletions(-)

diff --git a/fi/CMakeLists.txt b/fi/CMakeLists.txt
index 42c3929..0eb913c 100644
--- a/fi/CMakeLists.txt
+++ b/fi/CMakeLists.txt
@@ -15,10 +15,7 @@ target_include_directories(fi
 )
 
 target_link_libraries(fi INTERFACE common)
-
-set_target_properties(fi PROPERTIES
-  INTERFACE_COMPILE_FEATURES cxx_std_11
-)
+target_compile_features(fi INTERFACE cxx_std_11)
 
 set(fi_HEADERS "include/frequent_items_sketch.hpp;include/reverse_purge_hash_map.hpp")
 
diff --git a/hll/CMakeLists.txt b/hll/CMakeLists.txt
index e75d466..283425e 100644
--- a/hll/CMakeLists.txt
+++ b/hll/CMakeLists.txt
@@ -1,4 +1,4 @@
-add_library(hll OBJECT "")
+add_library(hll INTERFACE)
 
 add_library(${PROJECT_NAME}::HLL ALIAS hll)
 
@@ -7,7 +7,7 @@ if (BUILD_TESTS)
 endif()
 
 target_include_directories(hll
-  PUBLIC
+  INTERFACE
     $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
     $<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>
   PRIVATE 
@@ -15,59 +15,70 @@ target_include_directories(hll
 )
 
 target_link_libraries(hll INTERFACE common)
+target_compile_features(hll INTERFACE cxx_std_11)
 
-set_target_properties(hll PROPERTIES
-  PUBLIC_HEADER "include/hll.hpp"
-  POSITION_INDEPENDENT_CODE ON
-  CXX_STANDARD 11
-  CXX_STANDARD_REQUIRED YES
-)
+# TODO: would be useful if this didn't need to be reproduced in target_sources(), too
+set(hll_HEADERS "")
+list(APPEND hll_HEADERS "include/hll.hpp;include/AuxHashMap.hpp;include/CompositeInterpolationXTable.hpp")
+list(APPEND hll_HEADERS "include/Conversions.hpp;include/CouponHashSet.hpp;include/CouponList.hpp")
+list(APPEND hll_HEADERS "include/CubicInterpolation.hpp;include/HarmonicNumbers.hpp;include/Hll4Array.hpp")
+list(APPEND hll_HEADERS "include/Hll6Array.hpp;include/Hll8Array.hpp;include/HllArray.hpp")
+list(APPEND hll_HEADERS "include/HllPairIterator.hpp;include/HllSketch.hpp;include/HllSketchImpl.hpp")
+list(APPEND hll_HEADERS "include/HllUnion.hpp;include/HllUtil.hpp;include/IntArrayPairIterator.hpp")
+list(APPEND hll_HEADERS "include/PairIterator.hpp;include/RelativeErrorTables.hpp;include/AuxHashMap-internal.hpp")
+list(APPEND hll_HEADERS "include/CompositeInterpolationXTable-internal.hpp;include/Conversions-internal.hpp")
+list(APPEND hll_HEADERS "include/CouponHashSet-internal.hpp;include/CouponList-internal.hpp")
+list(APPEND hll_HEADERS "include/CubicInterpolation-internal.hpp;include/HarmonicNumbers-internal.hpp")
+list(APPEND hll_HEADERS "include/Hll4Array-internal.hpp;include/Hll6Array-internal.hpp")
+list(APPEND hll_HEADERS "include/Hll8Array-internal.hpp;include/HllArray-internal.hpp")
+list(APPEND hll_HEADERS "include/HllPairIterator-internal.hpp;include/HllSketch-internal.hpp")
+list(APPEND hll_HEADERS "include/HllSketchImpl-internal.hpp;include/HllUnion-internal.hpp")
+list(APPEND hll_HEADERS "include/IntArrayPairIterator-internal.hpp;include/RelativeErrorTables-internal.hpp")
 
 install(TARGETS hll
   EXPORT ${PROJECT_NAME}
-  PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/DataSketches
-  INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/DataSketches
 )
 
+install(FILES ${hll_HEADERS}
+  DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/DataSketches")
+
 target_sources(hll
   INTERFACE
     ${CMAKE_CURRENT_SOURCE_DIR}/include/hll.hpp
-  PRIVATE
-    include/AuxHashMap.hpp
-    include/CompositeInterpolationXTable.hpp
-    include/Conversions.hpp
-    include/CouponHashSet.hpp
-    include/CouponList.hpp
-    include/CubicInterpolation.hpp
-    include/HarmonicNumbers.hpp
-    include/Hll4Array.hpp
-    include/Hll6Array.hpp
-    include/Hll8Array.hpp
-    include/HllArray.hpp
-    include/HllPairIterator.hpp
-    include/HllSketch.hpp
-    include/HllSketchImpl.hpp
-    include/HllUnion.hpp
-    include/HllUtil.hpp
-    include/IntArrayPairIterator.hpp
-    include/PairIterator.hpp
-    include/RelativeErrorTables.hpp
-    include/AuxHashMap-internal.hpp
-    include/CompositeInterpolationXTable-internal.hpp
-    include/Conversions-internal.hpp
-    include/CouponHashSet-internal.hpp
-    include/CouponList-internal.hpp
-    include/CubicInterpolation-internal.hpp
-    include/HarmonicNumbers-internal.hpp
-    include/Hll4Array-internal.hpp
-    include/Hll6Array-internal.hpp
-    include/Hll8Array-internal.hpp
-    include/HllArray-internal.hpp
-    include/HllPairIterator-internal.hpp
-    include/HllSketch-internal.hpp
-    include/HllSketchImpl-internal.hpp
-    include/HllUnion-internal.hpp
-    include/IntArrayPairIterator-internal.hpp
-    include/RelativeErrorTables-internal.hpp
-
+    ${CMAKE_CURRENT_SOURCE_DIR}/include/AuxHashMap.hpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/include/CompositeInterpolationXTable.hpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/include/Conversions.hpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/include/CouponHashSet.hpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/include/CouponList.hpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/include/CubicInterpolation.hpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/include/HarmonicNumbers.hpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/include/Hll4Array.hpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/include/Hll6Array.hpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/include/Hll8Array.hpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/include/HllArray.hpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/include/HllPairIterator.hpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/include/HllSketch.hpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/include/HllSketchImpl.hpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/include/HllUnion.hpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/include/HllUtil.hpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/include/IntArrayPairIterator.hpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/include/PairIterator.hpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/include/RelativeErrorTables.hpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/include/AuxHashMap-internal.hpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/include/CompositeInterpolationXTable-internal.hpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/include/Conversions-internal.hpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/include/CouponHashSet-internal.hpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/include/CouponList-internal.hpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/include/CubicInterpolation-internal.hpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/include/HarmonicNumbers-internal.hpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/include/Hll4Array-internal.hpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/include/Hll6Array-internal.hpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/include/Hll8Array-internal.hpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/include/HllArray-internal.hpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/include/HllPairIterator-internal.hpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/include/HllSketch-internal.hpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/include/HllSketchImpl-internal.hpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/include/HllUnion-internal.hpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/include/IntArrayPairIterator-internal.hpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/include/RelativeErrorTables-internal.hpp
 )
diff --git a/kll/CMakeLists.txt b/kll/CMakeLists.txt
index 662d7a2..42aafd9 100644
--- a/kll/CMakeLists.txt
+++ b/kll/CMakeLists.txt
@@ -15,10 +15,7 @@ target_include_directories(kll
 )
 
 target_link_libraries(kll INTERFACE common)
-
-set_target_properties(kll PROPERTIES
-  INTERFACE_COMPILE_FEATURES cxx_std_11
-)
+target_compile_features(kll INTERFACE cxx_std_11)
 
 set(kll_HEADERS "include/kll_sketch.hpp;include/kll_helper.hpp;include/kll_quantile_calculator.hpp")
 
diff --git a/setup.py b/setup.py
index 50ff70d..ed9b778 100644
--- a/setup.py
+++ b/setup.py
@@ -80,7 +80,6 @@ setup(
     # likely need to add all source paths for proper sdist packages
     ext_modules=[CMakeExtension('datasketches')],
     # add custom build_ext command
-    # cmdclass=dict(build_ext=CMakeBuild)
     cmdclass={'build_ext': CMakeBuild},
     zip_safe=False
 )


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org