Skip to content
Closed
Show file tree
Hide file tree
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
13 changes: 10 additions & 3 deletions libversion/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ set_target_properties(libversion PROPERTIES
)
generate_export_header(libversion EXPORT_FILE_NAME export.h)
if(WIN32)
# avoid clash with both c:/windows/system32/version.dll
# and static version.lib from the next target
# avoid clash with both c:/windows/system32/version.dll and version.lib from the Windows SDK
set_target_properties(libversion PROPERTIES OUTPUT_NAME libversion)
endif()

Expand All @@ -51,9 +50,17 @@ target_include_directories(libversion_static PUBLIC
target_compile_definitions(libversion_static PUBLIC
LIBVERSION_STATIC_DEFINE
)

if(WIN32)
# avoid clash with version.lib from the Windows SDK and the dynamic target above
set(LIBVERSION_STATIC_OUTPUT_NAME libversion_static)
else()
set(LIBVERSION_STATIC_OUTPUT_NAME version)
endif()

set_target_properties(libversion_static PROPERTIES
POSITION_INDEPENDENT_CODE ON
OUTPUT_NAME version
OUTPUT_NAME "${LIBVERSION_STATIC_OUTPUT_NAME}"
)

# object library
Expand Down
2 changes: 1 addition & 1 deletion libversion/libversion.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ includedir=@includedir_for_pc_file@
Name: libversion
Description: Version comparison library
Version: @libversion_VERSION@
Libs: -L${libdir} -lversion
Libs: -L${libdir} -l@LIBVERSION_STATIC_OUTPUT_NAME@
Cflags: -I${includedir}
Cflags.private: -DLIBVERSION_STATIC_DEFINE