]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
cmake: rearrange configure_file() 40869/head
authorKefu Chai <kchai@redhat.com>
Thu, 15 Apr 2021 10:46:11 +0000 (18:46 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 19 Apr 2021 04:09:32 +0000 (12:09 +0800)
commitd8a1d1f93ab3ee6505f4c48e8b27917464302a89
tree1d61c3b4807286b59f7de86407ae9b0e14efea7f
parentbcd596994f9dc2d80f09603c63a5561937bb9f20
cmake: rearrange configure_file()

AddCephTest and googletest's CMake scripts also call
find_package(Python3...), but they do not specify the required minor
version of Python3. by default, find_package(Python3...) picks the highest
available python3. so, if we have multiple python3 versions installed in the
system, and the highest python3 version is not the one specified by the
-DWITH_PYTHON3=3.x.y in the cmake command line, we might end up using a
different python3 for the ceph CLI. and even worse, the required python3
package might not available for the picked python3 interpreter found by
googletest. as, in general, only a single python3 has the full access to
prepackaged python3-* shipped by a GNU/Linux distro.

in this change, the configure_file() calls are rearranged to the top of
src/CMakeLists.txt, so they have less chance to use the "polluted" cmake
variable for their subvars.

this change address the test failure where we have, for instance, python3.8
installed on RHEL8/CentOS8, where python3.6 is the python3 which has
the access to the python3-* packages.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/CMakeLists.txt