Commit 93b63e8
authored
ARROW-12175: [C++] Fix CMake packages (apache#13892)
ARROW-9171 and ARROW-17231 are also fixed.
Our CMake packages are broken. For example, `find_package(Parquet)`
doesn't work without specifying `CMAKE_MODULE_PATH`.
`find_package(${PACKAGE})` searches
`${PREFIX}/${PACKAGE}/${PACKAGE}Config.cmake` or
`${PREFIX}/${PACKAGE}/Find${PACKAGE}.cmake`. But our .cmake files are
always installed `${PREFIX}/arrow/`. So `find_package(Parquet)` can't find
`${PREFIX}/arrow/FindParquet.cmake` because "`/arrow/`" isn't
"`/${PACKAGE}`".
This change fixes this by installing `${PACKAGE}Config.cmake` to
`${PREFIX}/${PACKAGE}/` instead of `${PREFIX}/arrow/`.
This also removes all `Find${PACKAGE}.cmake`. We only provides
`${PACKAGE}Config.cmake`. Our `Find${PACKAGE}.cmake` can find `${PACKAGE}`
by CMake, pkg-config or manual .so/.h search. But we don't need to
support pkg-config nor manual .so/.h search. We can use
`${PACKAGE}Config.cmake` to support CMake package search. So this
removes all `Find${PACKAGE}.cmake`.
This also introduces namespace to our CMake targets. For example,
`arrow_shared` is exported as `Arrow::arrow_shared` and
`parquet_static` is exported as `Parquet::parquet_static`. But no
namespace targets such as `arrow_shared` and `parquet_static` are
still also exported for keeping backward compatibility. But this
requires CMake 3.18 or later for users because `add_library(ALIAS)`
for non-global `IMPORTED` library is available since CMake 3.18.
(`Plasma::plasma-store-server` target is also added for
`plasma-store-server` executable.)
FYI: We can resolve this problem by using `COMPONENTS` feature of
`find_package()`. For example, `find_package(Arrow COMPONENTS
Parquet)` is used instead of `find_package(Parquet)`. With
`COMPONENTS`, `${PACKAGE}` is always "Arrow". So we can still install
our .cmake files to `${PREFIX}/arrow/`. But this approach breaks
backward compatibility. So I choose `${PREFIX}/${PACKAGE}/*.cmake`
approach.
Authored-by: Sutou Kouhei <kou@clear-code.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>1 parent b43c6f6 commit 93b63e8
85 files changed
Lines changed: 761 additions & 2214 deletions
File tree
- ci/scripts
- cpp
- cmake_modules
- examples
- minimal_build
- parquet/parquet_arrow
- src
- arrow
- dataset
- engine
- flight
- sql
- transport/ucx
- gpu
- gandiva
- parquet
- plasma
- dev
- archery/archery/utils
- release
- tasks
- conda-recipes/arrow-cpp
- homebrew-formulae
- linux-packages/apache-arrow
- debian
- yum
- python
- examples/minimal_build
- pyarrow/src
- r
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
161 | | - | |
| 161 | + | |
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
156 | | - | |
| 156 | + | |
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| 116 | + | |
116 | 117 | | |
117 | 118 | | |
118 | 119 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
| 125 | + | |
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| |||
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | 151 | | |
176 | 152 | | |
177 | 153 | | |
| |||
719 | 695 | | |
720 | 696 | | |
721 | 697 | | |
722 | | - | |
| 698 | + | |
| 699 | + | |
723 | 700 | | |
724 | 701 | | |
725 | 702 | | |
726 | 703 | | |
727 | | - | |
| 704 | + | |
728 | 705 | | |
729 | 706 | | |
730 | 707 | | |
731 | 708 | | |
732 | 709 | | |
733 | | - | |
| 710 | + | |
734 | 711 | | |
735 | 712 | | |
736 | 713 | | |
737 | 714 | | |
738 | 715 | | |
739 | 716 | | |
740 | 717 | | |
741 | | - | |
| 718 | + | |
742 | 719 | | |
743 | 720 | | |
744 | 721 | | |
| |||
781 | 758 | | |
782 | 759 | | |
783 | 760 | | |
784 | | - | |
| 761 | + | |
785 | 762 | | |
786 | 763 | | |
787 | 764 | | |
| |||
790 | 767 | | |
791 | 768 | | |
792 | 769 | | |
793 | | - | |
| 770 | + | |
794 | 771 | | |
795 | 772 | | |
796 | 773 | | |
797 | 774 | | |
798 | 775 | | |
799 | 776 | | |
800 | 777 | | |
801 | | - | |
| 778 | + | |
802 | 779 | | |
803 | 780 | | |
804 | 781 | | |
| |||
807 | 784 | | |
808 | 785 | | |
809 | 786 | | |
810 | | - | |
| 787 | + | |
811 | 788 | | |
812 | 789 | | |
813 | 790 | | |
814 | 791 | | |
815 | 792 | | |
816 | | - | |
| 793 | + | |
817 | 794 | | |
818 | 795 | | |
819 | 796 | | |
| |||
836 | 813 | | |
837 | 814 | | |
838 | 815 | | |
839 | | - | |
| 816 | + | |
840 | 817 | | |
841 | 818 | | |
842 | 819 | | |
843 | 820 | | |
844 | 821 | | |
845 | 822 | | |
846 | 823 | | |
847 | | - | |
| 824 | + | |
848 | 825 | | |
849 | 826 | | |
850 | 827 | | |
851 | 828 | | |
852 | 829 | | |
853 | 830 | | |
854 | 831 | | |
855 | | - | |
| 832 | + | |
856 | 833 | | |
857 | 834 | | |
858 | 835 | | |
859 | 836 | | |
860 | | - | |
| 837 | + | |
861 | 838 | | |
862 | 839 | | |
863 | 840 | | |
| |||
884 | 861 | | |
885 | 862 | | |
886 | 863 | | |
887 | | - | |
888 | | - | |
| 864 | + | |
889 | 865 | | |
890 | 866 | | |
891 | 867 | | |
| |||
901 | 877 | | |
902 | 878 | | |
903 | 879 | | |
904 | | - | |
905 | | - | |
| 880 | + | |
| 881 | + | |
906 | 882 | | |
907 | | - | |
908 | | - | |
| 883 | + | |
| 884 | + | |
909 | 885 | | |
910 | 886 | | |
911 | 887 | | |
| |||
945 | 921 | | |
946 | 922 | | |
947 | 923 | | |
948 | | - | |
| 924 | + | |
949 | 925 | | |
950 | 926 | | |
951 | 927 | | |
952 | 928 | | |
953 | 929 | | |
954 | | - | |
| 930 | + | |
955 | 931 | | |
956 | 932 | | |
957 | 933 | | |
| |||
975 | 951 | | |
976 | 952 | | |
977 | 953 | | |
978 | | - | |
| 954 | + | |
979 | 955 | | |
980 | 956 | | |
981 | 957 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
| 76 | + | |
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
143 | 145 | | |
144 | 146 | | |
145 | 147 | | |
146 | 148 | | |
147 | | - | |
148 | | - | |
149 | | - | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
150 | 170 | | |
151 | 171 | | |
152 | 172 | | |
| |||
247 | 267 | | |
248 | 268 | | |
249 | 269 | | |
250 | | - | |
251 | | - | |
252 | | - | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
253 | 281 | | |
254 | 282 | | |
255 | 283 | | |
| |||
309 | 337 | | |
310 | 338 | | |
311 | 339 | | |
312 | | - | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
317 | 343 | | |
318 | 344 | | |
319 | 345 | | |
| |||
394 | 420 | | |
395 | 421 | | |
396 | 422 | | |
397 | | - | |
398 | | - | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
399 | 426 | | |
400 | 427 | | |
401 | 428 | | |
| |||
422 | 449 | | |
423 | 450 | | |
424 | 451 | | |
425 | | - | |
426 | | - | |
427 | | - | |
428 | | - | |
429 | | - | |
430 | | - | |
431 | | - | |
432 | | - | |
433 | | - | |
434 | | - | |
435 | | - | |
436 | | - | |
437 | | - | |
438 | | - | |
439 | | - | |
440 | | - | |
441 | | - | |
442 | | - | |
443 | | - | |
444 | | - | |
| 452 | + | |
445 | 453 | | |
446 | 454 | | |
447 | 455 | | |
| |||
906 | 914 | | |
907 | 915 | | |
908 | 916 | | |
909 | | - | |
910 | | - | |
911 | | - | |
912 | | - | |
913 | | - | |
914 | 917 | | |
915 | 918 | | |
916 | 919 | | |
| |||
0 commit comments