It all builds on windows using CMake, although library exports must be set for the musik dll. Hopefully, I haven't broken the linux build

This commit is contained in:
urioxis 2011-02-23 13:15:27 +00:00
parent a339c6d45b
commit 6d88c691c2
9 changed files with 99 additions and 57 deletions

View File

@ -50,6 +50,9 @@ if(WIN32 AND NOT UNIX)
else (VLD_FOUND)
message(STATUS "VLD not found")
endif (VLD_FOUND)
add_definitions (
-DUNICODE
)
else(WIN32 AND NOT UNIX)
find_package(Boost 1.42.0 REQUIRED ${BOOST_LIBS})
if(Boost_FOUND)

View File

@ -15,11 +15,27 @@ set (3rdParty_SQLITE_SOURCES
src/sqlite/sqlite3.c
)
FILE(GLOB_RECURSE EXPAT_HEADERS include/expat/*.h)
FILE(GLOB_RECURSE EXPAT_SRC src/expat/*.c)
set (3rdParty_EXPAT_SOURCES
${EXPAT_HEADERS}
${EXPAT_SRC}
)
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 )
include_directories ( include/sqlite )
add_library( sqlite3 STATIC ${3rdParty_SQLITE_SOURCES} )
include_directories ( include/expat )
if (WIN32)
add_definitions(
-DHAVE_MEMMOVE
)
#Must find a better way of solving this
endif (WIN32)
add_library( expat STATIC ${3rdParty_EXPAT_SOURCES} )

View File

@ -23,6 +23,6 @@ add_definitions(
#include_directories( ../../core )
add_library( waveout SHARED ${waveout_SOURCES} )
target_link_libraries( waveout ${musikCube_LINK_LIBS})
target_link_libraries( waveout ${musikCube_LINK_LIBS} winmm)

View File

@ -139,11 +139,7 @@ set (CORE_HEADERS
xml/WriterNode.h
)
SOURCE_GROUP(audio FILES
audio/Buffer.cpp
audio/Player.cpp
audio/Stream.cpp
audio/Transport.cpp
SOURCE_GROUP("Header Files\\audio" FILES
audio/IAnalyzer.h
audio/IBuffer.h
audio/IDecoder.h
@ -154,28 +150,31 @@ SOURCE_GROUP(audio FILES
audio/Player.h
audio/Stream.h
audio/Transport.h)
SOURCE_GROUP(db FILES
db/CachedStatement.cpp
db/Connection.cpp
db/ScopedTransaction.cpp
db/Statement.cpp
SOURCE_GROUP("Source Files\\audio" FILES
audio/Buffer.cpp
audio/Player.cpp
audio/Stream.cpp
audio/Transport.cpp)
SOURCE_GROUP("Header Files\\db" FILES
db/CachedStatement.h
db/Connection.h
db/dbconfig.h
db/ScopedTransaction.h
db/Statement.h)
SOURCE_GROUP(filestreams FILES
filestreams/Factory.cpp
filestreams/LocalFileStream.cpp
SOURCE_GROUP("Source Files\\db" FILES
db/CachedStatement.cpp
db/Connection.cpp
db/ScopedTransaction.cpp
db/Statement.cpp)
SOURCE_GROUP("Header Files\\filestreams" FILES
filestreams/Factory.h
filestreams/IFileStream.h
filestreams/IFileStreamFactory.h
filestreams/LocalFileStream.h)
SOURCE_GROUP(http FILES
http/RequestParser.cpp
http/Responder.cpp
http/Server.cpp
http/TrackSender.cpp
SOURCE_GROUP("Source Files\\filestreams" FILES
filestreams/Factory.cpp
filestreams/LocalFileStream.cpp)
SOURCE_GROUP("Header Files\\http" FILES
http/IRequestParser.h
http/IRequestPlugin.h
http/IResponder.h
@ -183,23 +182,22 @@ SOURCE_GROUP(http FILES
http/Responder.h
http/Server.h
http/TrackSender.h)
SOURCE_GROUP(library FILES
Library/Base.cpp
Library/LocalDB.cpp
Library/Remote.cpp
SOURCE_GROUP("Source Files\\http" FILES
http/RequestParser.cpp
http/Responder.cpp
http/Server.cpp
http/TrackSender.cpp)
SOURCE_GROUP("Header Files\\library" FILES
Library/Base.h
Library/LocalDB.h
Library/Remote.h)
SOURCE_GROUP(plugin FILES
SOURCE_GROUP("Source Files\\library" FILES
Library/Base.cpp
Library/LocalDB.cpp
Library/Remote.cpp)
SOURCE_GROUP("Header Files\\plugin" FILES
Plugin/IMetaDataReader.h)
SOURCE_GROUP(query FILES
Query/Base.cpp
Query/Factory.cpp
Query/ListBase.cpp
Query/ListSelection.cpp
Query/SortTracks.cpp
Query/SortTracksWithData.cpp
Query/TrackMetadata.cpp
SOURCE_GROUP("Header Files\\query" FILES
Query/Base.h
Query/Factory.h
Query/ListBase.h
@ -210,27 +208,31 @@ SOURCE_GROUP(query FILES
Query/SortTracks.h
Query/SortTracksWithData.h
Query/TrackMetadata.h)
SOURCE_GROUP(server FILES
server/Connection.cpp
server/User.cpp
server/UserSession.cpp
SOURCE_GROUP("Source Files\\query" FILES
Query/Base.cpp
Query/Factory.cpp
Query/ListBase.cpp
Query/ListSelection.cpp
Query/SortTracks.cpp
Query/SortTracksWithData.cpp
Query/TrackMetadata.cpp)
SOURCE_GROUP("Header Files\\server" FILES
server/Connection.h
server/User.h
server/UserSession.h)
SOURCE_GROUP(tracklist FILES
tracklist/Base.cpp
tracklist/LibraryList.cpp
tracklist/MultiLibraryList.cpp
SOURCE_GROUP("Source Files\\server" FILES
server/Connection.cpp
server/User.cpp
server/UserSession.cpp)
SOURCE_GROUP("Header Files\\tracklist" FILES
tracklist/Base.h
tracklist/LibraryList.h
tracklist/MultiLibraryList.h)
SOURCE_GROUP(xml FILES
xml/Node.cpp
xml/Parser.cpp
xml/ParserNode.cpp
xml/Socket.cpp
xml/Writer.cpp
xml/WriterNode.cpp
SOURCE_GROUP("Source Files\\tracklist" FILES
tracklist/Base.cpp
tracklist/LibraryList.cpp
tracklist/MultiLibraryList.cpp)
SOURCE_GROUP("Header Files\\xml" FILES
xml/IReadSupplier.h
xml/IWriteSupplier.h
xml/Node.h
@ -239,6 +241,13 @@ SOURCE_GROUP(xml FILES
xml/Socket.h
xml/Writer.h
xml/WriterNode.h)
SOURCE_GROUP("Source Files\\xml" FILES
xml/Node.cpp
xml/Parser.cpp
xml/ParserNode.cpp
xml/Socket.cpp
xml/Writer.cpp
xml/WriterNode.cpp)
if(CMAKE_SYSTEM_NAME MATCHES "Windows")
@ -263,6 +272,6 @@ add_definitions(
)
add_library( musik SHARED ${CORE_SOURCES} ${CORE_HEADERS})
target_link_libraries( musik ${musikCube_LINK_LIBS})
target_link_libraries( musik ${musikCube_LINK_LIBS} expat)

View File

@ -61,7 +61,7 @@ namespace musik{ namespace core{
private:
#ifdef WIN32
typedef musik::core::IPlugin* STDCALL((* CallGetPlugin)());
typedef musik::core::IPlugin* STDCALL(CallGetPlugin);
#endif
PluginFactory(void);
@ -97,7 +97,7 @@ namespace musik{ namespace core{
template <class T, class D> std::vector< boost::shared_ptr<T> > QueryInterface(const char* functionName){
boost::mutex::scoped_lock lock(this->mutex);
typedef T* STDCALL((* PluginInterfaceCall)());
typedef T* STDCALL(PluginInterfaceCall);
std::vector< boost::shared_ptr<T> > plugins;
HandleList& allDlls = PluginFactory::sInstance.loadedDLLs;

View File

@ -54,7 +54,7 @@
#endif
typedef unsigned __int64 UINT64;
#define STDCALL(fp) __stdcall fp
#define STDCALL(fp) (__stdcall* fp)()
#else
#include <cassert>
@ -62,7 +62,7 @@
typedef unsigned long long UINT64;
typedef long long __int64; //TODO: Is this necessary?
#define STDCALL(fp) fp __attribute__((stdcall))
#define STDCALL(fp) (* fp)() __attribute__((stdcall))
#define _ASSERT assert
#define TEXT(s) s //There's no TEXT() on linux. This makes the current uses of it compile for me... Jooles
@ -108,13 +108,13 @@ typedef unsigned int DBTIME;
///\brief
///utfstringstream is the stringstream for utfchar & utfstring
//////////////////////////////////////////
/* namespace std
namespace std
{
typedef wstringstream utfstringstream;
typedef wostringstream utfostringstream;
typedef wistringstream utfistringstream;
}
*/
#else
#undef UTF_WIDECHAR

View File

@ -5,5 +5,16 @@ set (SQUARE_SRCS
ConsoleUI.cpp
)
add_executable(square ${SQUARE_SRCS})
set (SQUARE_HEADERS
config.h
ConsoleUI.h
DummyAudioEventHandler.h
memtrace.h
stdafx.h
)
SOURCE_GROUP (source FILES ${SQUARE_SRCS})
SOURCE_GROUP (headers FILES ${SQUARE_HEADERS})
add_executable(square ${SQUARE_SRCS} ${SQUARE_HEADERS})
target_link_libraries(square ${musikCube_LINK_LIBS} musik)

View File

@ -193,7 +193,11 @@ void ConsoleUI::PlayFile(Args args)
transport.Start(filename.c_str()); //TODO: fix to use TrackPtr
if (delay)
{
#ifdef WIN32
Sleep(delay);
#else
sleep(delay);
#endif
}
}
}

View File

@ -9,7 +9,6 @@
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#include <windows.h>
#include <vld/vld.h>
#include "config.h"