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
185 stars 79 forks source link

Cmake warning in windows - Can`t compile it in vs 2015 #59

Closed Ashlon1 closed 8 years ago

Ashlon1 commented 8 years ago

I have the some problem that this OP had...https://github.com/ike3/mangosbot/issues/47. He had the problem for Linux and I use windows to compile. I changed it to but that didn`t fix the problem.

Configuring done 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 use windows 7 with VS 2015. And mangosbot trinity-wotlk-ai. I can`t compile it. Any body who can help me so I can compile it?

Thanks

ghost commented 8 years ago

Sorry, misread your problem. Follow this fix:

Core/cmake: filename revision.h in CMakeLists.txt #54

ghost commented 8 years ago
### src/plugins/CMakeLists.txt
@@ -148,25 +148,25 @@ add_library(plugins STATIC
   ${plugins_STAT_PCH_SRC}
 )

-add_dependencies(plugins revision.h)
+add_dependencies(plugins revision_data.h)

 if( WIN32 )
   if ( MSVC )
-   add_custom_command(TARGET plugins
+    add_custom_command(TARGET plugins
       POST_BUILD
-     COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/playerbot/aiplayerbot.conf.dist.in ${CMAKE_BINARY_DIR}/bin/$(ConfigurationName)/
+      COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/playerbot/aiplayerbot.conf.dist.in ${CMAKE_BINARY_DIR}/bin/$(ConfigurationName)/
     )
-   add_custom_command(TARGET plugins
+    add_custom_command(TARGET plugins
       POST_BUILD
-     COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/ahbot/ahbot.conf.dist.in ${CMAKE_BINARY_DIR}/bin/$(ConfigurationName)/
+      COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/ahbot/ahbot.conf.dist.in ${CMAKE_BINARY_DIR}/bin/$(ConfigurationName)/
     )
   elseif ( MINGW )

-    add_custom_command(TARGET plugins
+     add_custom_command(TARGET plugins
       POST_BUILD
       COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}playerbot/aiplayerbot.conf.dist.in ${CMAKE_BINARY_DIR}/bin/
     )
-   add_custom_command(TARGET plugins
+    add_custom_command(TARGET plugins
       POST_BUILD
       COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}ahbot/ahbot.conf.dist.in ${CMAKE_BINARY_DIR}/bin/
     )
### src/server/game/CMakeLists.txt
@@ -207,7 +207,7 @@ add_library(game STATIC
   ${game_STAT_PCH_SRC}
 )

-add_dependencies(game plugins revision.h)
+add_dependencies(game plugins revision_data.h)
 # Generate precompiled header
 if (USE_COREPCH)
   add_cxx_pch(game ${game_STAT_PCH_HDR} ${game_STAT_PCH_SRC})
### src/test/CMakeLists.txt
@@ -150,7 +150,7 @@ add_executable(tests
   ${tests_STAT_PCH_SRC}
 )

-add_dependencies(tests revision.h)
+add_dependencies(tests revision_data.h)

 target_link_libraries(tests
   game
Ashlon1 commented 8 years ago

Thanks for the reply. I dont know what happened with the build but for some reason I could compile it. I tried it for the last 3 days and everytime I got the error. To day I could compile it finally and I am not sure how. But thanks for your help.

ConradBunton commented 8 years ago

CMake Error at scr/plugins/CMakeLists.txt : 195 (Install) install TARGETS given no ARCHIVE DESTINATION for static library target 'plugins'.

I tried a lot of directories at CMAKE_INSTALL_PREFIX, but no way...