From 4f0d9d33469afcb706d6c34791e2d72648cee7b5 Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Wed, 27 Oct 2021 21:22:02 +0200 Subject: [PATCH] CMake: Fix library directory when using MinGW This was broken in b102afc316 (CMake: Don't include generator expression in wxPLATFORM_LIB_DIR, 2021-10-17). And for clarity, always add a '/' after directories. Closes #19305 --- build/cmake/functions.cmake | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/build/cmake/functions.cmake b/build/cmake/functions.cmake index e62a87b8b7..d4494fa4db 100644 --- a/build/cmake/functions.cmake +++ b/build/cmake/functions.cmake @@ -26,9 +26,9 @@ else() set(WIN32_MSVC_NAMING 0) endif() -if(MSVC) +if(WIN32_MSVC_NAMING) # Generator expression to not create different Debug and Release directories - set(MSVC_DIR_FIX "$<1:/>") + set(GEN_EXPR_DIR_FIX "$<1:/>") endif() # This function adds a list of headers to a variable while prepending @@ -102,9 +102,9 @@ function(wx_set_common_target_properties target_name) cmake_parse_arguments(wxCOMMON_TARGET_PROPS "DEFAULT_WARNINGS" "" "" ${ARGN}) set_target_properties(${target_name} PROPERTIES - LIBRARY_OUTPUT_DIRECTORY "${wxOUTPUT_DIR}${MSVC_DIR_FIX}${wxPLATFORM_LIB_DIR}" - ARCHIVE_OUTPUT_DIRECTORY "${wxOUTPUT_DIR}${MSVC_DIR_FIX}${wxPLATFORM_LIB_DIR}" - RUNTIME_OUTPUT_DIRECTORY "${wxOUTPUT_DIR}${MSVC_DIR_FIX}${wxPLATFORM_LIB_DIR}" + LIBRARY_OUTPUT_DIRECTORY "${wxOUTPUT_DIR}/${GEN_EXPR_DIR_FIX}${wxPLATFORM_LIB_DIR}" + ARCHIVE_OUTPUT_DIRECTORY "${wxOUTPUT_DIR}/${GEN_EXPR_DIR_FIX}${wxPLATFORM_LIB_DIR}" + RUNTIME_OUTPUT_DIRECTORY "${wxOUTPUT_DIR}/${GEN_EXPR_DIR_FIX}${wxPLATFORM_LIB_DIR}" ) if(wxBUILD_PIC) @@ -422,9 +422,9 @@ macro(wx_add_library name) set(runtime_dir "bin") endif() wx_install(TARGETS ${name} - LIBRARY DESTINATION "lib${MSVC_DIR_FIX}${wxPLATFORM_LIB_DIR}" - ARCHIVE DESTINATION "lib${MSVC_DIR_FIX}${wxPLATFORM_LIB_DIR}" - RUNTIME DESTINATION "${runtime_dir}${MSVC_DIR_FIX}${wxPLATFORM_LIB_DIR}" + LIBRARY DESTINATION "lib/${GEN_EXPR_DIR_FIX}${wxPLATFORM_LIB_DIR}" + ARCHIVE DESTINATION "lib/${GEN_EXPR_DIR_FIX}${wxPLATFORM_LIB_DIR}" + RUNTIME DESTINATION "${runtime_dir}/${GEN_EXPR_DIR_FIX}${wxPLATFORM_LIB_DIR}" BUNDLE DESTINATION Applications/wxWidgets ) endif() @@ -579,7 +579,7 @@ function(wx_set_builtin_target_properties target_name) wx_set_common_target_properties(${target_name} DEFAULT_WARNINGS) if(NOT wxBUILD_SHARED) - wx_install(TARGETS ${name} ARCHIVE DESTINATION "lib${MSVC_DIR_FIX}${wxPLATFORM_LIB_DIR}") + wx_install(TARGETS ${name} ARCHIVE DESTINATION "lib/${GEN_EXPR_DIR_FIX}${wxPLATFORM_LIB_DIR}") endif() endfunction()