Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions cmake/modules/RootMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -918,14 +918,10 @@ function(ROOT_LINKER_LIBRARY library)
if(ARG_TEST) # we are building a test, so add EXCLUDE_FROM_ALL
set(_all EXCLUDE_FROM_ALL)
endif()
set(library_name ${library})
if(TARGET ${library})
message(FATAL_ERROR "Target ${library} already exists.")
endif()
if(WIN32 AND ARG_TYPE STREQUAL SHARED AND NOT ARG_DLLEXPORT)
if(MSVC)
set(library_name ${libprefix}${library})
endif()
#---create a shared library with the .def file------------------------
add_library(${library} ${_all} SHARED ${lib_srcs})
set_target_properties(${library} PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
Expand Down Expand Up @@ -958,7 +954,10 @@ function(ROOT_LINKER_LIBRARY library)
endif()
endif()

set_target_properties(${library} PROPERTIES OUTPUT_NAME ${library_name})
set_target_properties(${library} PROPERTIES
PREFIX ${libprefix}
IMPORT_PREFIX ${libprefix} # affects the .lib import library (MSVC)
)
target_include_directories(${library} INTERFACE $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
# Do not add -Dname_EXPORTS to the command-line when building files in this
# target. Doing so is actively harmful for the modules build because it
Expand Down
Loading