Skip to content

Commit

Permalink
Updated CMakeLists.txt.
Browse files Browse the repository at this point in the history
This doesn't fix the fact that if you change a data file it will not
be copied over until a source file is changed, but it is a good bit
neater.
  • Loading branch information
Kestrel Gregorich-Trevor committed Jan 20, 2024
1 parent 082c15e commit 08b4a8e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:

- name: Create Package
run: |
zip -r -db ${{github.workspace}}/zenzizenzizenzic-${{ runner.os }} build/zenzizenzizenzic_ncurses build/data/ README.md LICENSE
zip -r -db ${{github.workspace}}/zenzizenzizenzic-${{ runner.os }} build/zenzizenzizenzic_ncurses build/data/ build/README.md build/LICENSE
- name: Upload Release
uses: softprops/action-gh-release@v1
Expand Down
9 changes: 2 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ set (HEADERS
include/version.h
include/wfc.h
include/windows.h)
set (EXTRA data LICENSE README.md)
set (INCLUDE_DIR include)

# Create executable
Expand All @@ -90,14 +91,8 @@ target_link_libraries(${PROJECT_NAME} PUBLIC ${CJSON_LIBRARIES} -lpanelw ${CURSE
set_target_properties(${PROJECT_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")

# Copy data files
# See https://stackoverflow.com/questions/13429656/how-to-copy-contents-of-a-directory-into-build-directory-after-make-with-cmake
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_SOURCE_DIR}/data $<TARGET_FILE_DIR:${PROJECT_NAME}>/data
COMMENT "Copying data folder to output dir.")
file(COPY ${EXTRA} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})

message(STATUS "Configuring CMake for ${PROJECT_NAME} v${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}-${RELEASE_STATE}")
message(STATUS "Release Type: ${CMAKE_BUILD_TYPE}")
##########################Install##########################
install(TARGETS ${PROJECT_NAME} DESTINATION .)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/data/ DESTINATION data)
Expand Down

0 comments on commit 08b4a8e

Please sign in to comment.