Skip to content

Commit

Permalink
Add lv2 build together.
Browse files Browse the repository at this point in the history
Add uninstall script.
  • Loading branch information
Stazed committed Jan 23, 2018
1 parent 9ec375e commit 539e5fc
Show file tree
Hide file tree
Showing 4 changed files with 129 additions and 81 deletions.
122 changes: 98 additions & 24 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,52 @@

cmake_minimum_required(VERSION 2.6)

#rename these files so they are easier to use for plugins
SET( RVB x;Chamber;Concrete_Stairwell;Hall;Med_Hall;Large_Room;Large_Hall;Guitar_Ambience;Studio;Twilight;Santa_Lucia )
SET( DLY x;SwingPong;Short_Delays;Flange_plus_Echo;Comb;EchoFlange;Filtered_Echo;Notch-Wah;Multi-Chorus;PingPong;90-Shifter;Basic_LR_Delay )
SET( WAV x;Marshall_JCM200;Fender_Superchamp;Mesa_Boogie;Mesa_Boogie-2;Marshall_Plexi;Bassman;JCM2000;Ampeg;Marshall-2 )

foreach(INDX RANGE 1 9)
list(GET RVB ${INDX} NEWNAME)
configure_file(data/${INDX}.rvb lv2data/${NEWNAME}.rvb COPYONLY)
list(GET DLY ${INDX} NEWNAME)
configure_file(data/${INDX}.dly lv2data/${NEWNAME}.dly COPYONLY)
list(GET WAV ${INDX} NEWNAME)
configure_file(data/${INDX}.wav lv2data/${NEWNAME}.wav COPYONLY)
endforeach(INDX)
# 2 more dly file
list(GET DLY 10 NEWNAME)
configure_file(data/11.dly lv2data/${NEWNAME}.dly COPYONLY)
list(GET DLY 11 NEWNAME)
configure_file(data/11.dly lv2data/${NEWNAME}.dly COPYONLY)

# 1 more rvb file
list(GET RVB 10 NEWNAME)
configure_file(data/10.rvb lv2data/${NEWNAME}.rvb COPYONLY)

#add_subdirectory(lv2)
include (CheckCSourceCompiles)

option (BuildForDebug "Include gdb debugging support" OFF)
option (LV2Plugin "Build rakarack lv2 plugin interface" ON)
#option (optimizations "Enable optimizations" ON)
#option (vectorize "Enable vectorize" ON)
#option (sse "Enable sse (default=automatic check)" ON)
#option (sse2 "Enable sse2 (default=automatic check)" ON)
#option (altivec "Enable altivec (default=automatic check)" ON)

# Check for jack session availability
check_c_source_compiles (
"#include <jack/session.h>
int main(int argc, char **argv)
{
jack_session_event_type_t x = JackSessionSave;
return 0;
}" HasJackSession
)

if (HasJackSession)
option (JackSessionSupport "Include Jack Session Support" ON)
else (HasJackSession)
set (JackSessionSupport OFF)
endif (HasJackSession)

find_package (PkgConfig REQUIRED)
if (PKG_CONFIG_FOUND)
message(STATUS "Found pkg-config ${PKG_CONFIG_EXECUTABLE}")
else (PKG_CONFIG_FOUND)
message(FATAL_ERROR "pkg-config required but not found")
endif (PKG_CONFIG_FOUND)


# uninstall target
if(NOT TARGET uninstall)
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)

add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
endif()


add_subdirectory(src)
#add_subdirectory(man)
#add_subdirectory(data)
Expand All @@ -35,3 +57,55 @@ add_subdirectory(src)
#add_subdirectory(doc/help/imagenes)
#add_subdirectory(doc/help/css)
#add_subdirectory(extra)

include(GNUInstallDirs)
mark_as_advanced (EXECUTABLE_OUTPUT_PATH)
mark_as_advanced (LIBRARY_OUTPUT_PATH)
mark_as_advanced (CMAKE_BUILD_TYPE)
mark_as_advanced (CMAKE_INSTALL_PREFIX)

