[aseprite] 97/134: Add post build target to copy the whole data/ dir into build/bin/ dir
Tobias Hansen
thansen at moszumanska.debian.org
Sat Mar 14 17:10:12 UTC 2015
This is an automated email from the git hooks/post-receive script.
thansen pushed a commit to branch master
in repository aseprite.
commit 807598d5c3faefd7399291dbeb5239321869e3b5
Author: David Capello <davidcapello at gmail.com>
Date: Tue Dec 2 11:15:06 2014 -0300
Add post build target to copy the whole data/ dir into build/bin/ dir
---
INSTALL.md | 7 ++-----
src/CMakeLists.txt | 30 +++++++++++++++++++++++-------
2 files changed, 25 insertions(+), 12 deletions(-)
diff --git a/INSTALL.md b/INSTALL.md
index 1e3acfb..b6ca554 100644
--- a/INSTALL.md
+++ b/INSTALL.md
@@ -52,11 +52,8 @@ the source code in a directory called `aseprite-source`):
commands, you have to compile the project executing make, nmake,
opening the solution, etc.
-4. When the project is compiled, you can copy the resulting executable
- file (e.g. `build/bin/aseprite.exe`) to `aseprite-source` and
- execute it. If you have used a Visual Studio project, you can copy
- the whole `data/` directory to `build/bin/` so you can run/debug
- the program from Visual Studio IDE.
+4. When the project is compiled, you can find the executable file
+ inside `build/bin/aseprite.exe`.
## Mac OS X details
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 1b520c9..b7b662f 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -217,7 +217,24 @@ if(LIBALLEGRO4_LINK_FLAGS)
endif()
######################################################################
-# ASEPRITE application
+# Copy data/ directory target
+
+file(GLOB_RECURSE src_data_files
+ RELATIVE ${CMAKE_SOURCE_DIR}/data/ "${CMAKE_SOURCE_DIR}/data/*.*")
+foreach(fn ${src_data_files})
+ string(MAKE_C_IDENTIFIER "copy_data_${fn}" copy_fn_target_name)
+ add_custom_target(${copy_fn_target_name})
+ add_custom_command(
+ OUTPUT ${CMAKE_BINARY_DIR}/bin/data/${fn}
+ COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/data/${fn} ${CMAKE_BINARY_DIR}/bin/data/${fn}
+ MAIN_DEPENDENCY ${CMAKE_SOURCE_DIR}/data/${fn})
+ list(APPEND out_data_files ${CMAKE_BINARY_DIR}/bin/data/${fn})
+endforeach()
+
+add_custom_target(copy_data DEPENDS ${out_data_files})
+
+######################################################################
+# Aseprite application
if(WIN32)
set(win32_resources main/resources_win32.rc)
@@ -227,8 +244,12 @@ if(UNIX)
set(x11_resources main/xpm_icon.c)
endif(UNIX)
-add_executable(aseprite WIN32 main/main.cpp ${win32_resources} ${x11_resources})
+add_executable(aseprite WIN32
+ main/main.cpp
+ ${win32_resources}
+ ${x11_resources})
target_link_libraries(aseprite ${all_libs})
+add_dependencies(aseprite copy_data)
install(TARGETS aseprite
RUNTIME DESTINATION bin)
@@ -236,11 +257,6 @@ install(TARGETS aseprite
install(DIRECTORY ../data
DESTINATION share/aseprite)
-if(EXISTS ../docs/quickref.pdf)
- install(FILES ../docs/quickref.pdf
- DESTINATION share/aseprite/docs/quickref.pdf)
-endif()
-
######################################################################
# Tests
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/aseprite.git
More information about the Pkg-games-commits
mailing list