Blob Blame Raw
diff -rupN portmidi.old/pm_common/CMakeLists.txt portmidi/pm_common/CMakeLists.txt
--- portmidi.old/pm_common/CMakeLists.txt	2010-09-20 15:57:48.000000000 -0400
+++ portmidi/pm_common/CMakeLists.txt	2011-06-23 22:35:41.000000000 -0400
@@ -120,8 +120,8 @@ set_target_properties(pmjni PROPERTIES E
 # install the libraries (Linux and Mac OS X command line)
 if(UNIX)
   INSTALL(TARGETS portmidi-static pmjni
-    LIBRARY DESTINATION /usr/local/lib
-    ARCHIVE DESTINATION /usr/local/lib)
+    LIBRARY DESTINATION ${LIB_INSTALL_DIR}
+    ARCHIVE DESTINATION ${LIB_INSTALL_DIR})
 # .h files installed by pm_dylib/CMakeLists.txt, so don't need them here
 #  INSTALL(FILES portmidi.h ../porttime/porttime.h
 #    DESTINATION /usr/local/include)
diff -rupN portmidi.old/pm_dylib/CMakeLists.txt portmidi/pm_dylib/CMakeLists.txt
--- portmidi.old/pm_dylib/CMakeLists.txt	2009-11-20 00:41:09.000000000 -0500
+++ portmidi/pm_dylib/CMakeLists.txt	2011-06-23 22:35:41.000000000 -0400
@@ -59,7 +59,7 @@ if(UNIX)
 
     set(JAVAVM_LIB "${FRAMEWORK_PATH}/JavaVM.framework")
     set(JAVA_INCLUDE_PATHS ${JAVAVM_LIB}/Headers)
-    set(INSTALL_NAME_DIR "/usr/local/lib")
+    set(INSTALL_NAME_DIR ${LIB_INSTALL_DIR})
     message(STATUS "SYSROOT: " ${CMAKE_OSX_SYSROOT})
   else(APPLE)
     # LINUX settings...
@@ -75,11 +75,7 @@ if(UNIX)
     # JAVA_INCLUDE_PATH2; if no, then we need to make both JAVA_INCLUDE_PATH
     # and JAVA_INCLUDE_PATH2 set by user (will need clear documentation
     # because JAVA_INCLUDE_PATH2 is pretty obscure)
-    set(JAVA_INCLUDE_PATH  ${JAVA_INCLUDE_PATH-UNKNOWN}
-        CACHE STRING "where to find Java SDK include directory")
-    set(JAVA_INCLUDE_PATHS ${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH}/linux)
-    # libjvm.so is found relative to JAVA_INCLUDE_PATH:
-    set(JAVAVM_LIB ${JAVA_INCLUDE_PATH}/../jre/lib/i386/client/libjvm.so)
+    set(JAVAVM_LIB ${JAVA_JVM_LIBRARY})
 
     set(LINUXSRC pmlinuxalsa pmlinux finddefault)
     prepend_path(LIBSRC ../pm_linux/ ${LINUXSRC})
@@ -114,14 +110,14 @@ prepend_path(SHARED_PATHS ../pm_common/ 
 list(APPEND LIBSRC ${SHARED_PATHS})
 
 add_library(portmidi-dynamic SHARED ${LIBSRC})
-set_target_properties(portmidi-dynamic PROPERTIES OUTPUT_NAME "portmidi")
+set_target_properties(portmidi-dynamic PROPERTIES LINK_FLAGS "-L${CMAKE_CACHEFILE_DIR}/Release" SOVERSION 0 VERSION 0.${VERSION} OUTPUT_NAME "portmidi")
 target_link_libraries(portmidi-dynamic ${PM_NEEDED_LIBS})
 
 # install the libraries (Linux and Mac OS X command line)
 if(UNIX)
   INSTALL(TARGETS portmidi-dynamic
-    LIBRARY DESTINATION /usr/local/lib
-    ARCHIVE DESTINATION /usr/local/lib)
+    LIBRARY DESTINATION ${LIB_INSTALL_DIR}
+    ARCHIVE DESTINATION ${LIB_INSTALL_DIR})
   INSTALL(FILES ../pm_common/portmidi.h ../porttime/porttime.h
-    DESTINATION /usr/local/include)
+    DESTINATION ${INCLUDE_INSTALL_DIR})
 endif(UNIX)
diff -rupN portmidi.old/pm_java/CMakeLists.txt portmidi/pm_java/CMakeLists.txt
--- portmidi.old/pm_java/CMakeLists.txt	2009-11-04 10:20:44.000000000 -0500
+++ portmidi/pm_java/CMakeLists.txt	2011-06-23 22:35:54.000000000 -0400
@@ -16,12 +16,12 @@ if(UNIX)
         COMMAND javac -classpath . pmdefaults/PmDefaultsFrame.java
 	MAIN_DEPENDENCY pmdefaults/PmDefaultsFrame.java
 	DEPENDS pmdefaults/PmDefaults.java
-	WORKING_DIRECTORY pm_java)
+	)
     add_custom_command(OUTPUT pmdefaults/PmDefaults.class
         COMMAND javac -classpath . pmdefaults/PmDefaults.java
 	MAIN_DEPENDENCY pmdefaults/PmDefaults.java
 	DEPENDS pmdefaults/PmDefaultsFrame.java
-	WORKING_DIRECTORY pm_java)
+	)
     add_custom_command(OUTPUT ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/pmdefaults.jar
         COMMAND	cp pmdefaults/portmusic_logo.png .
         COMMAND	jar cmf pmdefaults/manifest.txt pmdefaults.jar
@@ -32,7 +32,7 @@ if(UNIX)
 	COMMAND rm portmusic_logo.png
 	MAIN_DEPENDENCY pmdefaults/PmDefaults.class
 	DEPENDS ${PMDEFAULTS_ALL_CLASSES}
-	WORKING_DIRECTORY pm_java)
+	)
     add_custom_target(pmdefaults_target ALL 
         DEPENDS ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/pmdefaults.jar)
     # message(STATUS "add_custom_target: pmdefaults.jar")
@@ -41,7 +41,7 @@ if(UNIX)
     INSTALL(FILES ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/pmdefaults.jar
       DESTINATION /usr/share/java)
     INSTALL(PROGRAMS ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/pmdefaults
-      DESTINATION /usr/local/bin)
+      DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
   endif(APPLE)
 endif(UNIX)
 # In windows, use pm_java/make.bat
diff -rupN portmidi.old/pm_test/CMakeLists.txt portmidi/pm_test/CMakeLists.txt
--- portmidi.old/pm_test/CMakeLists.txt	2010-09-20 15:57:48.000000000 -0400
+++ portmidi/pm_test/CMakeLists.txt	2011-06-23 22:35:41.000000000 -0400
@@ -12,7 +12,7 @@ endif(WIN32)
 
 macro(make_a_test name)
   add_executable(${name} ${name}.c)
-  target_link_libraries(${name} portmidi-static ${PM_NEEDED_LIBS})
+  target_link_libraries(${name} portmidi-dynamic)
   add_dependencies(${name} portmidi-static)
 endmacro(make_a_test)