From 88679334d7ec180e129ed8dffdb36a4c4b3132a7 Mon Sep 17 00:00:00 2001 From: Robert Vinluan Date: Tue, 19 Apr 2022 10:58:11 -0400 Subject: [PATCH] Add 'lib' prefix to Windows static libraries. The prefix helps distinguish between static libraries and import libraries on Windows. --- cmake/LibraryDefine.cmake | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmake/LibraryDefine.cmake b/cmake/LibraryDefine.cmake index a242ec8519..b89739e840 100644 --- a/cmake/LibraryDefine.cmake +++ b/cmake/LibraryDefine.cmake @@ -72,8 +72,13 @@ function(OPENEXR_DEFINE_LIBRARY libname) VERSION ${OPENEXR_LIB_VERSION} ) endif() + + set(OPENEXR_LIB_PREFIX) + if(WIN32 AND NOT BUILD_SHARED_LIBS) + set(OPENEXR_LIB_PREFIX "lib") + endif() set_target_properties(${libname} PROPERTIES - OUTPUT_NAME "${libname}${OPENEXR_LIB_SUFFIX}" + OUTPUT_NAME "${OPENEXR_LIB_PREFIX}${libname}${OPENEXR_LIB_SUFFIX}" RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin" ) add_library(${PROJECT_NAME}::${libname} ALIAS ${libname})