if (LV2Plugin)
# if (EXISTS $ENV{LV2_PATH})
# set(LV2_INSTALL_DIR $ENV{LV2_PATH} CACHE PATH
# "Specifies where the LV2 libraries should be installed")
# message ("Got env-lv2 path")
# else()
# set(LV2_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}/lv2 CACHE PATH
# "Specifies where the LV2 libraries should be installed")
# message ("got lv2 libdir - ${CMAKE_INSTALL_LIBDIR}")
# endif()

pkg_check_modules(LV2 REQUIRED lv2>=1.0.0)
if (LV2_FOUND)
message (STATUS "Found lv2 package ${LV2_VERSION}")
set(LV2_INSTALL_DIR lib/lv2/rkr.lv2 ) # CACHE PATH "Specifies where the LV2 libraries should be installed")

#rename these files so they are easier to use for plugins
SET( RVB x;Chamber;Concrete_Stairwell;Hall;Med_Hall;Large_Room;Large_Hall;Guitar_Ambience;Studio;Twilight;Santa_Lucia )
SET( DLY x;SwingPong;Short_Delays;Flange_plus_Echo;Comb;EchoFlange;Filtered_Echo;Notch-Wah;Multi-Chorus;PingPong;90-Shifter;Basic_LR_Delay )
SET( WAV x;Marshall_JCM200;Fender_Superchamp;Mesa_Boogie;Mesa_Boogie-2;Marshall_Plexi;Bassman;JCM2000;Ampeg;Marshall-2 )

foreach(INDX RANGE 1 9)
list(GET RVB ${INDX} NEWNAME)
configure_file(data/${INDX}.rvb lv2data/${NEWNAME}.rvb COPYONLY)
list(GET DLY ${INDX} NEWNAME)
configure_file(data/${INDX}.dly lv2data/${NEWNAME}.dly COPYONLY)
list(GET WAV ${INDX} NEWNAME)
configure_file(data/${INDX}.wav lv2data/${NEWNAME}.wav COPYONLY)
endforeach(INDX)
# 2 more dly file
list(GET DLY 10 NEWNAME)
configure_file(data/11.dly lv2data/${NEWNAME}.dly COPYONLY)
list(GET DLY 11 NEWNAME)
configure_file(data/11.dly lv2data/${NEWNAME}.dly COPYONLY)

# 1 more rvb file
list(GET RVB 10 NEWNAME)
configure_file(data/10.rvb lv2data/${NEWNAME}.rvb COPYONLY)

add_subdirectory(lv2)

