From 7f61d9973494db0c56559867cec63b2b1514ef2d Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Thu, 18 Nov 2021 11:39:54 +0100 Subject: [PATCH] Fix C++ examples not launching out of the box on Windows when using multi-config generator We copy the sixtyfps_cpp.dll into the bin directory where the examples are, but that needs to be a Debug/ or Release/ sub-directory in case of a multi-config generator. --- api/sixtyfps-cpp/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/api/sixtyfps-cpp/CMakeLists.txt b/api/sixtyfps-cpp/CMakeLists.txt index 5f7e34600..49660a5d8 100644 --- a/api/sixtyfps-cpp/CMakeLists.txt +++ b/api/sixtyfps-cpp/CMakeLists.txt @@ -168,10 +168,14 @@ if(WIN32) install(FILES $ TYPE LIB) # Copy the dll to the top-level bin directory, where the examples will # will also be located, so that they can find the dll. + get_property(GENERATOR_IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) + if(GENERATOR_IS_MULTI_CONFIG) + set(config_subdir_genex "$/") + endif() add_custom_target(SixtyFPS_dll_convenience ALL DEPENDS sixtyfps-cpp-shared COMMAND ${CMAKE_COMMAND} -E copy_if_different $ - ${CMAKE_BINARY_DIR}/bin/$) + ${CMAKE_BINARY_DIR}/bin/${config_subdir_genex}$) endif() install(PROGRAMS $ TYPE BIN)