switch to pybind11? ;-P
This is what Larry was talking about the last meeting, and in a much more concrete manner than I had babbled about in our first meeting.
I think it is a great idea to make a repo that has template cmake macros and a collection of all the Find* things we need for the various projects in ASWF. People can then request those Find* be pushed upstream to cmake, and each project can keep a stash of what the current ones they need are, and rev versions as necessary to get whatever new macros, etc. they want.
Back to your actual question, in OpenEXR, we do a very similar thing to compile for a specific python variant, except don't have a period between when asking for boost:
.... <paraphrasing a bit here>
##### NB: with a period between maj.minor
find_package(PythonLibs ${OPENEXR_PYTHON_MAJOR}.${OPENEXR_PYTHON_MINOR}
##### NB: withOUT a period between
find_package(Boost COMPONENTS python${OPENEXR_PYTHON_MAJOR}${OPENEXR_PYTHON_MINOR})
if (NOT Boost_PYTHON${OPENEXR_PYTHON_MAJOR}${OPENEXR_PYTHON_MINOR}_FOUND)
message(WARNING "requested boost python version not found...")
endif()
#####
find_package(NumPy)
....
Hope that helps,
Kimball