Commit d1a4d612 authored by Julien Malik's avatar Julien Malik
Browse files

COMP: make DeployQtConf reusable

parent 5a0a7205
# Deploy a qt.conf file in the specified
# target build directory, as a pre-build step
macro( deploy_qt_conf TARGET_NAME )
add_custom_command(
TARGET ${TARGET_NAME}
PRE_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -D QT_TRANSLATIONS_DIR:PATH=${QT_TRANSLATIONS_DIR}
-D Monteverdi2_SOURCE_DIR:PATH=${Monteverdi2_SOURCE_DIR}
-D TARGET_DIR:PATH=$<TARGET_FILE_DIR:${TARGET_NAME}>
-P ${Monteverdi2_SOURCE_DIR}/CMake/DeployQtConfScript.cmake
COMMENT "Deploying qt.conf in ${TARGET_NAME} build dir"
VERBATIM
)
endmacro()
configure_file(${Monteverdi2_SOURCE_DIR}/CMake/qt.conf.in
${TARGET_DIR}/qt.conf)
\ No newline at end of file
......@@ -132,6 +132,7 @@ endif(NOT Monteverdi2_INSTALL_PACKAGE_DIR)
#----------------------------------------------------------------------------
include( PreventInSourceBuilds )
include( PreventInstallOnBuildTree )
include( DeployQtConf )
#----------------------------------------------------------------------------
# Configure files with settings for use by the build.
......
......@@ -101,19 +101,7 @@ target_link_libraries( mvd2-viewer
${QT_LIBRARIES}
)
# deploy a qt.conf file in the monteverdi2 target build dir
# to avoid warning on translation discovery
add_custom_command(
TARGET mvd2-viewer
PRE_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -D QT_TRANSLATIONS_DIR:PATH=${QT_TRANSLATIONS_DIR}
-D SOURCE_DIR:PATH=${CMAKE_CURRENT_SOURCE_DIR}
-D TARGET_DIR:PATH=$<TARGET_FILE_DIR:mvd2-viewer>
-P ${CMAKE_CURRENT_SOURCE_DIR}/DeployQtConf.cmake
COMMENT "Deploying qt.conf in build dir"
VERBATIM
)
deploy_qt_conf( mvd2-viewer )
#############################################################################
install(
......
configure_file(${SOURCE_DIR}/qt.conf.in
${TARGET_DIR}/qt.conf)
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment