$NetBSD: patch-CMakeLists.txt,v 1.2 2014/08/05 05:12:38 mrg Exp $

Install csound in lib/csound6 to avoid conflicts with csound5.
Add NetBSD support.

--- CMakeLists.txt.orig	2014-01-07 08:54:20.000000000 -0800
+++ CMakeLists.txt	2014-02-14 16:31:43.000000000 -0800
@@ -13,26 +13,26 @@
 set(APIVERSION "6.0")
 
 # Relative install paths
-set(EXECUTABLE_INSTALL_DIR "bin")
+set(EXECUTABLE_INSTALL_DIR "lib/csound6")
 
 option(USE_LIB64 "Set to on to set installation directory for libraries to lib64" OFF)
 if(USE_LIB64)
-    set(LIBRARY_INSTALL_DIR "lib64")
+    set(LIBRARY_INSTALL_DIR "lib64/csound6")
 else()
-    set(LIBRARY_INSTALL_DIR "lib")
+    set(LIBRARY_INSTALL_DIR "lib/csound6")
 endif()
 message(STATUS "LIBRARY INSTALL DIR: ${LIBRARY_INSTALL_DIR}")
 
 if(USE_DOUBLE)
-    set(PLUGIN_INSTALL_DIR "${LIBRARY_INSTALL_DIR}/csound/plugins64-${APIVERSION}")
+    set(PLUGIN_INSTALL_DIR "${LIBRARY_INSTALL_DIR}/plugins-${APIVERSION}")
 else()
-    set(PLUGIN_INSTALL_DIR "${LIBRARY_INSTALL_DIR}/csound/plugins-${APIVERSION}")
+    set(PLUGIN_INSTALL_DIR "${LIBRARY_INSTALL_DIR}/plugins-${APIVERSION}")
 endif()
 set(PYTHON_MODULE_INSTALL_DIR ${LIBRARY_INSTALL_DIR})
 set(JAVA_MODULE_INSTALL_DIR ${LIBRARY_INSTALL_DIR})
 set(LUA_MODULE_INSTALL_DIR ${LIBRARY_INSTALL_DIR})
 set(LOCALE_INSTALL_DIR "share/locale")
-set(HEADER_INSTALL_DIR "include/csound")
+set(HEADER_INSTALL_DIR "include/csound6")
 
 set(CS_FRAMEWORK_DEST "~/Library/Frameworks")
 include(TestBigEndian)
@@ -239,6 +239,12 @@
     set(LINUX NO)
 endif()
 
+if(CMAKE_SYSTEM_NAME MATCHES "NetBSD")
+    set(NETBSD YES)
+else()
+    set(NETBSD NO)
+endif()
+
 ## USER OPTIONS ##
 
 option(USE_DOUBLE "Set to use double-precision floating point for audio samples." ON)
@@ -326,6 +332,10 @@
 
 endif()
 
+if(NETBSD)
+    add_definitions("-DCS_DEFAULT_PLUGINDIR=\"${CMAKE_INSTALL_PREFIX}/${PLUGIN_INSTALL_DIR}\"")
+endif()
+
 if(BUILD_RELEASE)
     add_definitions("-D_CSOUND_RELEASE_")
     if(LINUX)
