Skip to content

Commit

Permalink
Fix installing typelib in macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
dlech committed Aug 30, 2017
1 parent 7ba4ab1 commit 2e1a89b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,11 @@ include (GirCompiler)
add_typelib (${TYPELIB_TARGET} ${GIR_TARGET})
if (APPLE)
# have to regenerate .typelib file to get the shared library name correct
install (CODE "execute_process(COMMAND ${G_IR_COMPILER_EXECUTABLE} --output=\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/girepository-1.0/${GIR_NAME}-${GIR_VERSION}.typelib \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/gir-1.0/${GIR_NAME}-${GIR_VERSION}.gir)")
set (girDir "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/gir-1.0")
set (girFile "${girDir}/${GIR_NAME}-${GIR_VERSION}.gir")
set (typelibDir "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/girepository-1.0")
set (typelibFile "${typelibDir}/${GIR_NAME}-${GIR_VERSION}.typelib")
install (CODE "message(\"-- Installing: ${typelibFile}\")\n file(MAKE_DIRECTORY \"${typelibDir}\")\n execute_process(COMMAND ${G_IR_COMPILER_EXECUTABLE} \"--output=${typelibFile}\" \"${girFile}\")")
else (APPLE)
install (FILES $<TARGET_PROPERTY:${TYPELIB_TARGET},TYPELIB_FILE_NAME>
DESTINATION ${CMAKE_INSTALL_LIBDIR}/girepository-1.0/)
Expand Down

0 comments on commit 2e1a89b

Please sign in to comment.