ike3 / mangosbot

This is a modification of MaNGOS (Zero, One, R2, Trinity) server which brings a number of bots online and available for any player. Also allows you to use your account/guild characters as bots.
http://ike3.github.io/mangosbot-docs/
GNU General Public License v2.0
183 stars 78 forks source link

cmake warning in linux #47

Open LordPsyan opened 8 years ago

LordPsyan commented 8 years ago

-- Configuring done CMake Warning (dev) at src/plugins/CMakeLists.txt:152 (add_dependencies): Policy CMP0046 is not set: Error on non-existent dependency in add_dependencies. Run "cmake --help-policy CMP0046" for policy details. Use the cmake_policy command to set the policy and suppress this warning.

The dependency target "revision.h" of target "plugins" does not exist. This warning is for project developers. Use -Wno-dev to suppress it.

This can be easily fixed. In src/plugins/CMakeLists.txt line 152 change: add_dependencies(plugins revision.h) to add_dependencies(plugins revision_data.h)

This is the same for CMakeLists.txt in src/server/game/

Talmeron commented 8 years ago

Another one you fixed.

ghost commented 8 years ago

CMake 3.4.0 (cmake-gui), trying to build commit 85117d8 :

CMake Warning (dev) at src/server/game/CMakeLists.txt:210 (add_dependencies):
  Policy CMP0046 is not set: Error on non-existent dependency in
  add_dependencies.  Run "cmake --help-policy CMP0046" for policy details.
  Use the cmake_policy command to set the policy and suppress this warning.

  The dependency target "revision.h" of target "game" does not exist.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at src/plugins/CMakeLists.txt:151 (add_dependencies):
  Policy CMP0046 is not set: Error on non-existent dependency in
  add_dependencies.  Run "cmake --help-policy CMP0046" for policy details.
  Use the cmake_policy command to set the policy and suppress this warning.

  The dependency target "revision.h" of target "plugins" does not exist.
This warning is for project developers.  Use -Wno-dev to suppress it.

I tried using -Wno-dev in 31 (!) different places in the CMake flags, but CMake still complains about the missing files. I will test @LordPsyan's suggestion, change line 151 in /src/plugins/CMakeLists.txt and line 210 in /src/server/game/CMakeLists.txt ... posting the actual diff when it eventually works.


Then again, there is the file revision_data.h.in.cmake and its contents:

#ifndef __REVISION_DATA_H__
#define __REVISION_DATA_H__
 #define _HASH                      "@rev_hash@"
 #define _DATE                      "@rev_date@"
 #define _BRANCH                    "@rev_branch@"
 #define _SOURCE_DIRECTORY          "@CMAKE_SOURCE_DIR@"
 #define _MYSQL_EXECUTABLE          "@MYSQL_EXECUTABLE@"
 #define _FULL_DATABASE             "TDB_full_world_335.59_2015_07_14.sql"
 #define VER_COMPANYNAME_STR        "TrinityCore Developers"
 #define VER_LEGALCOPYRIGHT_STR     "(c)2008-2015 TrinityCore"
 #define VER_FILEVERSION            0,0,0
 #define VER_FILEVERSION_STR        "@rev_hash@ @rev_date@ (@rev_branch@ branch)"
 #define VER_PRODUCTVERSION         VER_FILEVERSION
 #define VER_PRODUCTVERSION_STR     VER_FILEVERSION_STR
 #define COMPILER_C_FLAGS           "@CMAKE_C_FLAGS@"
 #define COMPILER_CXX_FLAGS         "@CMAKE_CXX_FLAGS@"
#endif // __REVISION_DATA_H__

it would be useful to make a change in this file instead of the CMakeLists.txt files (correct me if I'm wrong).


Changing the filename in cmake config is not effective. Renaming the filenames inside CMakeLists.txt instead.

Files affected:

Code style : replaced Tabs with spaces in /src/plugins/CMakeLists.txt