mirror of
https://github.com/JulianGro/overte.git
synced 2025-05-07 15:39:51 +02:00
tweak setup_hifi_library to bubble up full path of Qt modules
This commit is contained in:
parent
1f0a722d0d
commit
c9f8433a2d
17 changed files with 59 additions and 113 deletions
|
@ -13,14 +13,28 @@ macro(SETUP_HIFI_LIBRARY TARGET)
|
||||||
|
|
||||||
# grab the implemenation and header files
|
# grab the implemenation and header files
|
||||||
file(GLOB LIB_SRCS src/*.h src/*.cpp)
|
file(GLOB LIB_SRCS src/*.h src/*.cpp)
|
||||||
set(LIB_SRCS ${LIB_SRCS} ${WRAPPED_SRCS})
|
set(LIB_SRCS ${LIB_SRCS})
|
||||||
|
|
||||||
# create a library and set the property so it can be referenced later
|
# create a library and set the property so it can be referenced later
|
||||||
add_library(${TARGET} ${LIB_SRCS} ${ARGN})
|
add_library(${TARGET} ${LIB_SRCS} ${AUTOMTC_SRC})
|
||||||
|
|
||||||
find_package(Qt5Core REQUIRED)
|
set(QT_MODULES_TO_LINK ${ARGN})
|
||||||
qt5_use_modules(${TARGET} Core)
|
list(APPEND QT_MODULES_TO_LINK Core)
|
||||||
|
|
||||||
target_link_libraries(${TARGET} ${QT_LIBRARIES})
|
find_package(Qt5 COMPONENTS ${QT_MODULES_TO_LINK})
|
||||||
|
|
||||||
|
foreach(QT_MODULE ${QT_MODULES_TO_LINK})
|
||||||
|
# link this Qt module to ourselves
|
||||||
|
target_link_libraries(${TARGET} Qt5::${QT_MODULE})
|
||||||
|
|
||||||
|
get_target_property(QT_LIBRARY_LOCATION Qt5::${QT_MODULE} LOCATION)
|
||||||
|
|
||||||
|
# add the actual path to the Qt module to a QT_LIBRARIES variable
|
||||||
|
list(APPEND QT_LIBRARIES ${QT_LIBRARY_LOCATION})
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
if (QT_LIBRARIES)
|
||||||
|
set_target_properties(${TARGET} PROPERTIES DEPENDENCY_LIBRARIES "${QT_LIBRARIES}")
|
||||||
|
endif ()
|
||||||
|
|
||||||
endmacro(SETUP_HIFI_LIBRARY _target)
|
endmacro(SETUP_HIFI_LIBRARY _target)
|
|
@ -1,12 +1,6 @@
|
||||||
set(TARGET_NAME animation)
|
set(TARGET_NAME animation)
|
||||||
|
|
||||||
setup_hifi_library(${TARGET_NAME})
|
# use setup_hifi_library macro to setup our project and link appropriate Qt modules
|
||||||
|
setup_hifi_library(${TARGET_NAME} Network Script)
|
||||||
|
|
||||||
link_hifi_libraries(${TARGET_NAME} shared fbx)
|
link_hifi_libraries(${TARGET_NAME} shared fbx)
|
||||||
|
|
||||||
find_package(Qt5 COMPONENTS Network Script)
|
|
||||||
|
|
||||||
# set a property indicating the libraries we are dependent on and link them to ourselves
|
|
||||||
set(DEPENDENCY_LIBRARIES Qt5::Script Qt5::Network)
|
|
||||||
set_target_properties(${TARGET_NAME} PROPERTIES DEPENDENCY_LIBRARIES "${DEPENDENCY_LIBRARIES}")
|
|
||||||
target_link_libraries(${TARGET_NAME} ${DEPENDENCY_LIBRARIES})
|
|
||||||
|
|
|
@ -1,14 +1,8 @@
|
||||||
set(TARGET_NAME audio)
|
set(TARGET_NAME audio)
|
||||||
|
|
||||||
setup_hifi_library(${TARGET_NAME})
|
# use setup_hifi_library macro to setup our project and link appropriate Qt modules
|
||||||
|
setup_hifi_library(${TARGET_NAME} Network)
|
||||||
|
|
||||||
include_glm(${TARGET_NAME} "${ROOT_DIR}")
|
include_glm(${TARGET_NAME} "${ROOT_DIR}")
|
||||||
|
|
||||||
link_hifi_libraries(${TARGET_NAME} networking shared)
|
link_hifi_libraries(${TARGET_NAME} networking shared)
|
||||||
|
|
||||||
find_package(Qt5 COMPONENTS Network)
|
|
||||||
|
|
||||||
# set a property indicating the libraries we are dependent on and link them to ourselves
|
|
||||||
set(DEPENDENCY_LIBRARIES Qt5::Network)
|
|
||||||
set_target_properties(${TARGET_NAME} PROPERTIES DEPENDENCY_LIBRARIES ${DEPENDENCY_LIBRARIES})
|
|
||||||
target_link_libraries(${TARGET_NAME} ${DEPENDENCY_LIBRARIES})
|
|
||||||
|
|
|
@ -1,15 +1,9 @@
|
||||||
set(TARGET_NAME avatars)
|
set(TARGET_NAME avatars)
|
||||||
|
|
||||||
setup_hifi_library(${TARGET_NAME})
|
# use setup_hifi_library macro to setup our project and link appropriate Qt modules
|
||||||
|
setup_hifi_library(${TARGET_NAME} Network Script)
|
||||||
|
|
||||||
include_glm(${TARGET_NAME} "${ROOT_DIR}")
|
include_glm(${TARGET_NAME} "${ROOT_DIR}")
|
||||||
|
|
||||||
link_hifi_libraries(${TARGET_NAME} shared octree voxels networking)
|
link_hifi_libraries(${TARGET_NAME} shared octree voxels networking)
|
||||||
include_hifi_library_headers(fbx)
|
include_hifi_library_headers(fbx)
|
||||||
|
|
||||||
find_package(Qt5 COMPONENTS Network Script)
|
|
||||||
|
|
||||||
# set a property indicating the libraries we are dependent on and link them to ourselves
|
|
||||||
set(DEPENDENCY_LIBRARIES Qt5::Network Qt5::Script)
|
|
||||||
set_target_properties(${TARGET_NAME} PROPERTIES DEPENDENCY_LIBRARIES "${DEPENDENCY_LIBRARIES}")
|
|
||||||
target_link_libraries(${TARGET_NAME} ${DEPENDENCY_LIBRARIES})
|
|
||||||
|
|
|
@ -1,17 +1,4 @@
|
||||||
set(ROOT_DIR ../..)
|
|
||||||
set(MACRO_DIR "${ROOT_DIR}/cmake/macros")
|
|
||||||
|
|
||||||
# setup for find modules
|
|
||||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/modules/")
|
|
||||||
|
|
||||||
set(TARGET_NAME embedded-webserver)
|
set(TARGET_NAME embedded-webserver)
|
||||||
|
|
||||||
include(${MACRO_DIR}/SetupHifiLibrary.cmake)
|
# use setup_hifi_library macro to setup our project and link appropriate Qt modules
|
||||||
setup_hifi_library(${TARGET_NAME})
|
setup_hifi_library(${TARGET_NAME} Network)
|
||||||
|
|
||||||
find_package(Qt5 COMPONENTS Network)
|
|
||||||
|
|
||||||
# set a property indicating the libraries we are dependent on and link them to ourselves
|
|
||||||
set(DEPENDENCY_LIBRARIES Qt5::Network)
|
|
||||||
set_target_properties(${TARGET_NAME} PROPERTIES DEPENDENCY_LIBRARIES ${DEPENDENCY_LIBRARIES})
|
|
||||||
target_link_libraries(${TARGET_NAME} ${DEPENDENCY_LIBRARIES})
|
|
|
@ -1,5 +1,6 @@
|
||||||
set(TARGET_NAME fbx)
|
set(TARGET_NAME fbx)
|
||||||
|
|
||||||
|
# use setup_hifi_library macro to setup our project and link appropriate Qt modules
|
||||||
setup_hifi_library(${TARGET_NAME})
|
setup_hifi_library(${TARGET_NAME})
|
||||||
|
|
||||||
include_glm(${TARGET_NAME} "${ROOT_DIR}")
|
include_glm(${TARGET_NAME} "${ROOT_DIR}")
|
||||||
|
|
|
@ -2,16 +2,10 @@ set(TARGET_NAME metavoxels)
|
||||||
|
|
||||||
auto_mtc(${TARGET_NAME} "${ROOT_DIR}")
|
auto_mtc(${TARGET_NAME} "${ROOT_DIR}")
|
||||||
|
|
||||||
setup_hifi_library(${TARGET_NAME} "${AUTOMTC_SRC}")
|
# use setup_hifi_library macro to setup our project and link appropriate Qt modules
|
||||||
|
setup_hifi_library(${TARGET_NAME} Network Scripts Widgets)
|
||||||
|
|
||||||
# link in the networking library
|
# link in the networking library
|
||||||
link_hifi_libraries(${TARGET_NAME} shared networking)
|
link_hifi_libraries(${TARGET_NAME} shared networking)
|
||||||
|
|
||||||
include_glm(${TARGET_NAME} "${ROOT_DIR}")
|
include_glm(${TARGET_NAME} "${ROOT_DIR}")
|
||||||
|
|
||||||
find_package(Qt5 COMPONENTS Network Script Widgets)
|
|
||||||
|
|
||||||
# set a property indicating the libraries we are dependent on and link them to ourselves
|
|
||||||
set(DEPENDENCY_LIBRARIES Qt5::Script Qt5::Widgets Qt5::Network)
|
|
||||||
set_target_properties(${TARGET_NAME} PROPERTIES DEPENDENCY_LIBRARIES "${DEPENDENCY_LIBRARIES}")
|
|
||||||
target_link_libraries(${TARGET_NAME} ${DEPENDENCY_LIBRARIES})
|
|
|
@ -1,14 +1,8 @@
|
||||||
set(TARGET_NAME models)
|
set(TARGET_NAME models)
|
||||||
|
|
||||||
setup_hifi_library(${TARGET_NAME})
|
# use setup_hifi_library macro to setup our project and link appropriate Qt modules
|
||||||
|
setup_hifi_library(${TARGET_NAME} Network Script)
|
||||||
|
|
||||||
include_glm(${TARGET_NAME} "${ROOT_DIR}")
|
include_glm(${TARGET_NAME} "${ROOT_DIR}")
|
||||||
|
|
||||||
link_hifi_libraries(${TARGET_NAME} shared octree fbx networking animation)
|
link_hifi_libraries(${TARGET_NAME} shared octree fbx networking animation)
|
||||||
|
|
||||||
find_package(Qt5 COMPONENTS Network Script)
|
|
||||||
|
|
||||||
# set a property indicating the libraries we are dependent on and link them to ourselves
|
|
||||||
set(DEPENDENCY_LIBRARIES Qt5::Network Qt5::Script)
|
|
||||||
set_target_properties(${TARGET_NAME} PROPERTIES DEPENDENCY_LIBRARIES "${DEPENDENCY_LIBRARIES}")
|
|
||||||
target_link_libraries(${TARGET_NAME} ${DEPENDENCY_LIBRARIES})
|
|
||||||
|
|
|
@ -1,12 +1,6 @@
|
||||||
set(TARGET_NAME networking)
|
set(TARGET_NAME networking)
|
||||||
|
|
||||||
setup_hifi_library(${TARGET_NAME})
|
# use setup_hifi_library macro to setup our project and link appropriate Qt modules
|
||||||
|
setup_hifi_library(${TARGET_NAME} Network)
|
||||||
|
|
||||||
link_hifi_libraries(${TARGET_NAME} shared)
|
link_hifi_libraries(${TARGET_NAME} shared)
|
||||||
|
|
||||||
find_package(Qt5 COMPONENTS Network)
|
|
||||||
|
|
||||||
# set a property indicating the libraries we are dependent on and link them to ourselves
|
|
||||||
set(DEPENDENCY_LIBRARIES Qt5::Network)
|
|
||||||
set_target_properties(${TARGET_NAME} PROPERTIES DEPENDENCY_LIBRARIES "${DEPENDENCY_LIBRARIES}")
|
|
||||||
target_link_libraries(${TARGET_NAME} ${DEPENDENCY_LIBRARIES})
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
set(TARGET_NAME octree)
|
set(TARGET_NAME octree)
|
||||||
|
|
||||||
|
# use setup_hifi_library macro to setup our project and link appropriate Qt modules
|
||||||
setup_hifi_library(${TARGET_NAME})
|
setup_hifi_library(${TARGET_NAME})
|
||||||
|
|
||||||
include_glm(${TARGET_NAME} "${ROOT_DIR}")
|
include_glm(${TARGET_NAME} "${ROOT_DIR}")
|
||||||
|
|
|
@ -1,15 +1,9 @@
|
||||||
set(TARGET_NAME particles)
|
set(TARGET_NAME particles)
|
||||||
|
|
||||||
setup_hifi_library(${TARGET_NAME})
|
# use setup_hifi_library macro to setup our project and link appropriate Qt modules
|
||||||
|
setup_hifi_library(${TARGET_NAME} Gui Network Script)
|
||||||
|
|
||||||
include_glm(${TARGET_NAME} "${ROOT_DIR}")
|
include_glm(${TARGET_NAME} "${ROOT_DIR}")
|
||||||
|
|
||||||
link_hifi_libraries(${TARGET_NAME} shared octree fbx networking animation)
|
link_hifi_libraries(${TARGET_NAME} shared octree fbx networking animation)
|
||||||
include_hifi_library_headers(script-engine)
|
include_hifi_library_headers(script-engine)
|
||||||
|
|
||||||
find_package(Qt5 COMPONENTS Gui Network Script)
|
|
||||||
|
|
||||||
# set a property indicating the libraries we are dependent on and link them to ourselves
|
|
||||||
set(DEPENDENCY_LIBRARIES Qt5::Network Qt5::Script Qt5::Gui)
|
|
||||||
set_target_properties(${TARGET_NAME} PROPERTIES DEPENDENCY_LIBRARIES "${DEPENDENCY_LIBRARIES}")
|
|
||||||
target_link_libraries(${TARGET_NAME} ${DEPENDENCY_LIBRARIES})
|
|
|
@ -1,14 +1,8 @@
|
||||||
set(TARGET_NAME script-engine)
|
set(TARGET_NAME script-engine)
|
||||||
|
|
||||||
setup_hifi_library(${TARGET_NAME})
|
# use setup_hifi_library macro to setup our project and link appropriate Qt modules
|
||||||
|
setup_hifi_library(${TARGET_NAME} Gui Network Script Widgets)
|
||||||
|
|
||||||
include_glm(${TARGET_NAME} "${ROOT_DIR}")
|
include_glm(${TARGET_NAME} "${ROOT_DIR}")
|
||||||
|
|
||||||
link_hifi_libraries(${TARGET_NAME} shared octree voxels fbx particles models animation)
|
link_hifi_libraries(${TARGET_NAME} shared octree voxels fbx particles models animation)
|
||||||
|
|
||||||
find_package(Qt5 COMPONENTS Gui Network Script Widgets)
|
|
||||||
|
|
||||||
# set a property indicating the libraries we are dependent on and link them to ourselves
|
|
||||||
set(DEPENDENCY_LIBRARIES Qt5::Gui Qt5::Network Qt5::Script Qt5::Widgets)
|
|
||||||
set_target_properties(${TARGET_NAME} PROPERTIES DEPENDENCY_LIBRARIES "${DEPENDENCY_LIBRARIES}")
|
|
||||||
target_link_libraries(${TARGET_NAME} ${DEPENDENCY_LIBRARIES})
|
|
|
@ -1,9 +1,4 @@
|
||||||
set(TARGET_NAME shared)
|
set(TARGET_NAME shared)
|
||||||
setup_hifi_library(${TARGET_NAME})
|
|
||||||
|
|
||||||
find_package(Qt5 COMPONENTS Network Widgets)
|
# use setup_hifi_library macro to setup our project and link appropriate Qt modules
|
||||||
|
setup_hifi_library(${TARGET_NAME} Network Widgets)
|
||||||
# bubble up the libraries we are dependent on and link them to ourselves
|
|
||||||
list(APPEND DEPENDENCY_LIBRARIES Qt5::Network Qt5::Widgets)
|
|
||||||
set_target_properties(${TARGET_NAME} PROPERTIES DEPENDENCY_LIBRARIES "${DEPENDENCY_LIBRARIES}")
|
|
||||||
target_link_libraries(${TARGET_NAME} ${DEPENDENCY_LIBRARIES})
|
|
|
@ -1,6 +1,7 @@
|
||||||
set(TARGET_NAME voxels)
|
set(TARGET_NAME voxels)
|
||||||
|
|
||||||
setup_hifi_library(${TARGET_NAME})
|
# use setup_hifi_library macro to setup our project and link appropriate Qt modules
|
||||||
|
setup_hifi_library(${TARGET_NAME} Widgets Script)
|
||||||
|
|
||||||
include_glm(${TARGET_NAME} "${ROOT_DIR}")
|
include_glm(${TARGET_NAME} "${ROOT_DIR}")
|
||||||
|
|
||||||
|
@ -8,7 +9,8 @@ link_hifi_libraries(${TARGET_NAME} shared octree networking)
|
||||||
|
|
||||||
# link ZLIB
|
# link ZLIB
|
||||||
find_package(ZLIB)
|
find_package(ZLIB)
|
||||||
find_package(Qt5 COMPONENTS Widgets Script)
|
|
||||||
|
|
||||||
include_directories(SYSTEM "${ZLIB_INCLUDE_DIRS}")
|
include_directories(SYSTEM "${ZLIB_INCLUDE_DIRS}")
|
||||||
target_link_libraries(${TARGET_NAME} "${ZLIB_LIBRARIES}" Qt5::Widgets Qt5::Script)
|
|
||||||
|
get_target_property(LINKED_LIBRARIES ${TARGET_NAME} DEPENDENCY_LIBRARIES)
|
||||||
|
list(APPEND DEPENDENCY_LIBRARIES "${ZLIB_LIBRARIES}")
|
||||||
|
list(REMOVE_DUPLICATES DEPENDENCY_LIBRARIES)
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
# add the tool directories
|
# add the tool directories
|
||||||
add_subdirectory(bitstream2json)
|
add_subdirectory(bitstream2json)
|
||||||
add_subdirectory(json2bitstream)
|
add_subdirectory(json2bitstream)
|
||||||
|
|
|
@ -1,7 +1,2 @@
|
||||||
set(TARGET_NAME mtc)
|
set(TARGET_NAME mtc)
|
||||||
|
|
||||||
set(ROOT_DIR ../..)
|
|
||||||
set(MACRO_DIR "${ROOT_DIR}/cmake/macros")
|
|
||||||
|
|
||||||
include(${MACRO_DIR}/SetupHifiProject.cmake)
|
|
||||||
setup_hifi_project(${TARGET_NAME} TRUE)
|
setup_hifi_project(${TARGET_NAME} TRUE)
|
Loading…
Reference in a new issue