-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added install target to build (#165).
- Loading branch information
Showing
5 changed files
with
115 additions
and
259 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
cmake_minimum_required(VERSION 3.5) | ||
|
||
message("CMAKE BUILD SYSTEM FOR THE CSOUND PLAYPEN") | ||
|
||
project(csound-playpen) | ||
|
||
# Top-level CMake configuration. | ||
|
||
cmake_policy(SET CMP0078 NEW) | ||
cmake_policy(SET CMP0086 NEW) | ||
|
||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/Modules") | ||
|
||
find_package(PkgConfig REQUIRED) | ||
pkg_check_modules(WEBKIT2_GTK_WEB_EXTENSION REQUIRED webkit2gtk-web-extension-4.0) | ||
|
||
# This is here only to warn in advance that the sourceview component will be | ||
# missing when running the playpen. | ||
|
||
pkg_check_modules(GTKSOURCEVIEW REQUIRED gtksourceview-4) | ||
find_package(Csound REQUIRED) | ||
find_package(Python3 REQUIRED COMPONENTS Interpreter Development) | ||
find_package(SWIG) | ||
include(UseSWIG) | ||
include_directories(${Python3_INCLUDE_DIRS}) | ||
include_directories(${CSOUND_INCLUDE_DIRS}) | ||
set(CMAKE_CXX_STANDARD 17) | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-sign-compare -Wno-unknown-pragmas -Wno-misleading-indentation -Wno-unused-variable") | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") | ||
add_definitions("-DUSE_DOUBLE") | ||
if(USE_LIB64) | ||
set(LIBRARY_INSTALL_DIR "lib64") | ||
add_definitions("-DLIB64") | ||
else() | ||
set(LIBRARY_INSTALL_DIR "lib") | ||
endif() | ||
|
||
set_property(SOURCE csound.i PROPERTY CPLUSPLUS ON) | ||
swig_add_library(CsoundThreaded | ||
TYPE MODULE | ||
LANGUAGE python | ||
SOURCES csound.i | ||
) | ||
swig_link_libraries(CsoundThreaded ${Python3_LIBRARY_RELEASE} ${CSOUND_LIBRARY} ${LIBSNDFILE_LIBRARY}) | ||
install(TARGETS CsoundThreaded | ||
LIBRARY DESTINATION "${Python3_SITEARCH}" | ||
ARCHIVE DESTINATION "${Python3_SITEARCH}") | ||
install(FILES "CsoundThreaded.py" | ||
DESTINATION "${Python3_SITEARCH}") | ||
|
||
add_library(jsc_csound SHARED | ||
jsc_csound.cpp) | ||
target_include_directories(jsc_csound PUBLIC ${WEBKIT2_GTK_WEB_EXTENSION_INCLUDE_DIRS}) | ||
target_link_libraries(jsc_csound PUBLIC ${WEBKIT2_GTK_WEB_EXTENSION_LIBRARIES} ${CSOUND_LIBRARY} ${LIBSNDFILE_LIBRARY}) | ||
install(TARGETS jsc_csound | ||
LIBRARY DESTINATION "${LIBRARY_INSTALL_DIR}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Try to find the Csound library. | ||
# Once done this will define: | ||
# CSOUND_FOUND - System has the Csound library | ||
# CSOUND_INCLUDE_DIRS - The Csound include directories. | ||
# 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") | ||
else() | ||
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") | ||
else() | ||
find_library(CSOUND_LIBRARY NAMES csound64 csound) | ||
endif() | ||
|
||
include(FindPackageHandleStandardArgs) | ||
# handle the QUIETLY and REQUIRED arguments and set CSOUND_FOUND to TRUE | ||
# if all listed variables are TRUE | ||
find_package_handle_standard_args(CSOUND | ||
CSOUND_LIBRARY CSOUND_INCLUDE_DIR) | ||
mark_as_advanced(CSOUND_INCLUDE_DIR CSOUND_LIBRARY) | ||
|
||
set(CSOUND_INCLUDE_DIRS ${CSOUND_INCLUDE_DIR}) | ||
set(CSOUND_LIBRARIES ${CSOUND_LIBRARY} ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.