2016-06-26 23:40:14 +00:00
|
|
|
#cmake -DCMAKE_BUILD_TYPE=Release .
|
|
|
|
#cmake -DCMAKE_BUILD_TYPE=Debug .
|
2017-02-20 03:18:38 +00:00
|
|
|
#cmake -DGENERATE_DEB=1 -DDEB_ARCHITECTURE=i386|amd64|armhf -DDEB_BOOST_VERSION=1.55.0 -DCMAKE_INSTALL_PREFIX=/usr .
|
2016-06-26 23:40:14 +00:00
|
|
|
|
2016-05-26 05:02:09 +00:00
|
|
|
cmake_minimum_required(VERSION 3.0)
|
2009-05-06 09:12:12 +00:00
|
|
|
|
2016-05-26 05:02:09 +00:00
|
|
|
project(musikbox)
|
|
|
|
set (musikbox_VERSION_MAJOR 0)
|
2017-02-19 23:54:25 +00:00
|
|
|
set (musikbox_VERSION_MINOR 9)
|
|
|
|
set (musikbox_VERSION_PATCH 0)
|
2017-02-20 05:02:29 +00:00
|
|
|
set (musikbox_VERSION "${musikbox_VERSION_MAJOR}.${musikbox_VERSION_MINOR}.${musikbox_VERSION_PATCH}")
|
2016-05-26 05:02:09 +00:00
|
|
|
|
2016-06-10 05:31:27 +00:00
|
|
|
include(ExternalProject)
|
|
|
|
|
|
|
|
ExternalProject_Add(taglib
|
|
|
|
SOURCE_DIR "${musikbox_SOURCE_DIR}/src/contrib/taglib_plugin/taglib-1.11"
|
|
|
|
BUILD_IN_SOURCE 0
|
|
|
|
DOWNLOAD_COMMAND ""
|
|
|
|
UPDATE_COMMAND ""
|
|
|
|
CMAKE_ARGS "-DCMAKE_INSTALL_PREFIX:PATH=${musikbox_SOURCE_DIR}/src/contrib/taglib_plugin/taglib-1.11/stage/"
|
|
|
|
INSTALL_COMMAND make install
|
|
|
|
)
|
|
|
|
|
2017-02-04 02:13:25 +00:00
|
|
|
set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-std=c++11 -Wno-unused-result -Wno-deprecated-declarations")
|
2016-06-26 23:40:14 +00:00
|
|
|
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g")
|
|
|
|
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2")
|
2009-07-18 11:50:49 +00:00
|
|
|
|
|
|
|
set (BOOST_LIBS
|
2016-05-26 05:02:09 +00:00
|
|
|
system
|
|
|
|
filesystem
|
|
|
|
thread
|
2009-07-18 11:50:49 +00:00
|
|
|
)
|
|
|
|
|
2016-07-14 05:36:08 +00:00
|
|
|
find_package(Boost 1.55.0 REQUIRED ${BOOST_LIBS})
|
2016-05-26 05:02:09 +00:00
|
|
|
|
|
|
|
add_definitions (-DHAVE_BOOST
|
|
|
|
-D_FILE_OFFSET_BITS=64)
|
|
|
|
set (BOOST_LINK_LIBS
|
|
|
|
${Boost_LIBRARIES})
|
2011-02-17 00:22:30 +00:00
|
|
|
|
2016-05-27 07:22:26 +00:00
|
|
|
#message(STATUS "boost libs: " ${BOOST_LINK_LIBS})
|
|
|
|
#message(STATUS "boost includes: " ${Boost_INCLUDE_DIRS})
|
2016-05-26 05:02:09 +00:00
|
|
|
|
|
|
|
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/Modules)
|
2009-07-18 11:50:49 +00:00
|
|
|
|
2016-06-26 23:40:14 +00:00
|
|
|
# SET (CMAKE_BUILD_TYPE DEBUG)
|
2016-05-26 05:02:09 +00:00
|
|
|
set (LIBRARY_OUTPUT_PATH ${musikbox_SOURCE_DIR}/bin/plugins)
|
|
|
|
set (EXECUTABLE_OUTPUT_PATH ${musikbox_SOURCE_DIR}/bin)
|
2009-07-18 11:50:49 +00:00
|
|
|
|
2016-06-10 05:31:27 +00:00
|
|
|
link_directories (
|
|
|
|
${musikbox_SOURCE_DIR}/bin/plugins
|
|
|
|
${musikbox_SOURCE_DIR}/src/contrib/taglib_plugin/taglib-1.11/stage/lib
|
|
|
|
)
|
2009-07-18 11:50:49 +00:00
|
|
|
|
2016-05-26 05:02:09 +00:00
|
|
|
set (musikbox_LINK_LIBS
|
|
|
|
${linux_LINK_LIBS}
|
|
|
|
${BOOST_LINK_LIBS}
|
2016-05-26 17:02:31 +00:00
|
|
|
dl
|
2009-07-18 11:50:49 +00:00
|
|
|
)
|
|
|
|
|
2011-02-10 13:11:38 +00:00
|
|
|
include_directories (
|
2016-05-26 05:02:09 +00:00
|
|
|
"${musikbox_SOURCE_DIR}/src"
|
|
|
|
"${musikbox_SOURCE_DIR}/src/core"
|
2016-05-26 06:31:15 +00:00
|
|
|
"${musikbox_SOURCE_DIR}/src/musikbox"
|
2016-05-26 05:02:09 +00:00
|
|
|
"${musikbox_SOURCE_DIR}/src/3rdparty/include"
|
2016-06-10 05:31:27 +00:00
|
|
|
"${musikbox_SOURCE_DIR}/src/contrib/taglib_plugin/taglib-1.11/stage/include"
|
2016-05-26 05:02:09 +00:00
|
|
|
)
|
2009-05-06 09:12:12 +00:00
|
|
|
|
2016-09-21 00:47:48 +00:00
|
|
|
# "/usr/local" doesn't seem to be included by default on macOS 10.12+
|
|
|
|
if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
2016-11-08 23:15:36 +00:00
|
|
|
link_directories ("/usr/local/lib")
|
|
|
|
include_directories("/usr/local/include")
|
2016-09-21 00:47:48 +00:00
|
|
|
endif (CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
|
|
|
|
2009-05-06 09:12:12 +00:00
|
|
|
add_subdirectory(src/core)
|
2017-01-07 02:27:08 +00:00
|
|
|
add_subdirectory(src/glue)
|
2016-05-26 06:31:15 +00:00
|
|
|
add_subdirectory(src/musikbox)
|
2016-05-26 17:02:31 +00:00
|
|
|
add_subdirectory(src/contrib/taglib_plugin)
|
2016-06-05 04:25:43 +00:00
|
|
|
add_subdirectory(src/contrib/m4adecoder)
|
2016-05-27 07:22:26 +00:00
|
|
|
add_subdirectory(src/contrib/oggdecoder)
|
2016-12-14 04:40:48 +00:00
|
|
|
add_subdirectory(src/contrib/nomaddecoder)
|
2016-05-28 20:51:54 +00:00
|
|
|
add_subdirectory(src/contrib/flacdecoder)
|
2017-01-14 19:52:53 +00:00
|
|
|
add_subdirectory(src/contrib/nullout)
|
2017-02-15 06:16:17 +00:00
|
|
|
add_subdirectory(src/contrib/websocket_remote)
|
2016-06-05 20:06:32 +00:00
|
|
|
|
2016-08-29 08:05:50 +00:00
|
|
|
add_dependencies(taglibreader taglib)
|
|
|
|
|
2016-06-05 20:06:32 +00:00
|
|
|
if (CMAKE_SYSTEM_NAME MATCHES "Linux")
|
2016-06-09 03:32:43 +00:00
|
|
|
add_subdirectory(src/contrib/alsaout)
|
2016-12-06 01:00:13 +00:00
|
|
|
add_subdirectory(src/contrib/pulseout)
|
2016-06-05 20:06:32 +00:00
|
|
|
else (CMAKE_SYSTEM_NAME MATCHES "Linux")
|
2016-08-28 18:46:43 +00:00
|
|
|
# macos
|
2016-06-05 20:06:32 +00:00
|
|
|
add_subdirectory(src/contrib/coreaudioout)
|
|
|
|
endif (CMAKE_SYSTEM_NAME MATCHES "Linux")
|
2016-08-28 18:46:43 +00:00
|
|
|
|
|
|
|
# install the binary
|
|
|
|
install(
|
|
|
|
FILES bin/musikbox DESTINATION share/musikcube
|
|
|
|
PERMISSIONS
|
|
|
|
OWNER_EXECUTE OWNER_READ OWNER_WRITE
|
|
|
|
GROUP_EXECUTE GROUP_READ GROUP_WRITE
|
|
|
|
WORLD_EXECUTE WORLD_READ
|
|
|
|
)
|
|
|
|
|
|
|
|
# install the plugins
|
|
|
|
if (CMAKE_SYSTEM_NAME MATCHES "Linux")
|
|
|
|
# linux
|
|
|
|
install(
|
|
|
|
FILES
|
|
|
|
bin/plugins/libalsaout.so
|
2016-12-06 01:00:13 +00:00
|
|
|
bin/plugins/libpulseout.so
|
2017-01-14 22:43:32 +00:00
|
|
|
bin/plugins/libnullout.so
|
2016-08-28 18:46:43 +00:00
|
|
|
bin/plugins/libflacdecoder.so
|
|
|
|
bin/plugins/libm4adecoder.so
|
2016-12-15 06:06:56 +00:00
|
|
|
bin/plugins/libnomaddecoder.so
|
2016-08-28 18:46:43 +00:00
|
|
|
bin/plugins/liboggdecoder.so
|
|
|
|
bin/plugins/libtaglibreader.so
|
2017-02-15 06:16:17 +00:00
|
|
|
bin/plugins/libwebsocket_remote.so
|
2016-08-28 18:46:43 +00:00
|
|
|
DESTINATION share/musikcube/plugins
|
|
|
|
)
|
|
|
|
else (CMAKE_SYSTEM_NAME MATCHES "Linux")
|
|
|
|
# macos
|
|
|
|
install(
|
|
|
|
FILES
|
|
|
|
bin/plugins/libcoreaudioout.dylib
|
2017-01-14 22:43:32 +00:00
|
|
|
bin/plugins/libnullout.dylib
|
2016-08-28 18:46:43 +00:00
|
|
|
bin/plugins/libflacdecoder.dylib
|
|
|
|
bin/plugins/libm4adecoder.dylib
|
2016-12-15 06:06:56 +00:00
|
|
|
bin/plugins/libnomaddecoder.dylib
|
2016-08-28 18:46:43 +00:00
|
|
|
bin/plugins/liboggdecoder.dylib
|
|
|
|
bin/plugins/libtaglibreader.dylib
|
2017-02-15 06:16:17 +00:00
|
|
|
bin/plugins/libwebsocket_remote.dylib
|
2016-08-28 18:46:43 +00:00
|
|
|
DESTINATION share/musikcube/plugins
|
|
|
|
)
|
|
|
|
endif (CMAKE_SYSTEM_NAME MATCHES "Linux")
|
|
|
|
|
2016-11-08 20:34:06 +00:00
|
|
|
file(GLOB sdk_headers "src/core/sdk/*.h")
|
|
|
|
|
|
|
|
install(
|
|
|
|
FILES ${sdk_headers}
|
|
|
|
DESTINATION include/musikcube/core/sdk
|
|
|
|
)
|
|
|
|
|
2016-11-08 23:15:36 +00:00
|
|
|
# shell script that starts the app.
|
|
|
|
install(
|
|
|
|
FILES src/musikbox/musikbox
|
|
|
|
DESTINATION bin/
|
|
|
|
PERMISSIONS
|
|
|
|
OWNER_EXECUTE OWNER_READ OWNER_WRITE
|
|
|
|
GROUP_EXECUTE GROUP_READ GROUP_WRITE
|
|
|
|
WORLD_EXECUTE WORLD_READ
|
2016-11-27 17:29:42 +00:00
|
|
|
)
|
2017-02-19 23:54:25 +00:00
|
|
|
|
|
|
|
if (GENERATE_DEB MATCHES "1")
|
|
|
|
if (CMAKE_SYSTEM_NAME MATCHES "Linux")
|
|
|
|
set(CPACK_GENERATOR "DEB")
|
|
|
|
set(CPACK_PACKAGE_DESCRIPTION "musikbox, a terminal-based music player and library")
|
|
|
|
set(CPACK_PACKAGE_VERSION_MAJOR "${musikbox_VERSION_MAJOR}")
|
|
|
|
set(CPACK_PACKAGE_VERSION_MINOR "${musikbox_VERSION_MINOR}")
|
|
|
|
set(CPACK_PACKAGE_VERSION_PATCH "${musikbox_VERSION_PATCH}")
|
2017-02-20 07:16:33 +00:00
|
|
|
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libboost-thread${DEB_BOOST_VERSION}, libboost-system${DEB_BOOST_VERSION}, libboost-filesystem${DEB_BOOST_VERSION}, libboost-date-time${DEB_BOOST_VERSION}, libboost-atomic${DEB_BOOST_VERSION}, libboost-chrono${DEB_BOOST_VERSION}, libogg0, libvorbis0a, libvorbisfile3, libflac8, libfaad2, libncursesw5, libasound2, libpulse0, pulseaudio")
|
2017-02-19 23:54:25 +00:00
|
|
|
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "casey langen")
|
|
|
|
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE ${DEB_ARCHITECTURE})
|
2017-02-20 05:02:29 +00:00
|
|
|
set(CPACK_PACKAGE_FILE_NAME "musikbox_${musikbox_VERSION}_${DEB_ARCHITECTURE}")
|
2017-02-19 23:54:25 +00:00
|
|
|
include(CPack)
|
|
|
|
endif()
|
2017-02-20 03:58:10 +00:00
|
|
|
endif()
|