Jump to content

[solved] Problem compiling mangos with cmake and Mac and Mint 13?!


Guest Chutulu_

Recommended Posts

Hi

I am trying to install Mangos under Mac OS 10.7.

I am using http://getmangos.eu/bb/topic/344/how-to-compile-on-linux-ubuntu/ guide. Until now I had no real problems but

mkdir objdir
cd objdir
cmake .. -DPREFIX=/opt/mangos-server
make
make install

the cmake part gives me this error:

CMake Error at //CMakeLists.txt:44 (find_package):

By not providing "FindPlatform.cmake" in CMAKE_MODULE_PATH this project has

asked CMake to find a package configuration file provided by "Platform",

but CMake did not find one.

Could not find a package configuration file provided by "Platform" with any

of the following names:

PlatformConfig.cmake

platform-config.cmake

Add the installation prefix of "Platform" to CMAKE_PREFIX_PATH or set

"Platform_DIR" to a directory containing one of the above files. If

"Platform" provides a separate development package or SDK, be sure it has

been installed.

-- Configuring incomplete, errors occurred!

I have no idea what to do with this error. In the CMakeLists.txt there is this code:

# Find out what system we use to include the needed libs
if(WIN32)
 if(PLATFORM MATCHES X86) # 32-bit
   set(DEP_ARCH win32)
 else() # 64-bit
   set(DEP_ARCH x64)
 endif()
endif()

# if(WIN32)
#   if(PLATFORM MATCHES X86)
#     set(ARCH_FLAGS "/MACHINE:X86")
#   else()
#     set(ARCH_FLAGS "/MACHINE:X64")
#   endif()
# elseif(UNIX)
#   if(PLATFORM MATCHES X86)
#     set(ARCH_FLAGS "-m32")
#   else()
#     set(ARCH_FLAGS "-m64")
#   endif()
# endif()

So I have to modify

cmake .. -DPREFIX=/opt/mangos-server

with a

ARCH_FLAGS"-m64"

somewhere?

Thanks

Chutulu

Link to comment
Share on other sites

Hmm, try this patch:

diff --git a/CMakeLists.txt b/CMakeLists.txt
index a30019d..e270291 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -24,7 +24,7 @@ cmake_minimum_required(VERSION 2.8)

set(CMAKE_MODULE_PATH
  ${CMAKE_MODULE_PATH}
-  ${CMAKE_SOURCE_DIR}/cmake
+  "${CMAKE_SOURCE_DIR}/cmake"
)

# Force out-of-source build

Link to comment
Share on other sites

Hmm, try this patch:

diff --git a/CMakeLists.txt b/CMakeLists.txt
index a30019d..e270291 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -24,7 +24,7 @@ cmake_minimum_required(VERSION 2.8)

set(CMAKE_MODULE_PATH
  ${CMAKE_MODULE_PATH}
-  ${CMAKE_SOURCE_DIR}/cmake
+  "${CMAKE_SOURCE_DIR}/cmake"
)

# Force out-of-source build

@faramir118

Thanks for the info. Now I only need to know how to use this patch. I am new to this compile things myself. If there are no errors everything is ok but

otherwise I am lost.

@DoxramosPS

Thx. I would prefer to put mangos somewhere else like /usr/local/bin as Apple has reserved this dir for custom use. But as a newbie I first try to

install it as described in the tutorial.

Thanks

Chutulu

Link to comment
Share on other sites

OK thanks. I have patched the cmakelist but when I try to compile cmake I get the same error message as before.

Do I understand it correctly that your patch puts ${CMAKE_SOURCE_DIR}/cmake between " "?

Just curious to understand git.

If you have any other ideas I'll give them a try.

Thx

Chutulu

Link to comment
Share on other sites

Yes, it quotes the file path so that cmake doesn't have issues when your mangos directory has spaces in the path

In CMakeLists.txt, there is a directive that tells cmake to find and require the Platform module:

find_package(Platform REQUIRED)

There is a FindPlatform.cmake file in the cmake directory that initializes the PLATFORM variable for cmake, which find_package should be able to find - or some reason, your system can't.

Link to comment
Share on other sites

Yes, it quotes the file path so that cmake doesn't have issues when your mangos directory has spaces in the path

In CMakeLists.txt, there is a directive that tells cmake to find and require the Platform module:

find_package(Platform REQUIRED)

There is a FindPlatform.cmake file in the cmake directory that initializes the PLATFORM variable for cmake, which find_package should be able to find - or some reason, your system can't.

Ok the FindPlatform.cmake file is there. I don't know much about programming, just beginning to learn with the help of some evening lessons.

But as far as I understand the file, cmake checks if the platform is windows on a 32 or 64 bit proc if not it checks if it is 32 or 64 bit and choses which ever fits?

I have tried to install TrinityCore and so far cmake worked. Trinity uses this as config

