@ -45,25 +45,26 @@ endmacro()
macro ( eth_copy_dlls EXECUTABLE DLLS )
# d l l s m u s t b e u n s u b s t i t u d l i s t variable ( without $ {} ) i n f o r m a t
# o p t i m i z e d ; p a t h _ t o _ d l l . d l l ; d e b u g ; p a t h _ t o _ d l l d . d l l
# o p t i m i z e d ; p a t h _ t o _ d l l . d l l ; d e b u g ; p a t h _ t o _ d l l d . d l l
list ( GET ${ DLLS } 1 DLL_RELEASE )
list ( GET ${ DLLS } 3 DLL_DEBUG )
get_target_property ( TARGET_RUNTIME_OUTPUT_DIRECTORY ${ EXECUTABLE } RUNTIME_OUTPUT_DIRECTORY )
add_custom_command ( TARGET ${ EXECUTABLE }
P O S T _ B U I L D
C O M M A N D $ { C M A K E _ C O M M A N D } A R G S
- D D L L _ R E L E A S E = " $ { D L L _ R E L E A S E } "
- D D L L _ D E B U G = " $ { D L L _ D E B U G } "
P O S T _ B U I L D
C O M M A N D $ { C M A K E _ C O M M A N D } A R G S
- D D L L _ R E L E A S E = " $ { D L L _ R E L E A S E } "
- D D L L _ D E B U G = " $ { D L L _ D E B U G } "
- D C O N F = " $ < C O N F I G U R A T I O N > "
- D D E S T I N A T I O N = " $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / $ { C M A K E _ C F G _ I N T D I R } "
- D D E S T I N A T I O N = " $ { T A R G E T _ R U N T I M E _ O U T P U T _ D I R E C T O R Y } / $ { C M A K E _ C F G _ I N T D I R } "
- P " $ { E T H _ S C R I P T S _ D I R } / c o p y d l l s . c m a k e "
)
endmacro ( )
#
#
# t h i s f u n c t i o n r e q u i r e s t h e f o l l o w i n g v a r i a b l e s t o b e s p e c i f i e d :
# E T H _ D E P E N D E N C Y _ I N S T A L L _ D I R
#
# p a r a m s :
# p a r a m s :
# Q M L D I R
#
@ -74,7 +75,7 @@ macro(eth_install_executable EXECUTABLE)
set ( one_value_args QMLDIR )
set ( multi_value_args DLLS )
cmake_parse_arguments ( ETH_INSTALL_EXECUTABLE "${options}" "${one_value_args}" "${multi_value_args}" "${extra_macro_args}" )
if ( ETH_INSTALL_EXECUTABLE_QMLDIR )
if ( APPLE )
set ( eth_qml_dir "-qmldir=${ETH_INSTALL_EXECUTABLE_QMLDIR}" )
@ -91,13 +92,14 @@ macro(eth_install_executable EXECUTABLE)
W O R K I N G _ D I R E C T O R Y $ { C M A K E _ R U N T I M E _ O U T P U T _ D I R E C T O R Y }
C O M M A N D s h $ { C M A K E _ S O U R C E _ D I R } / m a c d e p l o y f i x . s h $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / $ { C M A K E _ C F G _ I N T D I R } / $ { E X E C U T A B L E } . a p p / C o n t e n t s
)
get_target_property ( TARGET_RUNTIME_OUTPUT_DIRECTORY ${ EXECUTABLE } RUNTIME_OUTPUT_DIRECTORY )
# T h i s t o o l a n d n e x t w i l l i n s p e c t l i n k e d l i b r a r i e s i n o r d e r t o d e t e r m i n e w h i c h d e p e n d e n c i e s a r e r e q u i r e d
if ( ${ CMAKE_CFG_INTDIR } STREQUAL "." )
# T O D O : T h i s s h o u l d o n l y h a p p e n f o r G U I a p p l i c a t i o n
set ( APP_BUNDLE_PATH "${CMAKE_CURRENT_BINARY_DIR }/${EXECUTABLE}.app" )
set ( APP_BUNDLE_PATH "${TARGET_RUNTIME_OUTPUT_DIRECTORY }/${EXECUTABLE}.app" )
else ( )
set ( APP_BUNDLE_PATH "${CMAKE_CURRENT_BINARY_DIR }/\$ENV{CONFIGURATION}/${EXECUTABLE}.app" )
set ( APP_BUNDLE_PATH "${TARGET_RUNTIME_OUTPUT_DIRECTORY }/\$ENV{CONFIGURATION}/${EXECUTABLE}.app" )
endif ( )
install ( CODE "
@ -111,14 +113,15 @@ macro(eth_install_executable EXECUTABLE)
get_target_property ( TARGET_LIBS ${ EXECUTABLE } INTERFACE_LINK_LIBRARIES )
string ( REGEX MATCH "Qt5::Core" HAVE_QT ${ TARGET_LIBS } )
if ( "${HAVE_QT}" STREQUAL "Qt5::Core" )
get_target_property ( TARGET_RUNTIME_OUTPUT_DIRECTORY ${ EXECUTABLE } RUNTIME_OUTPUT_DIRECTORY )
add_custom_command ( TARGET ${ EXECUTABLE } POST_BUILD
C O M M A N D c m d / C " s e t P A T H = $ { Q t 5 C o r e _ D I R } / . . / . . / . . / b i n ; % P A T H % & & $ { W I N D E P L O Y Q T _ A P P } $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / $ { C M A K E _ C F G _ I N T D I R } / $ { E X E C U T A B L E } . e x e $ { e t h _ q m l _ d i r } "
C O M M A N D c m d / C " s e t P A T H = $ { Q t 5 C o r e _ D I R } / . . / . . / . . / b i n ; % P A T H % & & $ { W I N D E P L O Y Q T _ A P P } $ { T A R G E T _ R U N T I M E _ O U T P U T _ D I R E C T O R Y } / $ { C M A K E _ C F G _ I N T D I R } / $ { E X E C U T A B L E } . e x e $ { e t h _ q m l _ d i r } "
W O R K I N G _ D I R E C T O R Y $ { C M A K E _ R U N T I M E _ O U T P U T _ D I R E C T O R Y }
)
# w o r k a r o u n d f o r h t t p s : / / b u g r e p o r t s . q t . i o / b r o w s e / Q T B U G - 4 2 0 8 3
add_custom_command ( TARGET ${ EXECUTABLE } POST_BUILD
C O M M A N D c m d / C " ( e c h o [ P a t h s ] & e c h o . P r e f i x = . ) " > " q t . c o n f "
W O R K I N G _ D I R E C T O R Y $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / $ { C M A K E _ C F G _ I N T D I R } V E R B A T I M
W O R K I N G _ D I R E C T O R Y $ { T A R G E T _ R U N T I M E _ O U T P U T _ D I R E C T O R Y } / $ { C M A K E _ C F G _ I N T D I R } V E R B A T I M
)
endif ( )
@ -144,5 +147,3 @@ macro(eth_install_executable EXECUTABLE)
endif ( )
endmacro ( )