Skip to content

Commit

Permalink
Update CMake files
Browse files Browse the repository at this point in the history
Move bin dir on Windows
Move revision.h file to build dir
  • Loading branch information
Niam5 committed May 12, 2024
1 parent 4ac4325 commit 4202e5a
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/windows-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,13 @@ jobs:

- name: Archive files
run: |
cd bin
cd ${{env.BUILD_DIR}}/bin
7z a -tzip ${{env.ARCHIVE_FILENAME}} "x64_${{env.BUILD_TYPE}}"
- name: Archive this artefact
uses: actions/upload-artifact@v3
with:
name: snapshot-${{matrix.TYPE}}
path: "bin/${{env.ARCHIVE_FILENAME}}"
path: "${{env.BUILD_DIR}}/bin/${{env.ARCHIVE_FILENAME}}"

upload:
runs-on: windows-2022
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ jobs:

- name: Archive files
run: |
cd bin
cd ${{env.BUILD_DIR}}/bin
7z a -tzip ${{env.ARCHIVE_FILENAME}} x64_Release
- name: Archive this artefact
uses: actions/upload-artifact@v3
with:
name: snapshot
path: "bin/${{env.ARCHIVE_FILENAME}}"
path: "${{env.BUILD_DIR}}/bin/${{env.ARCHIVE_FILENAME}}"

notify:
name: Discord Notification
Expand Down
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,10 @@ if(WIN32)
set(CONF_DIR ${BIN_DIR})
get_property(IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) # ninja generator does not support $(Configuration)
if(MSVC AND "$ENV{CLION_IDE}" STREQUAL "" AND IS_MULTI_CONFIG)
set(DEV_BIN_DIR ${CMAKE_SOURCE_DIR}/${BIN_FOLDER_NAME}/${DEP_ARCH}_$(Configuration))
set(DEV_BIN_DIR ${DEV_BINARY_DIR}/${BIN_FOLDER_NAME}/${DEP_ARCH}_$(Configuration))
set(DEV_PROVIDED_LIBS_FOLDER ${CMAKE_SOURCE_DIR}/dep/lib/${DEP_ARCH}_$(Configuration))
else()
set(DEV_BIN_DIR ${CMAKE_SOURCE_DIR}/${BIN_FOLDER_NAME}/${DEP_ARCH}_${CMAKE_BUILD_TYPE})
set(DEV_BIN_DIR ${DEV_BINARY_DIR}/${BIN_FOLDER_NAME}/${DEP_ARCH}_${CMAKE_BUILD_TYPE})
set(DEV_PROVIDED_LIBS_FOLDER ${CMAKE_SOURCE_DIR}/dep/lib/${DEP_ARCH}_${CMAKE_BUILD_TYPE})
endif()

Expand Down Expand Up @@ -308,7 +308,7 @@ endif()

configure_file(
${CMAKE_SOURCE_DIR}/src/shared/revision.h.in
${CMAKE_SOURCE_DIR}/src/shared/revision.h
${CMAKE_BINARY_DIR}/src/shared/revision.h
@ONLY
)

Expand Down
3 changes: 3 additions & 0 deletions cmake/options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ option(BUILD_AHBOT "Build Auction House Bot mod" OFF)
option(BUILD_RECASTDEMOMOD "Build map/vmap/mmap viewer" OFF)
option(BUILD_GIT_ID "Build git_id" OFF)
option(BUILD_DOCS "Build documentation with doxygen" OFF)
set(DEV_BINARY_DIR ${CMAKE_BINARY_DIR} CACHE STRING "Executable directory on Windows")

# TODO: options that should be checked/created:
#option(CLI "With CLI" ON)
Expand Down Expand Up @@ -39,6 +40,8 @@ message(STATUS
BUILD_GIT_ID Build git_id
BUILD_DOCS Build documentation with doxygen
DEV_BINARY_DIR Target directory for executables on Windows only
To set an option simply type -D<OPTION>=<VALUE> after 'cmake <srcs>'.
Also, you can specify the generator with -G. see 'cmake --help' for more details
For example:
Expand Down
2 changes: 2 additions & 0 deletions cmake/showoptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ else()
message(STATUS "Build documentation : No (default)")
endif()

message(STATUS "Target directory for dev binaries(DEV_BINARY_DIR) = ${DEV_BINARY_DIR}")

# if(SQL)
# message(STATUS "Install SQL-files : Yes")
# else()
Expand Down
13 changes: 0 additions & 13 deletions src/shared/.gitignore

This file was deleted.

3 changes: 2 additions & 1 deletion src/shared/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ target_include_directories(${LIBRARY_NAME}
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
PUBLIC ${Boost_INCLUDE_DIRS}
PUBLIC ${OPENSSL_INCLUDE_DIR}
PUBLIC ${CMAKE_BINARY_DIR}/src/shared # For the generated revision.h.
PUBLIC "${CMAKE_SOURCE_DIR}/src/game"
)

Expand Down Expand Up @@ -273,7 +274,7 @@ if (BUILD_ELUNA)
endif()

# Mark the revision header as being generated.
set_source_files_properties(${CMAKE_SOURCE_DIR}/src/shared/revision.h
set_source_files_properties(${CMAKE_BINARY_DIR}/src/shared/revision.h
PROPERTIES GENERATED TRUE
HEADER_FILE_ONLY TRUE)
if(MSVC)
Expand Down

0 comments on commit 4202e5a

Please sign in to comment.