else (LV2_FOUND)
message (FATAL_ERROR "lv2 package required but not found (version 1.0.0 needed)")
endif (LV2_FOUND)
endif (LV2Plugin)
21 changes: 21 additions & 0 deletions cmake_uninstall.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
if(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt")
message(FATAL_ERROR "Cannot find install manifest: @CMAKE_BINARY_DIR@/install_manifest.txt")
endif(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt")

file(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files)
string(REGEX REPLACE "\n" ";" files "${files}")
foreach(file ${files})
message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
exec_program(
"@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
OUTPUT_VARIABLE rm_out
RETURN_VALUE rm_retval
)
if(NOT "${rm_retval}" STREQUAL 0)
message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")
endif(NOT "${rm_retval}" STREQUAL 0)
else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
message(STATUS "File $ENV{DESTDIR}${file} does not exist.")
endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
endforeach(file)
14 changes: 7 additions & 7 deletions lv2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ cmake_minimum_required(VERSION 2.6)

project (rkrlv2)

set(LV2_INSTALL_DIR lib/lv2/rkr.lv2 ) # CACHE PATH "Specifies where the LV2 libraries should be installed")
#set(LV2_INSTALL_DIR lib/lv2/rkr.lv2 ) # CACHE PATH "Specifies where the LV2 libraries should be installed")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -O3 -msse -msse2 -mfpmath=sse -ffast-math")

# check for our various libraries
find_package(PkgConfig)
pkg_check_modules(LV2 REQUIRED lv2>=1.10.0)
pkg_check_modules(SAMPLERATE REQUIRED samplerate>=0.1.5)
pkg_check_modules(FFTW REQUIRED fftw3f;fftw3) # fftw3f for midiconverter
pkg_check_modules(SNDFILE REQUIRED sndfile)
#find_package(PkgConfig)
#pkg_check_modules(LV2 REQUIRED lv2>=1.10.0)
#pkg_check_modules(SAMPLERATE REQUIRED samplerate>=0.1.5)
#pkg_check_modules(FFTW REQUIRED fftw3f;fftw3) # fftw3f for midiconverter
#pkg_check_modules(SNDFILE REQUIRED sndfile)

include_directories (${LV2_INCLUDE_DIRS} ${SAMPLERATE_INCLUDE_DIRS} ${FFTW_INCLUDE_DIRS} ${SNDFILE_INCLUDE_DIRS} ../src)
link_directories (${LV2_LIBRARY_DIRS} ${SAMPLERATE_LIBRARY_DIRS} ${FFTW_LIBRARY_DIRS} ${SNDFILE_LIBRARY_DIRS})
Expand Down Expand Up @@ -96,7 +96,7 @@ set_target_properties(rkrlv2 PROPERTIES PREFIX "")

set_target_properties(rkrlv2 PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE)

target_link_libraries(rkrlv2 ${LV2_LIBRARIES} ${SAMPLERATE_LIBRARIES} ${FFTW_LIBRARIES} ${SNDFILE_LIBRARIES} )
target_link_libraries(rkrlv2 ${LV2_LIBRARIES} ${SAMPLERATE_LIBRARIES} ${FFTW3_LIBRARIES} ${FFTW3F_LIBRARIES} ${SNDFILE_LIBRARIES} )

# config install
install(TARGETS rkrlv2
Expand Down
53 changes: 3 additions & 50 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,39 +13,6 @@ set (CMAKE_SKIP_RULE_DEPENDENCY OFF)
# Rebuild objects if rules have changed, even if source hasn't.

message (STATUS "Building Rakarrack version ${VERSION} for ${CMAKE_SYSTEM_NAME}")
include (CheckCSourceCompiles)

option (BuildForDebug "Include gdb debugging support" OFF)
option (LV2Plugin "Build rakarack lv2 plugin interface" ON)
option (optimizations "Enable optimizations" ON)
option (vectorize "Enable vectorize" ON)
option (sse "Enable sse (default=automatic check)" ON)
option (sse2 "Enable sse2 (default=automatic check)" ON)
option (altivec "Enable altivec (default=automatic check)" ON)

# Check for jack session availability
check_c_source_compiles (
"#include <jack/session.h>
int main(int argc, char **argv)
{
jack_session_event_type_t x = JackSessionSave;
return 0;
}" HasJackSession
)

if (HasJackSession)
option (JackSessionSupport "Include Jack Session Support" ON)
else (HasJackSession)
set (JackSessionSupport OFF)
endif (HasJackSession)


find_package (PkgConfig REQUIRED)
if (PKG_CONFIG_FOUND)
message(STATUS "Found pkg-config ${PKG_CONFIG_EXECUTABLE}")
else (PKG_CONFIG_FOUND)
message(FATAL_ERROR "pkg-config required but not found")
endif (PKG_CONFIG_FOUND)


# fltk
Expand Down Expand Up @@ -321,22 +288,8 @@ target_sources(rakarrack PRIVATE
MIDIConverter.C
)

#FIXME
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -O3 -msse -msse2 -mfpmath=sse -ffast-math")

install (TARGETS rakarrack RUNTIME DESTINATION bin)

if (LV2Plugin)
if (EXISTS $ENV{LV2_PATH})
set(LV2_INSTALL_DIR $ENV{LV2_PATH} CACHE PATH
"Specifies where the LV2 libraries should be installed")
else()
set(LV2_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}/lv2 CACHE PATH
"Specifies where the LV2 libraries should be installed")
endif()

pkg_check_modules(LV2 REQUIRED lv2>=1.0.0)
if (LV2_FOUND)
message (STATUS "Found lv2 package ${LV2_VERSION}")
else (LV2_FOUND)
message (FATAL_ERROR "lv2 package required but not found (version 1.0.0 needed)")
endif (LV2_FOUND)
# add_subdirectory(../lv2)
endif (LV2Plugin)

0 comments on commit 539e5fc

Please sign in to comment.