Skip to content

Commit

Permalink
Use upstream CMake macros to find python (#616)
Browse files Browse the repository at this point in the history
* cmake

* reformat
  • Loading branch information
makslevental authored Sep 5, 2023
1 parent 99308d3 commit 1324ced
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ set(AIE_TOOLS_BINARY_DIR ${AIE_BINARY_DIR}/bin)
find_package(Vitis 2022.2 COMPONENTS AIE AIE2)
configure_file(./utils/vitisVariables.config.in
${CMAKE_BINARY_DIR}/utils/vitisVariables.config @ONLY)
find_package(Python3 COMPONENTS Interpreter)

# Set up default Vitis Sysroot as sysroot when testing on aarch64
list(FIND AIE_RUNTIME_TARGETS "aarch64" indexAarch64)
Expand Down Expand Up @@ -148,6 +147,10 @@ if(AIE_INCLUDE_DOCS)
add_dependencies(docs mlir-doc)
endif()

# setup python
include(MLIRDetectPythonEnv)
mlir_configure_python_dev_packages()

# python install directory
if(NOT AIE_PYTHON_PACKAGES_DIR)
set(AIE_PYTHON_PACKAGES_DIR "${CMAKE_CURRENT_BINARY_DIR}/python")
Expand All @@ -158,15 +161,6 @@ if(NOT AIE_PYTHON_INSTALL_DIR)
set(AIE_PYTHON_INSTALL_DIR "python")
endif()

# setup python
find_package(
Python3
COMPONENTS Interpreter Development
REQUIRED)
include(MLIRDetectPythonEnv)
mlir_detect_pybind11_install()
find_package(pybind11 2.6 REQUIRED)

add_subdirectory(include)
add_subdirectory(lib)
add_subdirectory(python)
Expand All @@ -179,7 +173,7 @@ add_subdirectory(tools)

if(NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
install(
DIRECTORY include/aie
DIRECTORY include/aie include/aie-c
DESTINATION include
COMPONENT aie-headers
FILES_MATCHING
Expand Down

0 comments on commit 1324ced

Please sign in to comment.