Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
SRB2Classic
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
PAS
SRB2Classic
Commits
ec79756c
Commit
ec79756c
authored
10 years ago
by
Eidolon
Browse files
Options
Downloads
Patches
Plain Diff
cmake: copy DLLs to build directory in MSVC
this is done as a POST_BUILD step
parent
4d3a7dd8
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CMakeLists.txt
+16
-0
16 additions, 0 deletions
CMakeLists.txt
src/sdl/CMakeLists.txt
+18
-18
18 additions, 18 deletions
src/sdl/CMakeLists.txt
with
34 additions
and
18 deletions
CMakeLists.txt
+
16
−
0
View file @
ec79756c
...
@@ -34,6 +34,22 @@ macro(add_framework fwname appname)
...
@@ -34,6 +34,22 @@ macro(add_framework fwname appname)
endif
()
endif
()
endmacro
()
endmacro
()
# Macro to copy Windows DLLs to Debug/Release folder for easy debugging
# Note: this is general purpose, we could copy anything. Just using for DLLs on MSVC though
macro
(
copy_files_to_build_dir target dlllist_var
)
if
(
MSVC
)
# http://stackoverflow.com/a/26983405/3064195
foreach
(
dlllist_item
${${
dlllist_var
}}
)
get_filename_component
(
dllname
${
dlllist_item
}
NAME
)
add_custom_command
(
TARGET
${
target
}
POST_BUILD
COMMAND
${
CMAKE_COMMAND
}
-E copy_if_different
${
dlllist_item
}
${
CMAKE_CURRENT_BINARY_DIR
}
/\$\
(
Configuration\
)
/
${
dllname
}
)
endforeach
()
endif
()
endmacro
()
# 64-bit check
# 64-bit check
if
(
${
CMAKE_SIZEOF_VOID_P
}
EQUAL 8
)
if
(
${
CMAKE_SIZEOF_VOID_P
}
EQUAL 8
)
message
(
STATUS
"Target is 64-bit"
)
message
(
STATUS
"Target is 64-bit"
)
...
...
This diff is collapsed.
Click to expand it.
src/sdl/CMakeLists.txt
+
18
−
18
View file @
ec79756c
...
@@ -179,32 +179,32 @@ if(${SDL2_FOUND})
...
@@ -179,32 +179,32 @@ if(${SDL2_FOUND})
endif
()
endif
()
if
(
${
CMAKE_SYSTEM
}
MATCHES Windows
)
if
(
${
CMAKE_SYSTEM
}
MATCHES Windows
)
find_library
(
SRB2_SDL2_DLL_SDL2
"SDL2.dll"
)
set
(
win_extra_dll_list
""
)
macro
(
getwinlib dllname defaultname
)
find_library
(
SRB2_SDL2_DLL_
${
dllname
}
"
${
defaultname
}
"
)
list
(
APPEND win_extra_dll_list
${
SRB2_SDL2_DLL_
${
dllname
}}
)
endmacro
()
getwinlib
(
SDL2
"SDL2.dll"
)
if
(
${
SRB2_CONFIG_SDL2_USEMIXER
}
)
if
(
${
SRB2_CONFIG_SDL2_USEMIXER
}
)
find_library
(
SRB2_SDL2_DLL_
SDL2_mixer
"SDL2_mixer.dll"
)
getwinlib
(
SDL2_mixer
"SDL2_mixer.dll"
)
find_library
(
SRB2_SDL2_DLL_
libmikmod-2
"libmikmod-2.dll"
)
getwinlib
(
libmikmod-2
"libmikmod-2.dll"
)
find_library
(
SRB2_SDL2_DLL_
libogg_0
"libogg-0.dll"
)
getwinlib
(
libogg_0
"libogg-0.dll"
)
find_library
(
SRB2_SDL2_DLL_
libvorbis_0
"libvorbis-0.dll"
)
getwinlib
(
libvorbis_0
"libvorbis-0.dll"
)
find_library
(
SRB2_SDL2_DLL_
libvorbisfile_3
"libvorbisfile-3.dll"
)
getwinlib
(
libvorbisfile_3
"libvorbisfile-3.dll"
)
find_library
(
SRB2_SDL2_DLL_
smpeg2
"smpeg2.dll"
)
getwinlib
(
smpeg2
"smpeg2.dll"
)
endif
()
endif
()
if
(
${
SRB2_CONFIG_HAVE_GME
}
)
if
(
${
SRB2_CONFIG_HAVE_GME
}
)
find_library
(
SRB2_SDL2_DLL_
libgme
"libgme.dll"
)
getwinlib
(
libgme
"libgme.dll"
)
endif
()
endif
()
install
(
PROGRAMS
install
(
PROGRAMS
${
SRB2_SDL2_DLL_SDL2
}
${
win_extra_dll_list
}
${
SRB2_SDL2_DLL_SDL2_mixer
}
${
SRB2_SDL2_DLL_libmikmod
}
${
SRB2_SDL2_DLL_libogg_0
}
${
SRB2_SDL2_DLL_libvorbis_0
}
${
SRB2_SDL2_DLL_libvorbisfile_3
}
${
SRB2_SDL2_DLL_smpeg2
}
${
SRB2_SDL2_DLL_libgme
}
DESTINATION .
DESTINATION .
)
)
# We also want to copy those DLLs to build directories on MSVC.
# So we'll add a post_build step.
copy_files_to_build_dir
(
${
SRB2_SDL2_EXE_NAME
}
win_extra_dll_list
)
endif
()
endif
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment