Skip to content

Commit

Permalink
Improve cmake install path for extraction tools. (#2803)
Browse files Browse the repository at this point in the history
  • Loading branch information
schell244 authored Oct 22, 2024
1 parent f1d0df6 commit 6017bf4
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 23 deletions.
14 changes: 9 additions & 5 deletions contrib/extractor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,35 @@

cmake_minimum_required(VERSION 2.6...3.20)
project (MANGOS_MAP_EXTRACTOR)
set(EXECUTABLE_NAME MapExtractor)

include_directories (${CMAKE_SOURCE_DIR}/dep/libmpq)
include_directories (loadlib)
include_directories (
../../src/game/Maps
)

add_executable (mapextractor
add_executable (${EXECUTABLE_NAME}
dbcfile.cpp
System.cpp
loadlib/loadlib.cpp
loadlib/adt.cpp
loadlib/wdt.cpp
)

SET_TARGET_PROPERTIES (mapextractor PROPERTIES FOLDER Extractors)
SET_TARGET_PROPERTIES (${EXECUTABLE_NAME} PROPERTIES FOLDER Extractors)

if(UNIX)
find_package(ZLIB REQUIRED)
if(ZLIB_FOUND)
include_directories(${ZLIB_INCLUDE_DIRS})
target_link_libraries(mapextractor ${ZLIB_LIBRARIES} libmpq bz2)
target_link_libraries(${EXECUTABLE_NAME} ${ZLIB_LIBRARIES} libmpq bz2)
endif(ZLIB_FOUND)
else()
target_link_libraries (mapextractor zlib libmpq bz2)
target_link_libraries (${EXECUTABLE_NAME} zlib libmpq bz2)
endif(UNIX)

install(TARGETS mapextractor DESTINATION ${BIN_DIR})
install(TARGETS ${EXECUTABLE_NAME} DESTINATION ${BIN_DIR}/Extractors)
if(WIN32 AND MSVC)
install(FILES $<TARGET_PDB_FILE:${EXECUTABLE_NAME}> DESTINATION ${BIN_DIR}/Extractors OPTIONAL)
endif()
18 changes: 13 additions & 5 deletions contrib/mmap/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@

cmake_minimum_required(VERSION 2.6...3.20)

project(MoveMapGen)
project(MoveMapGenerator)
set(EXECUTABLE_NAME MoveMapGenerator)

ADD_DEFINITIONS(-DMMAP_GENERATOR -DDEBUG)

Expand Down Expand Up @@ -47,10 +48,10 @@ set(SOURCES
./src/VMapExtensions.cpp
)

add_executable(MoveMapGen ${SOURCES})
SET_TARGET_PROPERTIES (MoveMapGen PROPERTIES FOLDER Extractors)
add_executable(${EXECUTABLE_NAME} ${SOURCES})
SET_TARGET_PROPERTIES (${EXECUTABLE_NAME} PROPERTIES FOLDER Extractors)

target_link_libraries(MoveMapGen
target_link_libraries(${EXECUTABLE_NAME}
vmap
Detour
Recast
Expand All @@ -59,4 +60,11 @@ target_link_libraries(MoveMapGen
framework
)

install(TARGETS MoveMapGen DESTINATION ${BIN_DIR})
install(TARGETS ${EXECUTABLE_NAME} DESTINATION ${BIN_DIR}/Extractors)
install(FILES ${CMAKE_SOURCE_DIR}/contrib/mmap/offmesh.txt DESTINATION ${BIN_DIR}/Extractors)
install(FILES ${CMAKE_SOURCE_DIR}/contrib/mmap/config.json DESTINATION ${BIN_DIR}/Extractors)
install(FILES ${CMAKE_SOURCE_DIR}/contrib/mmap/mmap_extract.py DESTINATION ${BIN_DIR}/Extractors)

if(WIN32 AND MSVC)
install(FILES $<TARGET_PDB_FILE:${EXECUTABLE_NAME}> DESTINATION ${BIN_DIR}/Extractors OPTIONAL)
endif()
4 changes: 2 additions & 2 deletions contrib/mmap/mmap_extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,11 @@ def get_subprocess_config() -> SubprocessConfig:
startup_info.dwFlags |= 0x00000001
startup_info.wShowWindow = 7
creation_flags = subprocess.CREATE_NEW_CONSOLE # type: ignore
executable = script_directory / "MoveMapGen.exe"
executable = script_directory / "MoveMapGenerator.exe"
else:
startup_info = None
creation_flags = 0
executable = script_directory / "MoveMapGen"
executable = script_directory / "MoveMapGenerator"

return SubprocessConfig(executable, startup_info, creation_flags)

Expand Down
12 changes: 8 additions & 4 deletions contrib/vmap_assembler/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

cmake_minimum_required(VERSION 2.6...3.20)
project (MANGOS_VMAP_ASSEMB_IO)
set(EXECUTABLE_NAME VMapAssembler)

#set(CMAKE_VERBOSE_MAKEFILE true)

Expand Down Expand Up @@ -52,13 +53,16 @@ else()
target_link_libraries(vmap g3dlite zlib)
endif(UNIX)

add_executable(vmap_assembler vmap_assembler.cpp)
SET_TARGET_PROPERTIES (vmap_assembler PROPERTIES FOLDER Extractors)
target_link_libraries(vmap_assembler
add_executable(${EXECUTABLE_NAME} vmap_assembler.cpp)
SET_TARGET_PROPERTIES (${EXECUTABLE_NAME} PROPERTIES FOLDER Extractors)
target_link_libraries(${EXECUTABLE_NAME}
vmap
g3dlite
${ACE_LIBRARIES}
framework
)

install(TARGETS vmap_assembler DESTINATION ${BIN_DIR})
install(TARGETS ${EXECUTABLE_NAME} DESTINATION ${BIN_DIR}/Extractors)
if(WIN32 AND MSVC)
install(FILES $<TARGET_PDB_FILE:${EXECUTABLE_NAME}> DESTINATION ${BIN_DIR}/Extractors OPTIONAL)
endif()
14 changes: 9 additions & 5 deletions contrib/vmap_extractor/vmapextract/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@

cmake_minimum_required(VERSION 2.6...3.20)
project (MANGOS_IOMAP_EXTRACTOR)
set(EXECUTABLE_NAME VMapExtractor)

add_executable(vmapextractor adtfile.cpp dbcfile.cpp gameobject_extract.cpp model.cpp vmapexport.cpp wdtfile.cpp wmo.cpp)
SET_TARGET_PROPERTIES (vmapextractor PROPERTIES FOLDER Extractors)
add_executable(${EXECUTABLE_NAME} adtfile.cpp dbcfile.cpp gameobject_extract.cpp model.cpp vmapexport.cpp wdtfile.cpp wmo.cpp)
SET_TARGET_PROPERTIES (${EXECUTABLE_NAME} PROPERTIES FOLDER Extractors)

include_directories(
${CMAKE_SOURCE_DIR}/dep/include/g3dlite
Expand All @@ -28,10 +29,13 @@ if(UNIX)
find_package(ZLIB REQUIRED)
if(ZLIB_FOUND)
include_directories(${ZLIB_INCLUDE_DIRS})
target_link_libraries(vmapextractor libmpq bz2 g3dlite shared ${ZLIB_LIBRARIES})
target_link_libraries(${EXECUTABLE_NAME} libmpq bz2 g3dlite shared ${ZLIB_LIBRARIES})
endif(ZLIB_FOUND)
else()
target_link_libraries(vmapextractor libmpq bz2 g3dlite shared zlib)
target_link_libraries(${EXECUTABLE_NAME} libmpq bz2 g3dlite shared zlib)
endif(UNIX)

install(TARGETS vmapextractor DESTINATION ${BIN_DIR})
install(TARGETS ${EXECUTABLE_NAME} DESTINATION ${BIN_DIR}/Extractors)
if(WIN32 AND MSVC)
install(FILES $<TARGET_PDB_FILE:${EXECUTABLE_NAME}> DESTINATION ${BIN_DIR}/Extractors OPTIONAL)
endif()
2 changes: 1 addition & 1 deletion src/mangosd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -162,5 +162,5 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/mangosd.conf.dist.in ${CMAKE_CURRENT_
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/mangosd.conf.dist DESTINATION ${CONF_DIR})

if(WIN32 AND MSVC)
install(FILES ${CMAKE_SOURCE_DIR}/bin/Debug/${EXECUTABLE_NAME}.pdb DESTINATION ${BIN_DIR} CONFIGURATIONS Debug)
install(FILES $<TARGET_PDB_FILE:${EXECUTABLE_NAME}> DESTINATION ${BIN_DIR} OPTIONAL)
endif()
2 changes: 1 addition & 1 deletion src/realmd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -111,5 +111,5 @@ install(TARGETS ${EXECUTABLE_NAME} DESTINATION ${BIN_DIR})
install(FILES realmd.conf.dist.in DESTINATION ${CONF_DIR} RENAME realmd.conf.dist)

if(WIN32 AND MSVC)
install(FILES ${CMAKE_SOURCE_DIR}/bin/Debug/${EXECUTABLE_NAME}.pdb DESTINATION ${BIN_DIR} CONFIGURATIONS Debug)
install(FILES $<TARGET_PDB_FILE:${EXECUTABLE_NAME}> DESTINATION ${BIN_DIR} OPTIONAL)
endif()

0 comments on commit 6017bf4

Please sign in to comment.