portmidi-cmake.patch 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. Index: portmidi/pm_common/CMakeLists.txt
  2. ===================================================================
  3. --- portmidi.orig/pm_common/CMakeLists.txt
  4. +++ portmidi/pm_common/CMakeLists.txt
  5. @@ -120,8 +120,8 @@ set_target_properties(pmjni PROPERTIES E
  6. # install the libraries (Linux and Mac OS X command line)
  7. if(UNIX)
  8. INSTALL(TARGETS portmidi-static pmjni
  9. - LIBRARY DESTINATION /usr/local/lib
  10. - ARCHIVE DESTINATION /usr/local/lib)
  11. + LIBRARY DESTINATION ${LIB_INSTALL_DIR}
  12. + ARCHIVE DESTINATION ${LIB_INSTALL_DIR})
  13. # .h files installed by pm_dylib/CMakeLists.txt, so don't need them here
  14. # INSTALL(FILES portmidi.h ../porttime/porttime.h
  15. # DESTINATION /usr/local/include)
  16. Index: portmidi/pm_dylib/CMakeLists.txt
  17. ===================================================================
  18. --- portmidi.orig/pm_dylib/CMakeLists.txt
  19. +++ portmidi/pm_dylib/CMakeLists.txt
  20. @@ -59,7 +59,7 @@ if(UNIX)
  21. set(JAVAVM_LIB "${FRAMEWORK_PATH}/JavaVM.framework")
  22. set(JAVA_INCLUDE_PATHS ${JAVAVM_LIB}/Headers)
  23. - set(INSTALL_NAME_DIR "/usr/local/lib")
  24. + set(INSTALL_NAME_DIR ${LIB_INSTALL_DIR})
  25. message(STATUS "SYSROOT: " ${CMAKE_OSX_SYSROOT})
  26. else(APPLE)
  27. # LINUX settings...
  28. @@ -75,11 +75,7 @@ if(UNIX)
  29. # JAVA_INCLUDE_PATH2; if no, then we need to make both JAVA_INCLUDE_PATH
  30. # and JAVA_INCLUDE_PATH2 set by user (will need clear documentation
  31. # because JAVA_INCLUDE_PATH2 is pretty obscure)
  32. - set(JAVA_INCLUDE_PATH ${JAVA_INCLUDE_PATH-UNKNOWN}
  33. - CACHE STRING "where to find Java SDK include directory")
  34. - set(JAVA_INCLUDE_PATHS ${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH}/linux)
  35. - # libjvm.so is found relative to JAVA_INCLUDE_PATH:
  36. - set(JAVAVM_LIB ${JAVA_INCLUDE_PATH}/../jre/lib/i386/client/libjvm.so)
  37. + set(JAVAVM_LIB ${JAVA_JVM_LIBRARY})
  38. set(LINUXSRC pmlinuxalsa pmlinux finddefault)
  39. prepend_path(LIBSRC ../pm_linux/ ${LINUXSRC})
  40. @@ -114,14 +110,14 @@ prepend_path(SHARED_PATHS ../pm_common/
  41. list(APPEND LIBSRC ${SHARED_PATHS})
  42. add_library(portmidi-dynamic SHARED ${LIBSRC})
  43. -set_target_properties(portmidi-dynamic PROPERTIES OUTPUT_NAME "portmidi")
  44. +set_target_properties(portmidi-dynamic PROPERTIES LINK_FLAGS "-L${CMAKE_CACHEFILE_DIR}/Release" SOVERSION 0 VERSION 0.${VERSION} OUTPUT_NAME "portmidi")
  45. target_link_libraries(portmidi-dynamic ${PM_NEEDED_LIBS})
  46. # install the libraries (Linux and Mac OS X command line)
  47. if(UNIX)
  48. INSTALL(TARGETS portmidi-dynamic
  49. - LIBRARY DESTINATION /usr/local/lib
  50. - ARCHIVE DESTINATION /usr/local/lib)
  51. + LIBRARY DESTINATION ${LIB_INSTALL_DIR}
  52. + ARCHIVE DESTINATION ${LIB_INSTALL_DIR})
  53. INSTALL(FILES ../pm_common/portmidi.h ../porttime/porttime.h
  54. - DESTINATION /usr/local/include)
  55. + DESTINATION ${INCLUDE_INSTALL_DIR})
  56. endif(UNIX)
  57. Index: portmidi/pm_java/CMakeLists.txt
  58. ===================================================================
  59. --- portmidi.orig/pm_java/CMakeLists.txt
  60. +++ portmidi/pm_java/CMakeLists.txt
  61. @@ -41,7 +41,7 @@ if(UNIX)
  62. INSTALL(FILES ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/pmdefaults.jar
  63. DESTINATION /usr/share/java)
  64. INSTALL(PROGRAMS ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/pmdefaults
  65. - DESTINATION /usr/local/bin)
  66. + DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
  67. endif(APPLE)
  68. endif(UNIX)
  69. # In windows, use pm_java/make.bat
  70. Index: portmidi/pm_test/CMakeLists.txt
  71. ===================================================================
  72. --- portmidi.orig/pm_test/CMakeLists.txt
  73. +++ portmidi/pm_test/CMakeLists.txt
  74. @@ -12,7 +12,7 @@ endif(WIN32)
  75. macro(make_a_test name)
  76. add_executable(${name} ${name}.c)
  77. - target_link_libraries(${name} portmidi-static ${PM_NEEDED_LIBS})
  78. + target_link_libraries(${name} portmidi-dynamic)
  79. add_dependencies(${name} portmidi-static)
  80. endmacro(make_a_test)
  81. Index: portmidi/CMakeLists.txt
  82. ===================================================================
  83. --- portmidi.orig/CMakeLists.txt
  84. +++ portmidi/CMakeLists.txt
  85. @@ -71,7 +71,3 @@ add_subdirectory(pm_common)
  86. add_subdirectory(pm_test)
  87. add_subdirectory(pm_dylib)
  88. -
  89. -# Cannot figure out how to make an xcode Java application with CMake
  90. -add_subdirectory(pm_java)
  91. -