cmake ../ -GXcode \\
-DMYSQL_ADD_INCLUDE_PATH=/usr/local/Cellar/mysql \\
-DREADLINE_INCLUDE_DIR=/usr/local/include \\
-DREADLINE_LIBRARY=/usr/local/Cellar/readline/6.2.4/lib/libreadline.dylib \\
-DACE_INCLUDE_DIR=/opt/local/include \\
-DACE_LIBRARY=/opt/local/lib/libACE.a \\
-DPREFIX=/opt/trinitycore \\
-DWARNINGS=0

I have tried to use this together with a mixture of their cmake and mangos. Got the same message from cmake that it can't find...

Trinity cmake completes it's task. But it failes later in Xcode. So their solution isn't any better.

Trinity cmake gives me this:

-- The C compiler identification is Clang 4.1.0
-- The CXX compiler identification is Clang 4.1.0
-- Check for working C compiler using: Xcode
-- Check for working C compiler using: Xcode -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler using: Xcode
-- Check for working CXX compiler using: Xcode -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detected 64-bit platform
-- OSX: Using default configuration directory
-- OSX: Using default library directory
-- OSX: Configuring uninstall target
-- OSX: Created uninstall target
-- Found ACE library: /opt/local/lib/libACE.a
-- Found ACE headers: /opt/local/include
-- Found OpenSSL: /usr/lib/libssl.dylib;/usr/lib/libcrypto.dylib  
-- Using mysql-config: /usr/local/bin/mysql_config
-- Found MySQL library: /usr/local/lib/libmysqlclient_r.dylib
-- Found MySQL headers: /usr/local/include
-- Found Readline library: /usr/local/Cellar/readline/6.2.4/lib/libreadline.dylib
-- Include dir is: /usr/local/include
-- Found ZLIB: /usr/lib/libz.dylib (found version "1.2.5") 
-- Found BZip2: /usr/lib/libbz2.dylib (found version "1.0.6") 
-- Looking for BZ2_bzCompressInit in /usr/lib/libbz2.dylib
-- Looking for BZ2_bzCompressInit in /usr/lib/libbz2.dylib - found

* TrinityCore rev. hash  : 3c3d4f4c995e
* TrinityCore rev. date  : 2012-11-13 15:56:15 +0100
* TrinityCore buildtype  : Release

* Install core to        : /opt/trinitycore
* Install libraries to   : /opt/trinitycore/lib
* Install configs to     : /opt/trinitycore/etc

* Build world/auth       : Yes (default)
* Build with scripts     : Yes (default)
* Build map/vmap tools   : No  (default)
* Build core w/PCH       : Yes (default)
* Build scripts w/PCH    : Yes (default)
* Show compile-warnings  : No  (default)
* Use coreside debug     : No  (default)

-- SCRIPT PREPARATIONS
 -> Prepared: Spells
 -> Prepared: Commands
 -> Prepared: Examples
 -> Prepared: Custom
 -> Prepared: World
 -> Prepared: Outdoor PVP Zones
 -> Prepared: Eastern Kingdoms
 -> Prepared: Kalimdor
 -> Prepared: Outland
 -> Prepared: Northrend
 -> Prepared: Events
-- SCRIPT PREPARATION COMPLETE

-- Configuring done
-- Generating done
CMake Warning:
 Manually-specified variables were not used by the project:

   WARNINGS


-- Build files have been written to: /Downloads/TrinityCore/build

So their cmake detects the platform correctly. Unfortunately I don't know how to use this to get mangos cmake working.

Could it be possible that it doesn't work because some dependencies are in an other path than /opt/local ? Even if I think that my paketmanager for

Mac has done everything right.

Perhaps someone has an idea. Otherwise I probably have to install a Mint 13 on the MiniMac.

That won't improve things because some Linux distros look like Mac OS but feel different.

Thx

Chutulu

Link to comment
Share on other sites

Hm that su...

Same error and a few more unter Mint 13 Xcfe

laurentlutgen@MintMac ~/Downloads/mangos/server $ cmake .. -DPREFIX=/opt/mangos-server
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
CMake Error at CMakeLists.txt:44 (find_package):
 Could not find module FindPlatform.cmake or a configuration file for
 package Platform.

 Adjust CMAKE_MODULE_PATH to find FindPlatform.cmake or set Platform_DIR to
 the directory containing a CMake configuration file for Platform.  The file
 will have one of the following names:

   PlatformConfig.cmake
   platform-config.cmake



-- Found Git: /usr/bin/git 

This script builds the MaNGOS server.
 Options that can be used in order to configure the process:
   PREFIX: Path where the server should be installed to
   PCH: Use precompiled headers
   DEBUG: Debug mode
 To set an option simply type -D<OPTION>=<VALUE> after 'cmake <srcs>'.
 For example: cmake .. -DDEBUG=1 -DPREFIX=/opt/mangos

