diff --git a/CMakeLists.txt b/CMakeLists.txt index 9008d200f..d272dc5de 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,6 +4,7 @@ project( musikCube ) set ( musikCube_VERSION_MAJOR 2) set ( musikCube_VERSION_MINOR 0) +set (CMAKE_MODULE_PATH ${musikCube_SOURCE_DIR}/modules) set (BOOST_LIBS system @@ -14,6 +15,8 @@ thread regex ) +include_directories(${musikCube_SOURCE_DIR}/src/3rdparty/lib) + set (Boost_ADDITIONAL_VERSIONS "1.37.0" ) if(WIN32 AND NOT UNIX) find_package(Boost 1.42.0 REQUIRED ${BOOST_LIBS} ) @@ -34,6 +37,15 @@ if(WIN32 AND NOT UNIX) ) include_directories ("${musikCube_SOURCE_DIR}/src/3rdparty/boost") endif (Boost_FOUND) + set (VLD_ROOT_DIR ${musikCube_SOURCE_DIR}/src/3rdparty/lib) + set (VLD_INCLUDE_DIR ${musikCube_SOURCE_DIR}/src/3rdparty/include) + find_package(vld REQUIRED) + if (VLD_FOUND) + message(STATUS "VLD Found") + link_directories(${VLD_LIBRARIES_DIR}) + else (VLD_FOUND) + message(STATUS "VLD not found") + endif (VLD_FOUND) else(WIN32 AND NOT UNIX) find_package(Boost 1.42.0 REQUIRED ${BOOST_LIBS}) if(Boost_FOUND) @@ -84,6 +96,7 @@ set (musikCube_LINK_LIBS include_directories ( "${musikCube_SOURCE_DIR}/src" "${musikCube_SOURCE_DIR}/src/core" + "${musikCube_SOURCE_DIR}/src/core/audio" "${musikCube_SOURCE_DIR}/src/3rdparty/include") add_subdirectory(src/3rdparty) diff --git a/modules/findvld.cmake b/modules/findvld.cmake new file mode 100644 index 000000000..0d6dfbb4f --- /dev/null +++ b/modules/findvld.cmake @@ -0,0 +1,104 @@ +# Module for locating the Visual Leak Detector. +# +# Cutomizable variables: +# VLD_ROOT_DIR +# This variable points to the Visual Leak Detector root directory. By +# default, the module looks for the installation directory by examining the +# Program Files/Program Files (x86) folders. +# +# Read-Only variables: +# VLD_FOUND +# Indicates that the library has been found. +# +# VLD_INCLUDE_DIR +# Points to the Visual Leak Detector include directory. +# +# VLD_LIBRARIES +# Points to the Visual Leak Detector libraries that can be passed to +# target_link_libararies. +# +# VLD_LIBRARIES_DIR +# Points to the Visual Leak Detector directory that contains the libraries. +# The content of this variable can be passed to link_directories. +# +# Copyright (c) 2010 Sergiu Dotenco +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +INCLUDE (FindPackageHandleStandardArgs) + +SET (_VLD_POSSIBLE_DIRS + ${VLD_ROOT_DIR} + "$ENV{PROGRAMFILES}/Visual Leak Detector" + "$ENV{PROGRAMFILES(X86)}/Visual Leak Detector") + +SET (_VLD_POSSIBLE_INCLUDE_SUFFIXES + include) + +SET (_VLD_POSSIBLE_LIB_SUFFIXES + lib) + +# Version 2.0 uses vld_x86 and vld_x64 instead of simply vld as library names +IF (CMAKE_SIZEOF_VOID_P EQUAL 4) + LIST (APPEND _VLD_POSSIBLE_LIB_SUFFIXES lib/Win32) +ELSEIF (CMAKE_SIZEOF_VOID_P EQUAL 8) + LIST (APPEND _VLD_POSSIBLE_LIB_SUFFIXES lib/Win64) +ENDIF (CMAKE_SIZEOF_VOID_P EQUAL 4) + +FIND_PATH (VLD_ROOT_DIR + NAMES include/vld.h + PATHS ${_VLD_POSSIBLE_DIRS} + DOC "VLD root directory") + +FIND_PATH (VLD_INCLUDE_DIR + NAMES vld.h + PATHS ${VLD_ROOT_DIR} + PATH_SUFFIXES ${_VLD_POSSIBLE_INCLUDE_SUFFIXES} + DOC "VLD include directory") + +FIND_PATH (VLD_LIBRARIES_DIR + NAMES vld.lib + PATHS ${VLD_ROOT_DIR} + PATH_SUFFIXES ${_VLD_POSSIBLE_LIB_SUFFIXES} + DOC "VLD libraries directory") + +IF (MSVC) + FIND_LIBRARY (VLD_LIBRARIES_DEBUG + NAMES vld + PATHS ${VLD_ROOT_DIR} + PATH_SUFFIXES ${_VLD_POSSIBLE_LIB_SUFFIXES} + DOC "VLD libraries") + + SET (VLD_LIBRARIES debug ${VLD_LIBRARIES_DEBUG}) +ENDIF (MSVC) + +FIND_PACKAGE_HANDLE_STANDARD_ARGS (VLD DEFAULT_MSG + VLD_INCLUDE_DIR VLD_LIBRARIES) + +IF (NOT VLD_FOUND) + IF (NOT PACKAGE_FIND_QUIETLY) + IF (PACKAGE_FIND_REQUIRED) + MESSAGE (FATAL_ERROR + "VLD required but some files were not found. " + "Specify the VLD location using VLD_ROOT_DIR") + ENDIF (PACKAGE_FIND_REQUIRED) + ENDIF (NOT PACKAGE_FIND_QUIETLY) +ENDIF (NOT VLD_FOUND) + +MARK_AS_ADVANCED (VLD_INCLUDE_DIR VLD_LIBRARIES VLD_LIBRARIES_DIR) diff --git a/src/3rdparty/CMakeLists.txt b/src/3rdparty/CMakeLists.txt index a62abec74..3ff7bc7a9 100644 --- a/src/3rdparty/CMakeLists.txt +++ b/src/3rdparty/CMakeLists.txt @@ -15,8 +15,11 @@ set (3rdParty_SQLITE_SOURCES src/sqlite/sqlite3.c ) +set (ZLIB_INCLUDE_DIR ${musikCube_SOURCE_DIRECTORY}/src/3rdparty/include) +set (ZLIB_LIBRARY ${musikCube_SOURCE_DIRECTORY}/src/3rdparty/lib) + include_directories ( include/md5 ) add_library( md5 STATIC ${3rdParty_MD5_SOURCES} ) include_directories ( include/sqlite ) -target_link_libraries ( lib/vld ) + add_library( sqlite3 STATIC ${3rdParty_SQLITE_SOURCES} ) diff --git a/src/contrib/CMakeLists.txt b/src/contrib/CMakeLists.txt index 61901cf9a..1d01b124d 100644 --- a/src/contrib/CMakeLists.txt +++ b/src/contrib/CMakeLists.txt @@ -12,15 +12,15 @@ add_subdirectory( flacdecoder ) #find_package(Taglib) add_definitions(-D_HAVE_TAGLIB) add_subdirectory( taglib_plugin ) -if(CMAKE_SYSTEM_NAME MATCHES "Windows") +if(WIN32 AND NOT UNIX) add_subdirectory( waveout ) add_subdirectory( mp3decoder ) # if(NOT DEFINED MINGW) # # endif(NOT DEFINED MINGW) -else(CMAKE_SYSTEM_NAME MATCHES "Windows") +else(WIN32 AND NOT UNIX) # add_subdirectory( alsaout ) add_subdirectory( esdout ) add_subdirectory( mpg123decoder ) -endif(CMAKE_SYSTEM_NAME MATCHES "Windows") +endif(WIN32 AND NOT UNIX) diff --git a/src/contrib/mp3decoder/CMakeLists.txt b/src/contrib/mp3decoder/CMakeLists.txt index 1c4c3fe6e..6aafac823 100644 --- a/src/contrib/mp3decoder/CMakeLists.txt +++ b/src/contrib/mp3decoder/CMakeLists.txt @@ -1,4 +1,4 @@ -set ( mpg123decoder_SOURCES +set ( mp3decoder_SOURCES BaseDecoder.cpp BitStream.cpp CRC.cpp @@ -14,9 +14,6 @@ set ( mpg123decoder_SOURCES if(CMAKE_SYSTEM_NAME MATCHES "Windows") add_definitions(-DWIN32) - if(NOT DEFINED MINGW) - - endif(NOT DEFINED MINGW) else(CMAKE_SYSTEM_NAME MATCHES "Windows") set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} -fpermissive) endif(CMAKE_SYSTEM_NAME MATCHES "Windows") @@ -27,7 +24,7 @@ add_definitions( -D_DEBUG ) -add_library( mpg123decoder SHARED ${mpg123decoder_SOURCES} ) -target_link_libraries( mpg123decoder ${musikCube_LINK_LIBS} ) +add_library( mp3decoder SHARED ${mp3decoder_SOURCES} ) +target_link_libraries( mp3decoder ${musikCube_LINK_LIBS} ) diff --git a/src/contrib/mp3decoder/MP3SourceSupplier.h b/src/contrib/mp3decoder/MP3SourceSupplier.h index 4971d459c..bb97275d5 100644 --- a/src/contrib/mp3decoder/MP3SourceSupplier.h +++ b/src/contrib/mp3decoder/MP3SourceSupplier.h @@ -33,7 +33,7 @@ #pragma once -#include +#include using namespace musik::core::audio; diff --git a/src/contrib/taglib_plugin/CMakeLists.txt b/src/contrib/taglib_plugin/CMakeLists.txt index 40df01b07..bebb9af7b 100644 --- a/src/contrib/taglib_plugin/CMakeLists.txt +++ b/src/contrib/taglib_plugin/CMakeLists.txt @@ -28,6 +28,7 @@ include_directories( ${musikCube_SOURCE_DIR}/src/contrib/taglib_plugin/taglib-1. include_directories( ${musikCube_SOURCE_DIR}/src/contrib/taglib_plugin/taglib-1.6.3/taglib/mpeg/id3v2 ) include_directories( ${musikCube_SOURCE_DIR}/src/contrib/taglib_plugin/taglib-1.6.3/taglib/mpeg/id3v2/frames ) + add_library( taglib_plugin SHARED ${taglib_plugin_SOURCES} ) target_link_libraries( taglib_plugin ${musikCube_LINK_LIBS} tag) diff --git a/src/contrib/taglib_plugin/taglib-1.6.3/CMakeLists.txt b/src/contrib/taglib_plugin/taglib-1.6.3/CMakeLists.txt index 5c238a7a8..0b5367f2e 100644 --- a/src/contrib/taglib_plugin/taglib-1.6.3/CMakeLists.txt +++ b/src/contrib/taglib_plugin/taglib-1.6.3/CMakeLists.txt @@ -31,7 +31,7 @@ endif (CMAKE_COMPILER_IS_GNUCXX) if(MSVC) if (MSVC_VERSION GREATER 1399) # If using Visual C++ 2005 (MSVC80) and greater (MSVC_VERSION=1400) - add_definitions(/D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE /Zc:wchar_t-) + add_definitions(/D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE) endif (MSVC_VERSION GREATER 1399) endif(MSVC) if (WIN32)