diff --git a/CMakeLists.txt b/CMakeLists.txt index 59ac337..f4a783f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,6 +29,7 @@ option(BUILD_TOOLS "Build Tools" 0) find_package(Platform REQUIRED) +find_package(OpenSSL REQUIRED) # VS100 uses MSBuild.exe instead of devenv.com, so force it to use devenv.com if(WIN32 AND MSVC_VERSION MATCHES 1600) @@ -78,9 +79,8 @@ if(CMAKE_INSTALL_PREFIX STREQUAL "/usr/local") endif() -if(UNIX) - find_package(OpenSSL REQUIRED) -endif() + + message("") message("Install binaries to : ${CMAKE_INSTALL_PREFIX}") diff --git a/cmake/FindVisualStudio2010.cmake b/cmake/FindVisualStudio2010.cmake new file mode 100644 index 0000000..343403d --- /dev/null +++ b/cmake/FindVisualStudio2010.cmake @@ -0,0 +1,20 @@ +# This module defines +# VS_DEVENV, path to devenv.com. + +FIND_PATH(VS100_DIR devenv.com + $ENV{VS100COMNTOOLS}/../IDE + "C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\Common7\\IDE" + "C:\\Program Files\\Microsoft Visual Studio 10.0\\Common7\\IDE" + "C:\\Programme\\Microsoft Visual Studio 10.0\\Common7\\IDE" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\VisualStudio\\10.0\\Setup\\VS;EnvironmentDirectory]" +) + +SET(VS100_FOUND 0) +IF(VS100_DIR) + SET(VS100_FOUND 1) + MESSAGE(STATUS "Found Visual Studion 2010") +ENDIF(VS100_DIR) + +MARK_AS_ADVANCED( + VS100_DIR +) diff --git a/src/Client/CMakeLists.txt b/src/Client/CMakeLists.txt index 82dd167..a40a229 100644 --- a/src/Client/CMakeLists.txt +++ b/src/Client/CMakeLists.txt @@ -1,11 +1,23 @@ include_directories (${PROJECT_SOURCE_DIR}/src/dep/include ${PROJECT_SOURCE_DIR}/src/shared ${PROJECT_SOURCE_DIR}/src/Client) +set(PSEUWOW_LIBS +PseuGUI DefScript irrKlang irrlicht shared zthread StormLib zlib ${OPENSSL_LIBRARIES} ${OPENSSL_EXTRA_LIBRARIES} +) + +link_directories (${CMAKE_INSTALL_PREFIX}) +if(WIN32) + link_directories (${PROJECT_SOURCE_DIR}/src/dep/lib/static) + set(PSEUWOW_LIBS ${PSEUWOW_LIBS} Winmm) +endif() +if(UNIX) + set(EXECUTABLE_LINK_FLAGS "-pthread") + set(PSEUWOW_LIBS ${PSEUWOW_LIBS} GL Xxf86vm bz2) +endif() + add_subdirectory (DefScript) add_subdirectory (GUI) -if(UNIX) - set(EXECUTABLE_LINK_FLAGS "-pthread") -endif() + add_executable (pseuwow Realm/RealmSession.cpp @@ -42,7 +54,9 @@ RemoteController.cpp SCPDatabase.cpp ) + + # Link the executable to the libraries. -target_link_libraries (pseuwow PseuGUI DefScript irrklang irrlicht GL Xxf86vm shared zthread StormLib zlib bz2 ssh crypto) +target_link_libraries (pseuwow ${PSEUWOW_LIBS}) install(TARGETS pseuwow DESTINATION ${CMAKE_INSTALL_PREFIX}) diff --git a/src/Client/World/WorldSession.cpp b/src/Client/World/WorldSession.cpp index 01fc73e..eb74d45 100644 --- a/src/Client/World/WorldSession.cpp +++ b/src/Client/World/WorldSession.cpp @@ -1,4 +1,3 @@ -#define _DEBUG 1 #include "common.h" #include "Auth/Sha1.h" diff --git a/src/dep/src/StormLib/CMakeLists.txt b/src/dep/src/StormLib/CMakeLists.txt index eb39c40..3e3fc87 100644 --- a/src/dep/src/StormLib/CMakeLists.txt +++ b/src/dep/src/StormLib/CMakeLists.txt @@ -1,5 +1,6 @@ include_directories (${PROJECT_SOURCE_DIR}/src/dep/include) -add_library(StormLib huffman/huff.cpp + +set(STORMLIB_SOURCES huffman/huff.cpp wave/wave.cpp SAttrFile.cpp SCommon.cpp @@ -12,9 +13,32 @@ add_library(StormLib huffman/huff.cpp SFileOpenFileEx.cpp SFileReadFile.cpp SListFile.cpp - StormPortLinux.cpp pklib/crc32_pk.c pklib/explode.c pklib/implode.c misc/crc32.cpp - misc/md5.cpp) \ No newline at end of file + misc/md5.cpp) + +if(UNIX) + set(STORMLIB_SOURCES ${STORMLIB_SOURCES} StormPortLinux.cpp) +endif() + +if(WIN32) + set(STORMLIB_SOURCES ${STORMLIB_SOURCES} + bzip2/blocksort.c + bzip2/bzip2.c + bzip2/bzip2recover.c + bzip2/bzlib.c + bzip2/compress.c + bzip2/crctable.c + bzip2/decompress.c + bzip2/dlltest.c + bzip2/huffman.c + bzip2/mk251.c + bzip2/randtable.c + bzip2/spewG.c + bzip2/unzcrash.c +) +endif() + +add_library(StormLib ${STORMLIB_SOURCES}) \ No newline at end of file diff --git a/src/dep/src/StormLib/StormLib.h b/src/dep/src/StormLib/StormLib.h index 0a70288..849018e 100644 --- a/src/dep/src/StormLib/StormLib.h +++ b/src/dep/src/StormLib/StormLib.h @@ -73,21 +73,21 @@ // Z - S for static C library, D for multithreaded DLL C-library // -#if defined(_MSC_VER) && !defined (__STORMLIB_SELF__) - #ifdef _DEBUG // DEBUG VERSIONS - #ifdef _DLL - #pragma comment(lib, "StormLibDAD.lib") // Debug Ansi Dynamic version - #else - #pragma comment(lib, "StormLibDAS.lib") // Debug Ansi Static version - #endif - #else // RELEASE VERSIONS - #ifdef _DLL - #pragma comment(lib, "StormLibRAD.lib") // Release Ansi Dynamic version - #else - #pragma comment(lib, "StormLibRAS.lib") // Release Ansi Static version - #endif - #endif -#endif +// #if defined(_MSC_VER) && !defined (__STORMLIB_SELF__) +// #ifdef _DEBUG // DEBUG VERSIONS +// #ifdef _DLL +// #pragma comment(lib, "StormLibDAD.lib") // Debug Ansi Dynamic version +// #else +// #pragma comment(lib, "StormLibDAS.lib") // Debug Ansi Static version +// #endif +// #else // RELEASE VERSIONS +// #ifdef _DLL +// #pragma comment(lib, "StormLibRAD.lib") // Release Ansi Dynamic version +// #else +// #pragma comment(lib, "StormLibRAS.lib") // Release Ansi Static version +// #endif +// #endif +// #endif //----------------------------------------------------------------------------- // Defines diff --git a/src/dep/src/irrKlang/CMakeLists.txt b/src/dep/src/irrKlang/CMakeLists.txt index e3b6f5a..61e4402 100644 --- a/src/dep/src/irrKlang/CMakeLists.txt +++ b/src/dep/src/irrKlang/CMakeLists.txt @@ -1,3 +1,3 @@ include_directories (${PROJECT_SOURCE_DIR}/src/dep/include/irrklang) -add_library(irrklang +add_library(irrKlang irrKlang.cpp) \ No newline at end of file diff --git a/src/dep/src/irrlicht/CMakeLists.txt b/src/dep/src/irrlicht/CMakeLists.txt index c7be844..5487e1e 100644 --- a/src/dep/src/irrlicht/CMakeLists.txt +++ b/src/dep/src/irrlicht/CMakeLists.txt @@ -1,5 +1,25 @@ include_directories (${PROJECT_SOURCE_DIR}/src/dep/include ${PROJECT_SOURCE_DIR}/src/dep/include/irrlicht) -add_library(irrlicht +if(WIN32) + set(LIBTYPE SHARED) +else() + set(LIBTYPE STATIC) +endif() + +add_library(irrlicht ${LIBTYPE} # this may be considered a hack. + +zlib/adler32.c +zlib/compress.c +zlib/crc32.c +zlib/deflate.c +zlib/gzio.c +zlib/infback.c +zlib/inffast.c +zlib/inflate.c +zlib/inftrees.c +zlib/trees.c +zlib/uncompr.c +zlib/zutil.c + libpng/example.c libpng/pnggccrd.c libpng/pngpread.c @@ -270,4 +290,5 @@ IBurningShader.cpp Irrlicht.cpp irrXML.cpp os.cpp -) \ No newline at end of file +) +SET_TARGET_PROPERTIES (irrlicht PROPERTIES DEFINE_SYMBOL "IRRLICHT_EXPORTS" ) \ No newline at end of file diff --git a/src/dep/src/zthread/ThreadQueue.cxx b/src/dep/src/zthread/ThreadQueue.cxx index 0234950..3e6243e 100644 --- a/src/dep/src/zthread/ThreadQueue.cxx +++ b/src/dep/src/zthread/ThreadQueue.cxx @@ -27,6 +27,7 @@ #include #include +#include namespace ZThread { diff --git a/src/tools/stuffextract/CMakeLists.txt b/src/tools/stuffextract/CMakeLists.txt index 9810bb7..7614374 100644 --- a/src/tools/stuffextract/CMakeLists.txt +++ b/src/tools/stuffextract/CMakeLists.txt @@ -5,6 +5,14 @@ StuffExtract.cpp ) # Link the executable to the libraries. -target_link_libraries (stuffextract shared StormLib zlib bz2) +set(STUFFEXTRACT_LIBS shared StormLib zlib) +if(UNIX) + list(APPEND STUFFEXTRACT_LIBS bz2) +endif() +if(WIN32) + list(APPEND STUFFEXTRACT_LIBS Winmm) +endif() + +target_link_libraries (stuffextract ${STUFFEXTRACT_LIBS} ) install(TARGETS stuffextract DESTINATION ${CMAKE_INSTALL_PREFIX}) diff --git a/src/tools/viewer/CMakeLists.txt b/src/tools/viewer/CMakeLists.txt index 26da6eb..251435d 100644 --- a/src/tools/viewer/CMakeLists.txt +++ b/src/tools/viewer/CMakeLists.txt @@ -8,9 +8,20 @@ ${PROJECT_SOURCE_DIR}/src/Client/GUI/CImageLoaderBLP.cpp ${PROJECT_SOURCE_DIR}/src/Client/GUI/SImage.cpp ${PROJECT_SOURCE_DIR}/src/Client/GUI/MemoryInterface.cpp ${PROJECT_SOURCE_DIR}/src/Client/GUI/CMDHMemoryReadFile.cpp +${PROJECT_SOURCE_DIR}/src/Client/GUI/CBoneSceneNode.cpp +${PROJECT_SOURCE_DIR}/src/Client/GUI/SSkinnedMesh.cpp + ) # Link the executable to the libraries. -target_link_libraries (viewer shared irrlicht StormLib zthread GL Xxf86vm zlib bz2 ) +set(VIEWER_LIBS shared irrlicht StormLib zthread zlib) +if(UNIX) + list(APPEND VIEWER_LIBS GL Xxf86vm bz2) +endif() +if(WIN32) + list(APPEND VIEWER_LIBS Winmm) +endif() + +target_link_libraries (viewer ${VIEWER_LIBS} ) install(TARGETS viewer DESTINATION ${CMAKE_INSTALL_PREFIX})