CMake Warning at CMakeLists.txt:107 (find_package):
 Could not find module FindPCHSupport.cmake or a configuration file for
 package PCHSupport.

 Adjust CMAKE_MODULE_PATH to find FindPCHSupport.cmake or set PCHSupport_DIR
 to the directory containing a CMake configuration file for PCHSupport.  The
 file will have one of the following names:

   PCHSupportConfig.cmake
   pchsupport-config.cmake



CMake Error at CMakeLists.txt:170 (include):
 include could not find load file:

   cmake/ImportACE.cmake


CMake Error at CMakeLists.txt:188 (include):
 include could not find load file:

   cmake/ImportTBB.cmake


CMake Error at CMakeLists.txt:205 (find_package):
 Could not find module FindMySQL.cmake or a configuration file for package
 MySQL.

 Adjust CMAKE_MODULE_PATH to find FindMySQL.cmake or set MySQL_DIR to the
 directory containing a CMake configuration file for MySQL.  The file will
 have one of the following names:

   MySQLConfig.cmake
   mysql-config.cmake



-- checking for module 'openssl'
--   found openssl, version 1.0.1
-- Found OpenSSL: /usr/lib/i386-linux-gnu/libssl.so;/usr/lib/i386-linux-gnu/libcrypto.so (found version "1..1")
-- Found ZLIB: /usr/lib/i386-linux-gnu/libz.so (found version "1.2.3.4")
CMake Error: File /home/laurentlutgen/Downloads/mangos/cmake/cmake_uninstall.cmake.in does not exist.
CMake Error at CMakeLists.txt:211 (configure_file):
 configure_file Problem configuring file



MaNGOS-Core revision  : Git repository not found
Install server to     : /opt/mangos-server

Use PCH               : No
Build in debug-mode   : No  (default)

CMake Error: File /home/laurentlutgen/Downloads/mangos/config.h.cmake does not exist.
CMake Error at CMakeLists.txt:401 (configure_file):
 configure_file Problem configuring file


CMake Error at CMakeLists.txt:403 (add_subdirectory):
 add_subdirectory given source "dep" which is not an existing directory.


CMake Error at CMakeLists.txt:427 (add_subdirectory):
 add_subdirectory given source "src" which is not an existing directory.


-- Configuring incomplete, errors occurred!

Or did I do something wrong?

Thx

Chutlu

Link to comment
Share on other sites

Trinity's cmake config is different (more comprehensive), and not a good test for mangos.

Something seems wrong if the exact same thing happens to you on two different platforms... it should be able to find cmake/FindPlatform.cmake just fine

Can you send me the output of the following:

cd ~
pwd
mkdir mangos
cd mangos
mkdir bin
git clone git://github.com/mangos/server.git
cd server
mkdir build
cd build
cmake .. -DPREFIX=~/mangos/bin

Link to comment
Share on other sites

Trinity and Mangos were once one project if I remember correctly so I was worth a try.

More comprehensive? Hm Trinity's config is distributed over more files and subdirs. Perhaps easier to understand for some but not for me.

I think I now know what I did wrong. I misunderstoud the "out of source build".

My path: ~/mangos/server and I run the cmake from ~/mangos. which meant for me out of source because I am outside of the folder containing the source.

So the cmake .. -DPrefix.... was pointing to something completely stupid. Didn't understood the meaning of those ".." even if I know what cd .. does.

Stupid me.

But run from another folder inside the source it works.

minimac:build laurentlutgen$ cmake .. -DPREFIX=~/mangos/bin
-- The C compiler identification is Clang 4.1.0
-- The CXX compiler identification is Clang 4.1.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detected 64-bit platform.
-- Found Git: /usr/bin/git  

This script builds the MaNGOS server.
 Options that can be used in order to configure the process:
   PREFIX: Path where the server should be installed to
   PCH: Use precompiled headers
   DEBUG: Debug mode
 To set an option simply type -D<OPTION>=<VALUE> after 'cmake <srcs>'.
 For example: cmake .. -DDEBUG=1 -DPREFIX=/opt/mangos

-- Using mysql-config: /usr/local/bin/mysql_config
-- Found MySQL library: /usr/local/lib/libmysqlclient_r.dylib
-- Found MySQL headers: /usr/local/include
-- Found OpenSSL library: /usr/lib/libssl.dylib
-- Found OpenSSL headers: /usr/include/openssl
-- Found ZLIB: /usr/lib/libz.dylib (found version "1.2.5") 

MaNGOS-Core revision  : 428ea639ba14213ff6df03be4b551a1d9edb0d79

Install server to     : /Users/laurentlutgen/mangos/bin

Use PCH               : No
Build in debug-mode   : No  (default)

-- Using Mac OS X port
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/laurentlutgen/mangos/bin/server/build

Same thing under Mint.

Thx for your help and patience to help a noob

Chutulu

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use