From f13bbdfae60e8d13b225ee2699e54e9cb513ad7c Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Mon, 30 Jun 2014 01:28:35 +0200 Subject: [PATCH] Compile fix for non-standard Qt5 install. When Qt5 5.2.1 is compiled from source, configured with -developer-build, and used without being installed; then compiling interface results in the following compile error: libraries/shared/src/RegisteredMetaTypes.h:17:34: fatal error: QtScript/QScriptEngine: No such file or directory This commit fixes this by explicitely adding the include directory for QtScript/QScriptEngine to libraries/shared/CMakeLists.txt Likewise we get the compile error: In file included from /opt/highfidelity/hifi/hifi/animation-server/../libraries/voxels/src/VoxelEditPacketSender.h:18:0, from /opt/highfidelity/hifi/hifi/animation-server/src/AnimationServer.cpp:26: /opt/highfidelity/hifi/hifi/animation-server/../libraries/voxels/src/VoxelDetail.h:15:34: fatal error: QtScript/QScriptEngine: No such file or directory which is fixed by added the include directory for QtScript/QScriptEngine to animation-server/CMakeLists.txt Finally, compile errors like In file included from /opt/highfidelity/hifi/hifi/libraries/audio/src/AudioInjectorOptions.h:20:0, from /opt/highfidelity/hifi/hifi/libraries/audio/src/AudioInjector.h:21, from /opt/highfidelity/hifi/hifi/libraries/audio/src/AudioInjector.cpp:22: /opt/highfidelity/hifi/hifi/assignment-client/../libraries/shared/src/RegisteredMetaTypes.h:17:34: fatal error: QtScript/QScriptEngine: No such file or directory that requires to do the same in libraries/audio/CMakeLists.txt --- animation-server/CMakeLists.txt | 5 ++++- libraries/audio/CMakeLists.txt | 5 ++++- libraries/shared/CMakeLists.txt | 8 ++++++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/animation-server/CMakeLists.txt b/animation-server/CMakeLists.txt index 42516d2f86..31ed5d98df 100644 --- a/animation-server/CMakeLists.txt +++ b/animation-server/CMakeLists.txt @@ -12,6 +12,9 @@ set(MACRO_DIR "${ROOT_DIR}/cmake/macros") # setup for find modules set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/../cmake/modules/") +find_package(Qt5 COMPONENTS Script) +include_directories(SYSTEM "${Qt5Script_INCLUDE_DIRS}") + # set up the external glm library include("${MACRO_DIR}/IncludeGLM.cmake") include_glm(${TARGET_NAME} "${ROOT_DIR}") @@ -35,4 +38,4 @@ link_hifi_library(networking ${TARGET_NAME} "${ROOT_DIR}") # add a definition for ssize_t so that windows doesn't bail if (WIN32) add_definitions(-Dssize_t=long) -endif () \ No newline at end of file +endif () diff --git a/libraries/audio/CMakeLists.txt b/libraries/audio/CMakeLists.txt index 60636ba051..fafdfc7e6c 100644 --- a/libraries/audio/CMakeLists.txt +++ b/libraries/audio/CMakeLists.txt @@ -12,6 +12,9 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/../../cm set(TARGET_NAME audio) +find_package(Qt5 COMPONENTS Script) +include_directories(SYSTEM "${Qt5Script_INCLUDE_DIRS}") + # set up the external glm library include(${MACRO_DIR}/SetupHifiLibrary.cmake) setup_hifi_library(${TARGET_NAME}) @@ -26,4 +29,4 @@ link_hifi_library(networking ${TARGET_NAME} "${ROOT_DIR}") # add a definition for ssize_t so that windows doesn't bail if (WIN32) add_definitions(-Dssize_t=long) -endif () \ No newline at end of file +endif () diff --git a/libraries/shared/CMakeLists.txt b/libraries/shared/CMakeLists.txt index 7f9a34492d..560546473c 100644 --- a/libraries/shared/CMakeLists.txt +++ b/libraries/shared/CMakeLists.txt @@ -10,7 +10,7 @@ set(MACRO_DIR "${ROOT_DIR}/cmake/macros") set(TARGET_NAME shared) project(${TARGET_NAME}) -find_package(Qt5 COMPONENTS Network Widgets Xml) +find_package(Qt5 COMPONENTS Network Widgets Xml Script) include(${MACRO_DIR}/SetupHifiLibrary.cmake) setup_hifi_library(${TARGET_NAME}) @@ -32,4 +32,8 @@ if (UNIX AND NOT APPLE) target_link_libraries(${TARGET_NAME} "${CMAKE_THREAD_LIBS_INIT}") endif (UNIX AND NOT APPLE) -target_link_libraries(${TARGET_NAME} Qt5::Network Qt5::Widgets) \ No newline at end of file +# There is something special (bug) about Qt5Scripts, that we have to explicitly add its include +# directory when Qt5 (5.2.1) is compiled from source and is not in a standard place. +include_directories(SYSTEM "${Qt5Script_INCLUDE_DIRS}") + +target_link_libraries(${TARGET_NAME} Qt5::Network Qt5::Widgets)