Skip to content

Commit 64e68c7

Browse files
authored
Merge pull request #36 from realnc/fix-cross-mingw-libname
Fix pkgconfig libname when cross compiling with mingw under Linux
2 parents 440df33 + e0239e9 commit 64e68c7

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,9 @@ if ( UNIX OR MINGW OR WIN32)
189189
endif ()
190190
# stamp library name with version current value (for Windows only)
191191
if(MINGW OR WIN32)
192-
set ( lib_output_name ${INSTPATCH_INSTALL_TARGET} )
192+
set ( lib_version_suffix ${LIB_VERSION_CURRENT} )
193193
else(MINGW OR WIN32)
194-
set ( lib_output_name instpatch-1.0 )
194+
set ( lib_version_suffix 1.0 )
195195
endif(MINGW OR WIN32)
196196
configure_file ( libinstpatch-1.0.pc.in
197197
${CMAKE_BINARY_DIR}/libinstpatch-1.0.pc IMMEDIATE @ONLY )

libinstpatch-1.0.pc.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ Name: libInstPatch
77
Description: MIDI instrument patch library
88
Version: @VERSION@
99
Requires: glib-2.0 gobject-2.0 gthread-2.0 sndfile
10-
Libs: -L${libdir} -l@lib_output_name@
10+
Libs: -L${libdir} -linstpatch-@lib_version_suffix@
1111
Cflags: -I${includedir}

libinstpatch/CMakeLists.txt

+4-4
Original file line numberDiff line numberDiff line change
@@ -345,15 +345,15 @@ if ( MACOSX_FRAMEWORK )
345345
elseif( MINGW OR WIN32 )
346346
set_target_properties ( libinstpatch
347347
PROPERTIES
348-
PREFIX ""
349-
OUTPUT_NAME ${INSTPATCH_INSTALL_TARGET}
348+
ARCHIVE_OUTPUT_NAME "instpatch-${LIB_VERSION_CURRENT}"
349+
PREFIX "lib"
350+
OUTPUT_NAME "instpatch-${LIB_VERSION_CURRENT}"
350351
VERSION ${LIB_VERSION_INFO}
351352
)
352353
else( MINGW OR WIN32 )
353354
set_target_properties ( libinstpatch
354355
PROPERTIES
355-
PREFIX ""
356-
OUTPUT_NAME "libinstpatch-1.0"
356+
OUTPUT_NAME "instpatch-1.0"
357357
VERSION ${LIB_VERSION_INFO}
358358
SOVERSION ${LIB_VERSION_CURRENT}
359359
)

0 commit comments

Comments
 (0)