diff options
-rw-r--r-- | CMakeLists.txt | 61 | ||||
-rw-r--r-- | externals/zlib/CMakeLists.txt | 19 | ||||
-rw-r--r-- | src/server/authserver/CMakeLists.txt | 47 | ||||
-rw-r--r-- | src/server/worldserver/CMakeLists.txt | 11 | ||||
-rw-r--r-- | src/tools/map_extractor/CMakeLists.txt | 4 | ||||
-rw-r--r-- | src/tools/vmap3_assembler/CMakeLists.txt | 4 | ||||
-rwxr-xr-x | src/tools/vmap3_extractor/CMakeLists.txt | 4 |
7 files changed, 96 insertions, 54 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 8b56a8906b4..ed74400e808 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,6 +57,7 @@ if( NOT CMAKE_BUILD_TYPE ) set(CMAKE_BUILD_TYPE "Release") endif() +if( UNIX ) configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" @@ -66,6 +67,7 @@ configure_file( add_custom_target(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" ) +endif() option(DO_AUTHSERVER "Build authserver" 1) option(DO_WORLDSERVER "Build worldserver" 1) @@ -100,27 +102,49 @@ set(GENREV_SRC # Handle debugmode compiles (this will require further work for proper WIN32-setups) if( DO_DEBUG ) set(CMAKE_BUILD_TYPE Debug) + add_executable(genrev ${GENREV_SRC} ) - add_custom_target("revision.h" ALL - COMMAND "${CMAKE_BINARY_DIR}/genrev" - ${CMAKE_SOURCE_DIR} - WORKING_DIRECTORY "${CMAKE_BINARY_DIR}" - DEPENDS genrev - ) + if( CMAKE_GENERATOR MATCHES "Visual Studio" ) + add_custom_target("revision.h" ALL + COMMAND "${CMAKE_CURRENT_BINARY_DIR}/$(ConfigurationName)/genrev" + ${CMAKE_SOURCE_DIR} + WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" + DEPENDS genrev + ) + else() + add_custom_target("revision.h" ALL + COMMAND "${CMAKE_CURRENT_BINARY_DIR}/genrev" + ${CMAKE_SOURCE_DIR} + WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" + DEPENDS genrev + ) + endif() + else() + add_executable(genrev ${GENREV_SRC} ) - add_custom_target("revision.h" ALL - COMMAND "${CMAKE_BINARY_DIR}/genrev" - ${CMAKE_SOURCE_DIR} - WORKING_DIRECTORY "${CMAKE_BINARY_DIR}" - DEPENDS genrev - ) + if( CMAKE_GENERATOR MATCHES "Visual Studio" ) + add_custom_target("revision.h" ALL + COMMAND "${CMAKE_CURRENT_BINARY_DIR}/$(ConfigurationName)/genrev" + ${CMAKE_SOURCE_DIR} + WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" + DEPENDS genrev + ) + else() + add_custom_target("revision.h" ALL + COMMAND "${CMAKE_CURRENT_BINARY_DIR}/genrev" + ${CMAKE_SOURCE_DIR} + WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" + DEPENDS genrev + ) + endif() + endif() execute_process( @@ -209,12 +233,13 @@ else() elseif( WIN32 ) # Disable warnings in Visual Studio 8 and above if(MSVC AND NOT CMAKE_GENERATOR MATCHES "Visual Studio 7") - set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /wd4996") - set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /wd4996") - set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /wd4996") - set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /wd4996") - set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} /wd4996") - set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /wd4996") + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /wd4996 /wd4355 /wd4244 /wd4267") + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /wd4996 /wd4355 /wd4244 /wd4985 /wd4267") + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /wd4996 /wd4355 /wd4244 /wd4985 /wd4267") + + set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /wd4996 /wd4355 /wd4244 /wd4985 /wd4267") + set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} /wd4996 /wd4355 /wd4244 /wd4985 /wd4267") + set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /wd4996 /wd4355 /wd4244 /wd4985 /wd4267") endif() add_definitions(-D_CRT_SECURE_NO_WARNINGS) endif() diff --git a/externals/zlib/CMakeLists.txt b/externals/zlib/CMakeLists.txt index bd194531bb5..e53fae3053d 100644 --- a/externals/zlib/CMakeLists.txt +++ b/externals/zlib/CMakeLists.txt @@ -8,15 +8,24 @@ # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -file(GLOB sources *.c) -file(GLOB headers *.h) SET(zlib_STAT_SRCS - ${sources} - ) + adler32.c + compress.c + crc32.c + deflate.c + example.c + infback.c + inffast.c + inflate.c + inftrees.c + trees.c + uncompr.c + zutil.c +) include_directories( ${CMAKE_CURRENT_SOURCE_DIR} - ) +) add_library(zlib STATIC ${zlib_STAT_SRCS}) diff --git a/src/server/authserver/CMakeLists.txt b/src/server/authserver/CMakeLists.txt index 956010da987..e97bcfbea88 100644 --- a/src/server/authserver/CMakeLists.txt +++ b/src/server/authserver/CMakeLists.txt @@ -57,29 +57,30 @@ endif() set_target_properties(authserver PROPERTIES LINK_FLAGS "${authserver_LINK_FLAGS}") if(WIN32) -target_link_libraries( - authserver - shared - trinitydatabase - trinityauth - trinityconfig - ${MYSQL_LIBRARY} - ${OPENSSL_LIBRARIES} - ${OPENSSL_EXTRA_LIBRARIES} -) + target_link_libraries( + authserver + shared + trinitydatabase + trinityauth + trinityconfig + ${MYSQL_LIBRARY} + ${OPENSSL_LIBRARIES} + ${OPENSSL_EXTRA_LIBRARIES} + ) else() -target_link_libraries( - authserver - shared - trinitydatabase - trinityauth - trinityconfig - ${MYSQL_LIBRARY} - ${OPENSSL_LIBRARIES} - ${OSX_LIBS} -) + target_link_libraries( + authserver + shared + trinitydatabase + trinityauth + trinityconfig + ${MYSQL_LIBRARY} + ${OPENSSL_LIBRARIES} + ${OSX_LIBS} + ) endif() -########### install files ############### -install(TARGETS authserver DESTINATION bin) -install(FILES authserver.conf.dist DESTINATION etc) +if( UNIX ) + install(TARGETS authserver DESTINATION bin) + install(FILES authserver.conf.dist DESTINATION etc) +endif() diff --git a/src/server/worldserver/CMakeLists.txt b/src/server/worldserver/CMakeLists.txt index 823cc720e56..17bdc418884 100644 --- a/src/server/worldserver/CMakeLists.txt +++ b/src/server/worldserver/CMakeLists.txt @@ -140,8 +140,9 @@ if(DO_SCRIPTS) else(DO_SCRIPTS) set(SCRIPT_LIB "") endif(DO_SCRIPTS) + if(WIN32) - target_link_libraries( + target_link_libraries( worldserver game shared @@ -181,7 +182,7 @@ else() ) endif() -########### install files ############### - -install(TARGETS worldserver DESTINATION bin) -install(FILES worldserver.conf.dist DESTINATION etc) +if( UNIX ) + install(TARGETS worldserver DESTINATION bin) + install(FILES worldserver.conf.dist DESTINATION etc) +endif() diff --git a/src/tools/map_extractor/CMakeLists.txt b/src/tools/map_extractor/CMakeLists.txt index a18ee7cd517..cb3778c7c6a 100644 --- a/src/tools/map_extractor/CMakeLists.txt +++ b/src/tools/map_extractor/CMakeLists.txt @@ -33,4 +33,6 @@ else() ) endif() -install(TARGETS mapextractor DESTINATION bin) +if( UNIX ) + install(TARGETS mapextractor DESTINATION bin) +endif() diff --git a/src/tools/vmap3_assembler/CMakeLists.txt b/src/tools/vmap3_assembler/CMakeLists.txt index 0b8ece2dc37..2035d3f2055 100644 --- a/src/tools/vmap3_assembler/CMakeLists.txt +++ b/src/tools/vmap3_assembler/CMakeLists.txt @@ -37,4 +37,6 @@ else() ) endif() -install(TARGETS vmap3assembler DESTINATION bin) +if( UNIX ) + install(TARGETS vmap3assembler DESTINATION bin) +if() diff --git a/src/tools/vmap3_extractor/CMakeLists.txt b/src/tools/vmap3_extractor/CMakeLists.txt index 9dfdd545df8..62604f7ad3d 100755 --- a/src/tools/vmap3_extractor/CMakeLists.txt +++ b/src/tools/vmap3_extractor/CMakeLists.txt @@ -36,4 +36,6 @@ else() ) endif() -install(TARGETS vmap3extractor DESTINATION bin) +if( UNIX ) + install(TARGETS vmap3extractor DESTINATION bin) +endif() |