CMake: use copy_if_different instead of copy and only run PRE_BUILD on Windows as it is not required on *nix anyway.
parent
995978b163
commit
f8f7e2468c
|
@ -19,10 +19,11 @@ ADD_EXECUTABLE( assimp_cmd
|
|||
|
||||
SET_PROPERTY(TARGET assimp_cmd PROPERTY DEBUG_POSTFIX ${ASSIMP_DEBUG_POSTFIX})
|
||||
|
||||
#
|
||||
ADD_CUSTOM_COMMAND(TARGET assimp_cmd
|
||||
PRE_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:assimp> ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} $<TARGET_FILE_DIR:assimp_cmd>)
|
||||
IF( WIN32 )
|
||||
ADD_CUSTOM_COMMAND(TARGET assimp_cmd
|
||||
PRE_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:assimp> ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} $<TARGET_FILE_DIR:assimp_cmd>)
|
||||
ENDIF( WIN32 )
|
||||
|
||||
TARGET_LINK_LIBRARIES( assimp_cmd assimp ${ZLIB_LIBRARIES})
|
||||
SET_TARGET_PROPERTIES( assimp_cmd PROPERTIES
|
||||
|
|
|
@ -43,15 +43,14 @@ ADD_EXECUTABLE( assimp_viewer WIN32
|
|||
|
||||
SET_PROPERTY(TARGET assimp_viewer PROPERTY DEBUG_POSTFIX ${ASSIMP_DEBUG_POSTFIX})
|
||||
|
||||
IF( WIN32 )
|
||||
ADD_DEFINITIONS( -D_SCL_SECURE_NO_WARNINGS )
|
||||
ADD_DEFINITIONS( -D_CRT_SECURE_NO_WARNINGS )
|
||||
ENDIF( WIN32 )
|
||||
ADD_DEFINITIONS( -D_SCL_SECURE_NO_WARNINGS )
|
||||
ADD_DEFINITIONS( -D_CRT_SECURE_NO_WARNINGS )
|
||||
|
||||
|
||||
#
|
||||
ADD_CUSTOM_COMMAND(TARGET assimp_viewer
|
||||
PRE_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:assimp> ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} $<TARGET_FILE_DIR:assimp_viewer>)
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:assimp> ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} $<TARGET_FILE_DIR:assimp_viewer>)
|
||||
|
||||
# Link the executable to the assimp + dx libs.
|
||||
TARGET_LINK_LIBRARIES ( assimp_viewer assimp ${DirectX_LIBRARY} ${DirectX_D3DX9_LIBRARY} comctl32.lib Winmm.lib )
|
||||
|
|
Loading…
Reference in New Issue