Made changes to write compiled binaries to a common directory.
The following changes were tested with the following projects: - assimp DLL - unit tests - tools/assimp_cmd - tools/assimp viewer - samples/SimpleOpenGL - samples/SimpleTexturedDirectx11 - samples/SimpleTexturedOpenGL For each program listed above, the results were tested when (CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR) is true and false. Also, the "lib" in SET (CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_HOME_DIRECTORY}/lib") was changed to "bin" to allow DLLs to be written to executables/launchables programs directory.pull/3013/head
parent
a0000e5be4
commit
be4fe131d5
|
@ -342,9 +342,13 @@ INCLUDE (PrecompiledHeader)
|
|||
# source tree. During an out-of-source build, however, do not litter this
|
||||
# directory, since that is probably what the user wanted to avoid.
|
||||
IF ( CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR )
|
||||
SET( CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_HOME_DIRECTORY}/lib" )
|
||||
SET( CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_HOME_DIRECTORY}/bin" )
|
||||
SET( CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_HOME_DIRECTORY}/lib" )
|
||||
SET( CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_HOME_DIRECTORY}/bin" )
|
||||
ELSE()
|
||||
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/lib")
|
||||
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin")
|
||||
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin")
|
||||
ENDIF ( CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR )
|
||||
|
||||
# Cache these to allow the user to override them manually.
|
||||
|
|
|
@ -205,13 +205,6 @@ ELSE( WIN32 )
|
|||
SET( platform_libs pthread )
|
||||
ENDIF( WIN32 )
|
||||
|
||||
IF( WIN32 )
|
||||
ADD_CUSTOM_COMMAND(TARGET unit
|
||||
PRE_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:assimp> $<TARGET_FILE_DIR:unit>
|
||||
MAIN_DEPENDENCY assimp)
|
||||
ENDIF( WIN32 )
|
||||
|
||||
IF(MSVC)
|
||||
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
||||
ENDIF(MSVC)
|
||||
|
|
|
@ -61,13 +61,6 @@ ADD_EXECUTABLE( assimp_cmd
|
|||
|
||||
SET_PROPERTY(TARGET assimp_cmd PROPERTY DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX})
|
||||
|
||||
IF( WIN32 )
|
||||
ADD_CUSTOM_COMMAND(TARGET assimp_cmd
|
||||
PRE_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:assimp> $<TARGET_FILE_DIR:assimp_cmd>
|
||||
MAIN_DEPENDENCY assimp)
|
||||
ENDIF( WIN32 )
|
||||
|
||||
TARGET_LINK_LIBRARIES( assimp_cmd assimp ${ZLIB_LIBRARIES} )
|
||||
SET_TARGET_PROPERTIES( assimp_cmd PROPERTIES
|
||||
OUTPUT_NAME assimp
|
||||
|
|
|
@ -92,13 +92,6 @@ IF ( MSVC )
|
|||
REMOVE_DEFINITIONS( -DUNICODE -D_UNICODE )
|
||||
ENDIF ( MSVC )
|
||||
|
||||
|
||||
#
|
||||
ADD_CUSTOM_COMMAND(TARGET assimp_viewer
|
||||
PRE_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:assimp> $<TARGET_FILE_DIR:assimp_viewer>
|
||||
MAIN_DEPENDENCY assimp)
|
||||
|
||||
# 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