From a1aab81d112cacc91672bc8e2a0900d880c652d2 Mon Sep 17 00:00:00 2001 From: Florent Collot Date: Fri, 28 Apr 2023 14:30:46 +0200 Subject: [PATCH 1/2] Fix library path bugs following reviews --- config/pyncppConfig.cmake.in | 1 + pyncpp/CMakeLists.txt | 4 ++++ python/CMakeLists.txt | 5 +++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/config/pyncppConfig.cmake.in b/config/pyncppConfig.cmake.in index 339e8d5..b504114 100644 --- a/config/pyncppConfig.cmake.in +++ b/config/pyncppConfig.cmake.in @@ -24,6 +24,7 @@ if(pyncpp_FIND_REQUIRED_CPP_API) endif() set(pyncpp_PYTHON_DIR @PACKAGE_PYNCPP_PYTHON_DIR@) +set(pyncpp_PYTHON_INSTALL_DESTINATION @PYNCPP_PYTHON_INSTALL_DESTINATION@) if(NOT TARGET pyncpp_python_executable) if(UNIX) diff --git a/pyncpp/CMakeLists.txt b/pyncpp/CMakeLists.txt index 543dd40..54506d8 100644 --- a/pyncpp/CMakeLists.txt +++ b/pyncpp/CMakeLists.txt @@ -40,6 +40,10 @@ if(PYNCPP_QT5_SUPPORT) list(APPEND cmake_args -D "Qt5_DIR:PATH=${Qt5_DIR}") endif() +if(UNIX AND NOT APPLE) + list(APPEND cmake_args -D "CMAKE_INSTALL_RPATH:PATH=\$ORIGIN/../${PYNCPP_PYTHON_INSTALL_DESTINATION}") +endif() + set(prefix "${CMAKE_CURRENT_BINARY_DIR}") ################################################################################ diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index f85e489..2559f0e 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -10,14 +10,15 @@ set(PYNCPP_PYTHON_SHORT_VERSION ${PYNCPP_PYTHON_SHORT_VERSION} PARENT_SCOPE) set(PYNCPP_PYTHON_VERSION "${PYNCPP_PYTHON_SHORT_VERSION}.${PYNCPP_PYTHON_VERSION_PATCH}") set(PYNCPP_PYTHON_VERSION ${PYNCPP_PYTHON_VERSION} PARENT_SCOPE) -set(PYNCPP_PYTHON_DIR "${PROJECT_BINARY_DIR}/python${PYNCPP_PYTHON_SHORT_VERSION}" CACHE PATH "") - if(WIN32) set(PYNCPP_PYTHON_INSTALL_DESTINATION "bin" CACHE STRING "") else() set(PYNCPP_PYTHON_INSTALL_DESTINATION "lib/python${PYNCPP_PYTHON_SHORT_VERSION}" CACHE STRING "") endif() +set(PYNCPP_PYTHON_DIR "${PROJECT_BINARY_DIR}/${PYNCPP_PYTHON_INSTALL_DESTINATION}") +set(PYNCPP_PYTHON_DIR "${PYNCPP_PYTHON_DIR}" PARENT_SCOPE) + set(prefix "${CMAKE_CURRENT_BINARY_DIR}") set(download_dir "${prefix}/download") set(source_dir "${prefix}/source") From 34a5e0ea855900fe2b2631f0462dd93fc8023842 Mon Sep 17 00:00:00 2001 From: Florent Collot Date: Wed, 3 May 2023 11:17:23 +0200 Subject: [PATCH 2/2] More fixes and make examples work again --- CMakeLists.txt | 33 ++--- examples/CMakeLists.txt | 89 ++++++------- examples/qt_console/CMakeLists.txt | 118 ------------------ examples/qt_console/application.cpp | 16 --- examples/qt_console/application.h | 20 --- examples/qt_console/main.cpp | 42 ------- examples/source/CMakeLists.txt | 72 +++++++++++ examples/source/qt_application/CMakeLists.txt | 48 +++++++ examples/source/qt_application/main.cpp | 41 ++++++ pyncpp/CMakeLists.txt | 12 +- pyncpp/source/CMakeLists.txt | 2 - 11 files changed, 210 insertions(+), 283 deletions(-) delete mode 100644 examples/qt_console/CMakeLists.txt delete mode 100644 examples/qt_console/application.cpp delete mode 100644 examples/qt_console/application.h delete mode 100644 examples/qt_console/main.cpp create mode 100644 examples/source/CMakeLists.txt create mode 100644 examples/source/qt_application/CMakeLists.txt create mode 100644 examples/source/qt_application/main.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 6cdd590..7c1a076 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -73,37 +73,24 @@ if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE RelWithDebInfo) endif() -option(PYNCPP_BUILD_EXAMPLES "Build example project" OFF) +option(PYNCPP_QT5_SUPPORT "Include support for Qt5." ON) ################################################################################ -# Subdirectories +# Dependencies ################################################################################ -add_subdirectory(python) -add_subdirectory(pyncpp) -add_subdirectory(config) +if(PYNCPP_QT5_SUPPORT) + find_package(Qt5 REQUIRED COMPONENTS Core Widgets) +endif() ################################################################################ -# Examples +# Subdirectories ################################################################################ -if(PYNCPP_BUILD_EXAMPLES) - ExternalProject_Add(pyncpp_examples - DEPENDS pyncpp - DOWNLOAD_COMMAND "" - INSTALL_COMMAND "" - CMAKE_ARGS - -D "CMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}" - -D "PYNCPP_DIR:PATH=${PROJECT_BINARY_DIR}" - -D "PYNCPP_VERSION:STRING=${PYNCPP_VERSION}" - SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/examples" - DOWNLOAD_DIR "${CMAKE_CURRENT_BINARY_DIR}/examples/download" - BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/examples" - INSTALL_DIR "${CMAKE_CURRENT_BINARY_DIR}/examples/install" - STAMP_DIR "${CMAKE_CURRENT_BINARY_DIR}/examples/stamp" - TMP_DIR "${CMAKE_CURRENT_BINARY_DIR}/examples/tmp" - ) -endif() +add_subdirectory(python) +add_subdirectory(pyncpp) +add_subdirectory(config) +add_subdirectory(examples) ################################################################################ # Install diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 3247111..c0e22c0 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,79 +1,66 @@ # Copyright (c) 2022-2023 IHU Liryc, Université de Bordeaux, Inria. # License: BSD-3-Clause -cmake_minimum_required(VERSION 3.19) - -cmake_policy(SET CMP0011 NEW) # Policy PUSH/POP in included scripts -cmake_policy(SET CMP0048 NEW) # Project command manages version variables -cmake_policy(SET CMP0057 NEW) # IN_LIST operator -cmake_policy(SET CMP0068 NEW) # RPATH settings on macOS do not affect install_name - -################################################################################ -# Project -################################################################################ - -project(pyncpp_examples VERSION "${PYNCPP_VERSION}") - ################################################################################ # Settings ################################################################################ -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_STANDARD_REQUIRED ON) - -if(CMAKE_CONFIGURATION_TYPES) - foreach(config ${CMAKE_CONFIGURATION_TYPES}) - set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_${config} ${PROJECT_BINARY_DIR}/${config}/bin) - set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_${config} ${PROJECT_BINARY_DIR}/${config}/lib) - endforeach() -else() - if(NOT DEFINED CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE RelWithDebInfo) - endif() - - set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/bin) - set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/lib) -endif() +option(PYNCPP_BUILD_EXAMPLES "Build example project" OFF) if(APPLE) - option(PYNCPP_EXAMPLES_FRAMEWORKS "Build frameworks." ON) + option(PYNCPP_EXAMPLES_FRAMEWORKS "Build examples as frameworks." ON) endif() ################################################################################ # Dependencies ################################################################################ -find_package(PYNCPP REQUIRED COMPONENTS Qt5) - -if(PYNCPP_Qt5_FOUND) +if(PYNCPP_QT5_SUPPORT) find_package(Qt5 REQUIRED COMPONENTS Core Widgets) - get_target_property(_qmake_executable Qt5::qmake IMPORTED_LOCATION) - get_filename_component(_qt_bin_dir "${_qmake_executable}" DIRECTORY) - find_program(MACDEPLOYQT_EXECUTABLE macdeployqt HINTS "${_qt_bin_dir}") endif() ################################################################################ -# Subdirectories +# Configuration ################################################################################ -if(PYNCPP_Qt5_FOUND) - add_subdirectory(qt_console) +set(cmake_args + -D "CMAKE_MINIMUM_REQUIRED_VERSION:STRING=${CMAKE_MINIMUM_REQUIRED_VERSION}" + -D "CMAKE_BUILD_TYPE:PATH=${CMAKE_BUILD_TYPE}" + -D "CMAKE_CXX_STANDARD:STRING=${CMAKE_CXX_STANDARD}" + -D "CMAKE_CXX_STANDARD_REQUIRED:BOOL=${CMAKE_CXX_STANDARD_REQUIRED}" + -D "CMAKE_INSTALL_PREFIX:PATH=" + -D "CMAKE_MAKE_PROGRAM:PATH=${CMAKE_MAKE_PROGRAM}" + -D "pyncpp_DIR:PATH=${PROJECT_BINARY_DIR}" + -D "PYNCPP_VERSION_MAJOR:STRING=${PYNCPP_VERSION_MAJOR}" + -D "PYNCPP_VERSION_MINOR:STRING=${PYNCPP_VERSION_MINOR}" + -D "PYNCPP_VERSION_PATCH:STRING=${PYNCPP_VERSION_PATCH}" + -D "PYNCPP_EXAMPLES_FRAMEWORKS:BOOL=${PYNCPP_EXAMPLES_FRAMEWORKS}" + ) + +if(PYNCPP_QT5_SUPPORT) + list(APPEND cmake_args -D "Qt5_DIR:PATH=${Qt5_DIR}") endif() +set(prefix "${CMAKE_CURRENT_BINARY_DIR}") + ################################################################################ -# Install/packaging +# External project ################################################################################ -if(NOT PYNCPP_EXAMPLES_FRAMEWORKS) - PYNCPP_install_python_modules() - - set(CPACK_BUNDLE_NAME ${PROJECT_NAME}) +ExternalProject_Add(pyncpp_examples + PREFIX "${prefix}" + DOWNLOAD_DIR "${prefix}/download" + SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/source" + BINARY_DIR "${prefix}/build" + STAMP_DIR "${prefix}/stamp" + TMP_DIR "${prefix}/tmp" + INSTALL_DIR "${PROJECT_BINARY_DIR}" + DEPENDS pyncpp + CMAKE_ARGS ${cmake_args} + ) - set(CPACK_INSTALL_CMAKE_PROJECTS - "${CMAKE_CURRENT_BINARY_DIR};examples;ALL;/" - "${PYNCPP_DIR};pyncpp;ALL;/" - ${CPACK_INSTALL_CMAKE_PROJECTS} - ) -endif() +################################################################################ +# Install +################################################################################ -include(CPack) +install(SCRIPT "${prefix}/build/cmake_install.cmake") diff --git a/examples/qt_console/CMakeLists.txt b/examples/qt_console/CMakeLists.txt deleted file mode 100644 index 8e0b0cb..0000000 --- a/examples/qt_console/CMakeLists.txt +++ /dev/null @@ -1,118 +0,0 @@ -# Copyright (c) 2022-2023 IHU Liryc, Université de Bordeaux, Inria. -# License: BSD-3-Clause - -set(TARGET_NAME qt_console) - -################################################################################ -# Executable -################################################################################ - -add_executable(${TARGET_NAME} - main.cpp - application.h - application.cpp - ) - -if(APPLE) - if(PYNCPP_EXAMPLES_FRAMEWORKS) - set_target_properties(${TARGET_NAME} PROPERTIES - MACOSX_BUNDLE TRUE - ) - else() - set_target_properties(${TARGET_NAME} PROPERTIES - INSTALL_RPATH "@executable_path/../lib") - endif() -elseif(UNIX) - set_target_properties(${TARGET_NAME} PROPERTIES - INSTALL_RPATH "\${ORIGIN}/../lib") -endif() - -################################################################################ -# Path config file -################################################################################ - -PYNCPP_target_create_path_config_file(${TARGET_NAME}) - -################################################################################ -# Link -################################################################################ - -target_link_libraries(${TARGET_NAME} PUBLIC - pyncpp - Qt5::Core - Qt5::Widgets - ) - -################################################################################ -# Additional Python modules -################################################################################ - -PYNCPP_add_python_modules(${TARGET_NAME}_python_modules pip_install_test) - -################################################################################ -# Install -################################################################################ - -if(PYNCPP_EXAMPLES_FRAMEWORKS) - install(TARGETS ${TARGET_NAME} - BUNDLE - DESTINATION bin - COMPONENT ${TARGET_NAME} - EXCLUDE_FROM_ALL - ) - - set(_bundle_install_path "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/bin/${TARGET_NAME}.app") - set(_stdlib_destination "bin/${TARGET_NAME}.app/Contents/Resources") - set(_stdlib_install_path "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${_stdlib_destination}") - set(_pth_file "${_bundle_install_path}/Contents/MacOS/${TARGET_NAME}._pth") - - PYNCPP_get_python_path_config(_python_paths - EXECUTABLE_PATH "${_bundle_install_path}/Contents/MacOS" - STDLIB_PATH "${_stdlib_install_path}" - ) - - install(CODE " - execute_process(COMMAND ${MACDEPLOYQT_EXECUTABLE} \"${_bundle_install_path}\") - include(BundleUtilities) - fixup_bundle(\"${_bundle_install_path}\" \"\" \"${PYNCPP_LIBRARY_DIRS}\") - file(WRITE \"${_pth_file}\" \"${_python_paths}\") - " - COMPONENT ${TARGET_NAME} - EXCLUDE_FROM_ALL - ) - - #PYNCPP_install_python_modules(STDLIB_DESTINATION ${_stdlib_destination} COMPONENT ${TARGET_NAME}) -else() - install(TARGETS ${TARGET_NAME} - RUNTIME - DESTINATION bin - COMPONENT ${TARGET_NAME} - ) - - set(_executable_install_path "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/bin") - set(_stdlib_install_path "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/lib") - - PYNCPP_get_python_path_config(_python_paths - EXECUTABLE_PATH "${_executable_install_path}" - STDLIB_PATH "${_stdlib_install_path}" - ) - - install(CODE " - file(WRITE \"${_executable_install_path}/${TARGET_NAME}._pth\" \"${_python_paths}\") - " - COMPONENT ${TARGET_NAME} - ) -endif() - -################################################################################ -# Packaging -################################################################################ - -if(PYNCPP_EXAMPLES_FRAMEWORKS) - set(CPACK_INSTALL_CMAKE_PROJECTS - ${CPACK_INSTALL_CMAKE_PROJECTS} - "${CMAKE_CURRENT_BINARY_DIR};examples;${TARGET_NAME};/" - "${PYNCPP_DIR};pyncpp;python;/${_stdlib_destination}" - PARENT_SCOPE - ) -endif() diff --git a/examples/qt_console/application.cpp b/examples/qt_console/application.cpp deleted file mode 100644 index 7f463fc..0000000 --- a/examples/qt_console/application.cpp +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) 2022-2023 IHU Liryc, Université de Bordeaux, Inria. -// License: BSD-3-Clause - -#include "application.h" - -#include - -namespace pyncpp::qt_console -{ - -Application::Application(int& argc, char** argv) : - QApplication(argc, argv) -{ -} - -} // namespace pyncpp::qt_console diff --git a/examples/qt_console/application.h b/examples/qt_console/application.h deleted file mode 100644 index 0a55304..0000000 --- a/examples/qt_console/application.h +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) 2022-2023 IHU Liryc, Université de Bordeaux, Inria. -// License: BSD-3-Clause - -#ifndef PYNCPP_QT_CONSOLE_APPLICATION_H -#define PYNCPP_QT_CONSOLE_APPLICATION_H - -#include - -namespace pyncpp::qt_console -{ - -class Application : public QApplication -{ -public: - Application(int& argc, char** argv); -}; - -} // namespace pyncpp::qt_console - -#endif // PYNCPP_QT_CONSOLE_APPLICATION_H diff --git a/examples/qt_console/main.cpp b/examples/qt_console/main.cpp deleted file mode 100644 index c0d3892..0000000 --- a/examples/qt_console/main.cpp +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) 2022-2023 IHU Liryc, Université de Bordeaux, Inria. -// License: BSD-3-Clause - -#include -#include - -#include - -namespace pyncpp::qt_console -{ - -void runTest() -{ - try - { - PyObject* globals = cpythonCall(PyDict_New); - QString sourceCode = "import sys; print(f'sys.path: {sys.path}')"; - cpythonCall(PyRun_String, qUtf8Printable(sourceCode), Py_file_input, globals, nullptr); - Py_CLEAR(globals); - } - catch (Exception& e) - { - qCritical() << e.what(); - } -} - -} // namespace pyncpp::qt_console - -int main(int argc, char** argv) -{ - QApplication app(argc, argv); - pyncpp::Manager pythonManager; - int success = pythonManager.initialize(); - - if (success) - { - pyncpp::qt_console::runTest(); - success = app.exec(); - } - - return success; -} diff --git a/examples/source/CMakeLists.txt b/examples/source/CMakeLists.txt new file mode 100644 index 0000000..f3ef6da --- /dev/null +++ b/examples/source/CMakeLists.txt @@ -0,0 +1,72 @@ +# Copyright (c) 2022-2023 IHU Liryc, Université de Bordeaux, Inria. +# License: BSD-3-Clause + +cmake_minimum_required(VERSION ${CMAKE_MINIMUM_REQUIRED_VERSION}) + +cmake_policy(SET CMP0011 NEW) # Policy PUSH/POP in included scripts +cmake_policy(SET CMP0048 NEW) # Project command manages version variables +cmake_policy(SET CMP0057 NEW) # IN_LIST operator +cmake_policy(SET CMP0068 NEW) # RPATH settings on macOS do not affect install_name + +################################################################################ +# Project +################################################################################ + +set(PYNCPP_EXAMPLES_VERSION "${PYNCPP_VERSION_MAJOR}.${PYNCPP_VERSION_MINOR}.${PYNCPP_VERSION_PATCH}") +project(pyncpp_examples VERSION "${PYNCPP_EXAMPLES_VERSION}") + +################################################################################ +# Settings +################################################################################ + +if(APPLE) + if(PYNCPP_EXAMPLES_FRAMEWORKS) + set(CMAKE_MACOSX_BUNDLE TRUE) + else() + set(CMAKE_INSTALL_RPATH "@executable_path/../lib") + endif() +elseif(UNIX) + set(CMAKE_INSTALL_RPATH "\${ORIGIN}/../lib") +endif() + +################################################################################ +# Dependencies +################################################################################ + +find_package(pyncpp REQUIRED + COMPONENTS CPP_API + OPTIONAL_COMPONENTS Qt5 + ) + +set(PYNCPP_QT5_SUPPORT ${pyncpp_Qt5_FOUND}) + +if(PYNCPP_QT5_SUPPORT) + find_package(Qt5 REQUIRED COMPONENTS Core Widgets) + get_target_property(_qmake_executable Qt5::qmake IMPORTED_LOCATION) + get_filename_component(_qt_bin_dir "${_qmake_executable}" DIRECTORY) + find_program(MACDEPLOYQT_EXECUTABLE macdeployqt HINTS "${_qt_bin_dir}") +endif() + +################################################################################ +# Compile definitions +################################################################################ + +if(WIN32) + set(python_home ".") +else() + if(APPLE AND PYNCPP_EXAMPLES_FRAMEWORKS) + set(python_home "../../../../${pyncpp_PYTHON_INSTALL_DESTINATION}") + else() + set(python_home "../${pyncpp_PYTHON_INSTALL_DESTINATION}") + endif() +endif() + +add_compile_definitions(PYTHON_HOME="${python_home}") + +################################################################################ +# Subdirectories +################################################################################ + +if(PYNCPP_QT5_SUPPORT) + add_subdirectory(qt_application) +endif() diff --git a/examples/source/qt_application/CMakeLists.txt b/examples/source/qt_application/CMakeLists.txt new file mode 100644 index 0000000..c1b8071 --- /dev/null +++ b/examples/source/qt_application/CMakeLists.txt @@ -0,0 +1,48 @@ +# Copyright (c) 2022-2023 IHU Liryc, Université de Bordeaux, Inria. +# License: BSD-3-Clause + +################################################################################ +# Executable +################################################################################ + +add_executable(qt_application + main.cpp + ) + +################################################################################ +# Link +################################################################################ + +target_link_libraries(qt_application PUBLIC + ${pyncpp_CPP_API_LIBRARY} + Qt5::Core + Qt5::Widgets + ) + +################################################################################ +# Install +################################################################################ + +if(PYNCPP_EXAMPLES_FRAMEWORKS) + install(TARGETS qt_application + BUNDLE + DESTINATION bin + COMPONENT qt_application + ) + + set(_bundle_install_path "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/bin/qt_application.app") + + install(CODE " + execute_process(COMMAND ${MACDEPLOYQT_EXECUTABLE} \"${_bundle_install_path}\") + include(BundleUtilities) + fixup_bundle(\"${_bundle_install_path}\" \"\" \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/lib\") + " + COMPONENT qt_application + ) +else() + install(TARGETS qt_application + RUNTIME + DESTINATION bin + COMPONENT qt_application + ) +endif() diff --git a/examples/source/qt_application/main.cpp b/examples/source/qt_application/main.cpp new file mode 100644 index 0000000..d03fb00 --- /dev/null +++ b/examples/source/qt_application/main.cpp @@ -0,0 +1,41 @@ +// Copyright (c) 2022-2023 IHU Liryc, Université de Bordeaux, Inria. +// License: BSD-3-Clause + +#include +#include +#include +#include + +#include + +int main(int argc, char** argv) +{ + QApplication app(argc, argv); + + pyncpp::Manager pythonManager; + QDir pythonHome = qApp->applicationDirPath(); + QString pythonMessage; + + if (!pythonHome.cd(PYTHON_HOME)) + { + pythonMessage = "The Python interpreter could not be found "; + } + else + { + if (!pythonManager.initialize(qUtf8Printable(pythonHome.absolutePath()))) + { + pythonMessage = "Initialization of the Python interpreter failed."; + } + else + { + pythonMessage = "The Python interpreter is running."; + } + } + + QMessageBox pythonMessageBox; + pythonMessageBox.setWindowTitle("pyncpp qt application example"); + pythonMessageBox.setInformativeText(pythonMessage); + pythonMessageBox.exec(); + + return 0; +} diff --git a/pyncpp/CMakeLists.txt b/pyncpp/CMakeLists.txt index 54506d8..7a9b663 100644 --- a/pyncpp/CMakeLists.txt +++ b/pyncpp/CMakeLists.txt @@ -7,16 +7,6 @@ option(PYNCPP_BUILD_CPP_API "Build the C++ API provided by PYNCPP" ON) -option(PYNCPP_QT5_SUPPORT "Include support for Qt5." ON) - -################################################################################ -# Dependencies -################################################################################ - -if(PYNCPP_QT5_SUPPORT) - find_package(Qt5 REQUIRED COMPONENTS Core Widgets) -endif() - ################################################################################ # Configuration ################################################################################ @@ -41,7 +31,7 @@ if(PYNCPP_QT5_SUPPORT) endif() if(UNIX AND NOT APPLE) - list(APPEND cmake_args -D "CMAKE_INSTALL_RPATH:PATH=\$ORIGIN/../${PYNCPP_PYTHON_INSTALL_DESTINATION}") + list(APPEND cmake_args -D "CMAKE_INSTALL_RPATH:PATH=\$ORIGIN/../${PYNCPP_PYTHON_INSTALL_DESTINATION}/lib") endif() set(prefix "${CMAKE_CURRENT_BINARY_DIR}") diff --git a/pyncpp/source/CMakeLists.txt b/pyncpp/source/CMakeLists.txt index 7b9fc22..ad311a5 100644 --- a/pyncpp/source/CMakeLists.txt +++ b/pyncpp/source/CMakeLists.txt @@ -7,8 +7,6 @@ cmake_policy(SET CMP0011 NEW) # Policy PUSH/POP in included scripts cmake_policy(SET CMP0048 NEW) # Project command manages version variables cmake_policy(SET CMP0057 NEW) # IN_LIST operator cmake_policy(SET CMP0068 NEW) # RPATH settings on macOS do not affect install_name -cmake_policy(SET CMP0078 NEW) # Standard SWIG target names -cmake_policy(SET CMP0086 NEW) # Pass -module option to SWIG ################################################################################ # Project