fix output directory for windows

closes #2505

git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@1289 fdac6126-5c0c-442c-9429-916003d36597
This commit is contained in:
Matthias Möller
2015-06-18 11:23:28 +00:00
parent 0460f0811f
commit f0e51c54aa

View File

@@ -34,13 +34,20 @@ if ( OPENMESH_BUILD_UNIT_TESTS )
# For the unittest we don't want the install rpath as set by acg_add_executable # For the unittest we don't want the install rpath as set by acg_add_executable
set_target_properties ( unittests PROPERTIES BUILD_WITH_INSTALL_RPATH 0 ) set_target_properties ( unittests PROPERTIES BUILD_WITH_INSTALL_RPATH 0 )
# Set output directory to ${BINARY_DIR}/Unittests
set (OUTPUT_DIR "${CMAKE_BINARY_DIR}/Unittests")
set_target_properties(unittests PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${OUTPUT_DIR})
foreach(CONFIG ${CMAKE_CONFIGURATION_TYPES})
string(TOUPPER ${CONFIG} UPCONFIG)
set_target_properties(unittests PROPERTIES RUNTIME_OUTPUT_DIRECTORY_${UPCONFIG} ${OUTPUT_DIR})
endforeach()
if ( NOT WIN32) if ( NOT WIN32)
# Link against all necessary libraries # Link against all necessary libraries
target_link_libraries(unittests OpenMeshCore OpenMeshTools ${GTEST_LIBRARIES} ${GTEST_MAIN_LIBRARIES} pthread) target_link_libraries(unittests OpenMeshCore OpenMeshTools ${GTEST_LIBRARIES} ${GTEST_MAIN_LIBRARIES} pthread)
# Set output directory to ${BINARY_DIR}/Unittests
set_target_properties(unittests PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/Unittests)
else() else()
# Link against all necessary libraries # Link against all necessary libraries
@@ -61,15 +68,6 @@ if ( OPENMESH_BUILD_UNIT_TESTS )
# Set compiler flags # Set compiler flags
set_target_properties(unittests PROPERTIES COMPILE_FLAGS "" ) set_target_properties(unittests PROPERTIES COMPILE_FLAGS "" )
#-------- copy exe file to "Build" directory --------
# Visual studio will create this file in a subdirectory so we can't use
# RUNTIME_OUTPUT_DIRECTORY directly here
add_custom_command (TARGET unittests POST_BUILD
COMMAND ${CMAKE_COMMAND} -E
copy_if_different
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/unittests.exe
${CMAKE_BINARY_DIR}/Unittests/unittests.exe)
endif() endif()
if ( OPENMESH_BUILD_SHARED ) if ( OPENMESH_BUILD_SHARED )