Refactor/Create APT/DNF Repository (#1648)

This commit is contained in:
Paulchen-Panther
2023-11-16 21:05:56 +01:00
committed by GitHub
parent c9518db597
commit 91270966f9
165 changed files with 1918 additions and 2924 deletions

View File

@@ -1,34 +1,30 @@
# Include the python directory. Also include the parent (which is for example /usr/include)
# which may be required when it is not includes by the (cross-) compiler by default.
if (NOT CMAKE_VERSION VERSION_LESS "3.12")
find_package(Python3 COMPONENTS Interpreter Development REQUIRED)
include_directories(${Python3_INCLUDE_DIRS} ${Python3_INCLUDE_DIRS}/..)
add_compile_definitions(PYTHON_VERSION_MAJOR=${Python3_VERSION_MAJOR})
add_compile_definitions(PYTHON_VERSION_MINOR=${Python3_VERSION_MINOR})
else()
find_package (PythonLibs ${PYTHON_VERSION_STRING} EXACT) # Maps PythonLibs to the PythonInterp version of the main cmake
include_directories(${PYTHON_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS}/..)
add_definitions(-DPYTHON_VERSION_MAJOR=${PYTHON_VERSION_MAJOR})
add_definitions(-DPYTHON_VERSION_MINOR=${PYTHON_VERSION_MINOR})
endif()
# Define the current source locations
SET(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include/python)
SET(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/python)
FILE ( GLOB PYTHON_SOURCES "${CURRENT_HEADER_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.cpp" )
add_library(python
${PYTHON_SOURCES}
${CMAKE_SOURCE_DIR}/include/python/PythonInit.h
${CMAKE_SOURCE_DIR}/include/python/PythonProgram.h
${CMAKE_SOURCE_DIR}/include/python/PythonUtils.h
${CMAKE_SOURCE_DIR}/libsrc/python/PythonInit.cpp
${CMAKE_SOURCE_DIR}/libsrc/python/PythonProgram.cpp
)
if(NOT CMAKE_VERSION VERSION_LESS "3.12")
find_package(Python3 COMPONENTS Interpreter Development REQUIRED)
else()
find_package (PythonLibs ${PYTHON_VERSION_STRING} EXACT)
endif()
target_link_libraries(python
effectengine
hyperion-utils
${Python3_LIBRARIES}
${PYTHON_LIBRARIES}
)
if (NOT CMAKE_VERSION VERSION_LESS "3.12")
target_link_libraries( python ${Python3_LIBRARIES} )
else()
target_link_libraries( python ${PYTHON_LIBRARIES} )
endif()
target_include_directories(python PUBLIC
${Python3_INCLUDE_DIRS} ${Python3_INCLUDE_DIRS}/..
${PYTHON_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS}/..
)
target_compile_definitions(python PRIVATE
PYTHON_VERSION_MAJOR=$<$<BOOL:${Python3_FOUND}>:${Python3_VERSION_MAJOR}>$<$<BOOL:${PYTHONLIBS_FOUND}>:${PYTHON_VERSION_MAJOR}>
PYTHON_VERSION_MINOR=$<$<BOOL:${Python3_FOUND}>:${Python3_VERSION_MINOR}>$<$<BOOL:${PYTHONLIBS_FOUND}>:${PYTHON_VERSION_MINOR}>
)