CMake: set examples's output dirs in a cross-platform way

pull/3/head
Christian Beier 6 years ago
parent 2041bfd5cd
commit d3e70a91bf
  1. 6
      CMakeLists.txt

@ -453,14 +453,16 @@ endif(HAVE_FFMPEG)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/examples)
foreach(test ${LIBVNCSERVER_TESTS})
add_executable(examples_${test} ${LIBVNCSRVTEST_DIR}/${test}.c)
set_target_properties(examples_${test} PROPERTIES OUTPUT_NAME examples/${test})
set_target_properties(examples_${test} PROPERTIES OUTPUT_NAME ${test})
set_target_properties(examples_${test} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/examples)
target_link_libraries(examples_${test} vncserver ${CMAKE_THREAD_LIBS_INIT})
endforeach(test ${LIBVNCSERVER_TESTS})
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/client_examples)
foreach(test ${LIBVNCCLIENT_TESTS})
add_executable(client_examples_${test} ${LIBVNCCLITEST_DIR}/${test}.c ${LIBVNCCLITEST_DIR}/${${test}_EXTRA_SOURCES} )
set_target_properties(client_examples_${test} PROPERTIES OUTPUT_NAME client_examples/${test})
set_target_properties(client_examples_${test} PROPERTIES OUTPUT_NAME ${test})
set_target_properties(client_examples_${test} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/client_examples)
target_link_libraries(client_examples_${test} vncclient ${CMAKE_THREAD_LIBS_INIT} ${SDL_LIBRARY} ${FFMPEG_LIBRARIES})
endforeach(test ${LIBVNCCLIENT_TESTS})

Loading…
Cancel
Save