Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
OpenWalnut Core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
44
Issues
44
List
Boards
Labels
Service Desk
Milestones
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
OpenWalnut
OpenWalnut Core
Commits
b32ffe08
Commit
b32ffe08
authored
Dec 09, 2010
by
ledig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ADD] script and cmake target for easy windows release
parent
70c0577f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
74 additions
and
0 deletions
+74
-0
src/CMakeLists.txt
src/CMakeLists.txt
+7
-0
tools/copyWinRelease.py
tools/copyWinRelease.py
+67
-0
No files found.
src/CMakeLists.txt
View file @
b32ffe08
...
...
@@ -441,6 +441,13 @@ ADD_CUSTOM_TARGET( removewinlineendings
COMMENT
"Removes Windows Line endings"
)
IF
(
CMAKE_GENERATOR MATCHES
"Visual Studio"
)
ADD_CUSTOM_TARGET
(
copyWinRelease
COMMAND
${
PYTHON_EXECUTABLE
}
${
PROJECT_SOURCE_DIR
}
/../tools/copyWinRelease.py
WORKING_DIRECTORY
${
PROJECT_BINARY_DIR
}
COMMENT
"Copys all the necessary Windows dll's and executables so binaries can easyly be distributed"
)
ENDIF
(
CMAKE_GENERATOR MATCHES
"Visual Studio"
)
#-------------------------------------------------------------------------------------------------------------
...
...
tools/copyWinRelease.py
0 → 100644
View file @
b32ffe08
#!/usr/bin/env python
import
os
import
string
import
shutil
import
sys
HELP_USAGE
=
"Usage: copyWinRelease.py
\n
"
def
get_immediate_subdirectories
(
dir
):
return
[
name
for
name
in
os
.
listdir
(
dir
)
if
os
.
path
.
isdir
(
os
.
path
.
join
(
dir
,
name
))]
def
copyRelevantBinarys
(
fromDir
,
toDir
):
shutil
.
copy2
(
fromDir
+
"/walnut.exe"
,
toDir
)
shutil
.
copy2
(
fromDir
+
"/OWcommon.dll"
,
toDir
)
shutil
.
copy2
(
fromDir
+
"/OWdataHandler.dll"
,
toDir
)
shutil
.
copy2
(
fromDir
+
"/OWge.dll"
,
toDir
)
shutil
.
copy2
(
fromDir
+
"/OWkernel.dll"
,
toDir
)
def
main
(
argv
):
num_args
=
len
(
sys
.
argv
)
-
1
if
num_args
!=
0
:
print
HELP_USAGE
return
# assume we are in the output directory (build)
# first create a folder were all the ow binary release is put
# copy from /bin all the relevant dll's and the executable
# copy the share folder
# get a list of directorys from /src/modules
# remove all the folders in build/lib/modules not in the list before
# in the target dir create a folder lib/modules
# iterate over the list and copy all the release dll's (OWmodule_%MODULE_NAME%.dll) and if existing the shaders
OWBinDir
=
"OWBinary"
if
(
os
.
path
.
exists
(
OWBinDir
)
):
shutil
.
rmtree
(
OWBinDir
)
os
.
mkdir
(
OWBinDir
)
OWBinExec
=
OWBinDir
+
"/bin"
os
.
mkdir
(
OWBinExec
)
copyRelevantBinarys
(
"bin"
,
OWBinExec
)
shutil
.
copytree
(
"share"
,
OWBinDir
+
"/share"
)
moduleExistingDirs
=
get_immediate_subdirectories
(
"../src/modules"
)
moduleCompDirs
=
get_immediate_subdirectories
(
"lib/modules"
)
# delete leftover compiled modules, e.g. if renamed removed or sth like this
for
module
in
moduleCompDirs
:
found
=
0
for
srcModule
in
moduleExistingDirs
:
if
(
string
.
find
(
module
,
srcModule
)
!=
-
1
):
found
=
1
if
(
found
==
0
):
print
"lib/modules/"
+
module
+
" not found in src, deleting"
shutil
.
rmtree
(
"lib/modules"
+
"/"
+
module
)
OWBinModuleDir
=
OWBinDir
+
"/lib/modules"
os
.
makedirs
(
OWBinModuleDir
)
for
cpymodule
in
moduleExistingDirs
:
currentModuleDir
=
OWBinModuleDir
+
"/"
+
cpymodule
currentSrcDir
=
"lib/modules/"
+
cpymodule
if
(
os
.
path
.
exists
(
currentSrcDir
)
):
os
.
mkdir
(
currentModuleDir
)
if
(
os
.
path
.
exists
(
currentSrcDir
+
"/OWmodule_"
+
cpymodule
+
".dll"
)
):
shutil
.
copy2
(
currentSrcDir
+
"/OWmodule_"
+
cpymodule
+
".dll"
,
currentModuleDir
)
if
(
os
.
path
.
exists
(
currentSrcDir
+
"/shaders"
)
):
shutil
.
copytree
(
currentSrcDir
+
"/shaders"
,
currentModuleDir
+
"/shaders"
)
if
__name__
==
"__main__"
:
main
(
sys
.
argv
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment