2016-05-26 23:44:27 +02:00
|
|
|
# Define the current source locations
|
2016-11-26 22:34:46 +01:00
|
|
|
|
2020-11-14 16:34:31 +01:00
|
|
|
# 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_MINOR=${Python3_VERSION_MAJOR}${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_MINOR=${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR})
|
|
|
|
endif()
|
|
|
|
|
2016-05-26 23:44:27 +02:00
|
|
|
SET(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include/utils)
|
|
|
|
SET(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/utils)
|
|
|
|
|
2017-08-04 23:08:15 +02:00
|
|
|
FILE ( GLOB_RECURSE Utils_SOURCES "${CURRENT_HEADER_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.cpp" )
|
2016-05-26 23:44:27 +02:00
|
|
|
|
2017-08-04 23:08:15 +02:00
|
|
|
if ( NOT ENABLE_PROFILER )
|
|
|
|
LIST ( REMOVE_ITEM Utils_SOURCES ${CURRENT_HEADER_DIR}/Profiler.h ${CURRENT_SOURCE_DIR}/Profiler.cpp )
|
2016-11-26 22:34:46 +01:00
|
|
|
endif()
|
|
|
|
|
|
|
|
add_library(hyperion-utils
|
|
|
|
${Utils_SOURCES}
|
|
|
|
)
|
|
|
|
|
2016-05-26 23:44:27 +02:00
|
|
|
target_link_libraries(hyperion-utils
|
2017-08-01 15:42:36 +02:00
|
|
|
hyperion
|
2020-11-14 16:34:31 +01:00
|
|
|
python
|
2021-11-16 18:12:56 +01:00
|
|
|
Qt${QT_VERSION_MAJOR}::Core
|
|
|
|
Qt${QT_VERSION_MAJOR}::Gui
|
|
|
|
Qt${QT_VERSION_MAJOR}::Network
|
2017-08-01 15:42:36 +02:00
|
|
|
)
|