Skip to content

Commit

Permalink
fixing cmake build
Browse files Browse the repository at this point in the history
  • Loading branch information
vlazzarini committed Mar 30, 2018
2 parents a1e65f3 + 5a85873 commit ff56c33
Show file tree
Hide file tree
Showing 4 changed files with 967 additions and 21 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build
41 changes: 26 additions & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1,33 @@
cmake_minimum_required(VERSION 2.8.12)
set(CMAKE_MACOSX_RPATH 1)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
if(MSVC AND NOT "${CMAKE_GENERATOR}" MATCHES "(Win64|IA64)")
message(FATAL_ERROR "ERROR: Building with Visual Studio requires
using a 64-bit project generator
(e.g. cmake -G \"Visual Studio 15 2017 Win64\")")
endif()


find_package(Csound)
if(CSOUND_FOUND)
message(STATUS "Building CsLadspa Plugin!")
add_library(csladspa64 MODULE "src/csladspa.cpp")
target_link_libraries(csladspa64 ${CSOUND_LIBRARY})
target_include_directories(csladspa64 PRIVATE
${CSOUND_INCLUDE_DIRS})
# We do not want the lib prefix
set_target_properties(csladspa64 PROPERTIES PREFIX "")
if(APPLE)
set(PLUGIN_INSTALL_DIR "$ENV{HOME}/Library/Audio/Plug-Ins/ladspa")
else()
set(PLUGIN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib")
endif()
install(TARGETS csladspa64
LIBRARY DESTINATION "${PLUGIN_INSTALL_DIR}" )
message(STATUS "Building CsLadspa Plugin!")
add_library(csladspa64 MODULE "src/csladspa.cpp")
if(MSVC)
target_include_directories(csladspa64 PRIVATE "${CMAKE_SOURCE_DIR}/include")
target_link_libraries(csladspa64 PRIVATE ${CSOUND_LIBRARY})
else()
target_link_libraries(csladspa64 ${CSOUND_LIBRARY})
target_include_directories(csladspa64 PRIVATE ${CSOUND_INCLUDE_DIRS})
endif()
# We do not want the lib prefix
set_target_properties(csladspa64 PROPERTIES PREFIX "")
if(APPLE)
set(PLUGIN_INSTALL_DIR "$ENV{HOME}/Library/Audio/Plug-Ins/ladspa")
else()
set(PLUGIN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib")
endif()
install(TARGETS csladspa64
LIBRARY DESTINATION "${PLUGIN_INSTALL_DIR}")
else()
message(STATUS "Csound library is required for CsLadspa")
message(STATUS "The Csound library is required for CsLadspa")
endif()
17 changes: 11 additions & 6 deletions cmake/Modules/FindCsound.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,22 @@
# CSOUND_LIBRARIES - The libraries needed to use the Csound library.

if(APPLE)
find_path(CSOUND_INCLUDE_DIR csound.h HINTS /Library/Frameworks/CsoundLib64.framework/Headers
"$ENV{HOME}/Library/Frameworks/CsoundLib64.framework/Headers")
find_path(CSOUND_INCLUDE_DIR csound.h HINTS /Library/Frameworks/CsoundLib64.framework/Headers
"$ENV{HOME}/Library/Frameworks/CsoundLib64.framework/Headers")
elseif(WIN32)
find_path(CSOUND_INCLUDE_DIR csound.h PATH_SUFFIXES csound
HINTS "c:\\Program Files\\Csound6_x64\\include")
else()
find_path(CSOUND_INCLUDE_DIR csound.h PATH_SUFFIXES csound)
find_path(CSOUND_INCLUDE_DIR csound.h PATH_SUFFIXES csound)
endif()

if(APPLE)
find_library(CSOUND_LIBRARY NAMES CsoundLib64 HINTS /Library/Frameworks/CsoundLib64.framework/
"$ENV{HOME}/Library/Frameworks/CsoundLib64.framework")
find_library(CSOUND_LIBRARY NAMES CsoundLib64 HINTS /Library/Frameworks/CsoundLib64.framework/
"$ENV{HOME}/Library/Frameworks/CsoundLib64.framework")
elseif(WIN32)
find_library(CSOUND_LIBRARY NAMES csound64 HINTS "c:\\Program Files\\Csound6_x64\\lib")
else()
find_library(CSOUND_LIBRARY NAMES csound64 csound)
find_library(CSOUND_LIBRARY NAMES csound64 csound)
endif()

include(FindPackageHandleStandardArgs)
Expand Down
Loading

0 comments on commit ff56c33

Please sign in to comment.