Skip to content

Commit

Permalink
CMake|Windows: Win32 resources and exports for plugins
Browse files Browse the repository at this point in the history
Making this automatic via deng_add_plugin() makes more sense.
  • Loading branch information
skyjake committed Feb 22, 2015
1 parent 8057272 commit 852e360
Show file tree
Hide file tree
Showing 27 changed files with 722 additions and 709 deletions.
13 changes: 13 additions & 0 deletions doomsday/apps/plugins/PluginConfig.cmake
Expand Up @@ -9,6 +9,19 @@ find_package (DengDoomsday QUIET)

macro (deng_add_plugin target)
sublist (_src 1 -1 ${ARGV})
if (WIN32)
# Find the exports .def and .rc files.
set (_exports "${CMAKE_CURRENT_SOURCE_DIR}/api/${target}.def")
if (NOT EXISTS ${_exports})
message (WARNING "Plugin \"${target}\" is missing the exports .def file.")
endif ()
list (APPEND _src ${_exports})
set (_winres "${CMAKE_CURRENT_SOURCE_DIR}/res/${target}.rc")
if (NOT EXISTS ${_winres})
message (WARNING "Plugin \"${target}\" is missing the resource .rc file.")
endif ()
list (APPEND _src ${_winres})
endif ()
add_library (${target} MODULE ${_src} ${DENG_RESOURCES})
target_include_directories (${target}
PUBLIC "${DENG_API_DIR}"
Expand Down
2 changes: 1 addition & 1 deletion doomsday/apps/plugins/dehread/CMakeLists.txt
Expand Up @@ -5,4 +5,4 @@ include (../PluginConfig.cmake)
include_directories (include)
file (GLOB SOURCES src/*.cpp include/*.h)

deng_add_plugin (dehread ${SOURCES} api/dpdehread.def)
deng_add_plugin (dehread ${SOURCES})
2 changes: 1 addition & 1 deletion doomsday/apps/plugins/directsound/CMakeLists.txt
Expand Up @@ -9,6 +9,6 @@ if (TARGET EAX2)
include_directories (include)
file (GLOB SOURCES src/*.cpp include/*.h)

deng_add_plugin (audio_directsound ${SOURCES} api/dsdirectsound.def)
deng_add_plugin (audio_directsound ${SOURCES})
target_link_libraries (audio_directsound PRIVATE DirectX EAX2)
endif ()
@@ -1,133 +1,133 @@
/**\file
*\section License
* License: GPL
* Online License Link: http://www.gnu.org/licenses/gpl.html
*
*\author Copyright � 2008-2009 Daniel Swanson <danij@dengine.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301 USA
*/
/**
* directsound.rc: dsDirectSound.dll resource script.
*/
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
#include "windows.h"
#include "../include/version.h"
#undef APSTUDIO_READONLY_SYMBOLS
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
# ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
# endif //_WIN32
# ifdef APSTUDIO_INVOKED
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE
BEGIN
"#include ""windows.h""\r\n"
"#include ""../include/version.h""\0"
END
3 TEXTINCLUDE
BEGIN
"#ifndef NO_MANIFEST\r\n"
" CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST ""dsdirectsound.dll.manifest""\r\n"
"#endif\r\n"
"\r\n"
"VS_VERSION_INFO VERSIONINFO\r\n"
"FILEVERSION PLUGIN_VERSION_NUMBER\r\n"
"PRODUCTVERSION PLUGIN_VERSION_NUMBER\r\n"
"# ifdef _DEBUG\r\n"
"FILEFLAGSMASK VS_FF_DEBUG | VS_FF_PRERELEASE\r\n"
"# else\r\n"
"FILEFLAGSMASK 0\r\n"
"# endif\r\n"
"FILEOS VOS_NT_WINDOWS32\r\n"
"FILETYPE VFT_DLL\r\n"
"FILESUBTYPE VFT2_UNKNOWN\r\n"
"BEGIN\r\n"
" BLOCK ""StringFileInfo""\r\n"
" BEGIN\r\n"
" BLOCK ""040904b0""\r\n"
" BEGIN\r\n"
" VALUE ""CompanyName"", ""\0""\r\n"
" VALUE ""FileDescription"", PLUGIN_NICENAME "" (Doomsday Engine audio plugin)\0""\r\n"
" VALUE ""FileVersion"", PLUGIN_VERSION_TEXT ""\0""\r\n"
" VALUE ""InternalName"", PLUGIN_NICENAME ""\0""\r\n"
" VALUE ""LegalCopyright"", ""Copyright � 2003-2012, deng Team\0""\r\n"
" VALUE ""OriginalFilename"", ""dsDirectSound.dll\0""\r\n"
" VALUE ""ProductName"", PLUGIN_NICENAME ""\0""\r\n"
" VALUE ""ProductVersion"", PLUGIN_VERSION_TEXT ""\0""\r\n"
" END\r\n"
" END\r\n"
"\r\n"
" BLOCK ""VarFileInfo""\r\n"
" BEGIN\r\n"
" VALUE ""Translation"", 0x409, 1200\r\n"
" END\r\n"
"END\r\n"
END
# endif
#endif // English (U.S.) resources
#ifndef APSTUDIO_INVOKED
VS_VERSION_INFO VERSIONINFO
FILEVERSION PLUGIN_VERSION_NUMBER
PRODUCTVERSION PLUGIN_VERSION_NUMBER
# ifdef _DEBUG
FILEFLAGSMASK VS_FF_DEBUG | VS_FF_PRERELEASE
# else
FILEFLAGSMASK 0
# endif
FILEOS VOS_NT_WINDOWS32
FILETYPE VFT_DLL
FILESUBTYPE VFT2_UNKNOWN
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904E4"
BEGIN
VALUE "CompanyName", "\0"
VALUE "FileDescription", PLUGIN_NICENAME " (Doomsday Engine audio plugin)\0"
VALUE "FileVersion", PLUGIN_VERSION_TEXT "\0"
VALUE "InternalName", PLUGIN_NICENAME "\0"
VALUE "LegalCopyright", "Copyright � 2003-2012, deng Team\0"
VALUE "OriginalFilename", "dsDirectSound.dll\0"
VALUE "ProductName", PLUGIN_NICENAME "\0"
VALUE "ProductVersion", PLUGIN_VERSION_TEXT "\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
#endif
/**\file
*\section License
* License: GPL
* Online License Link: http://www.gnu.org/licenses/gpl.html
*
*\author Copyright � 2008-2009 Daniel Swanson <danij@dengine.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301 USA
*/

/**
* directsound.rc: dsDirectSound.dll resource script.
*/

#include "resource.h"

#define APSTUDIO_READONLY_SYMBOLS

#include "windows.h"
#include "../include/version.h"

#undef APSTUDIO_READONLY_SYMBOLS

// English (U.S.) resources

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
# ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
# endif //_WIN32

# ifdef APSTUDIO_INVOKED
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END

2 TEXTINCLUDE
BEGIN
"#include ""windows.h""\r\n"
"#include ""../include/version.h""\0"
END

3 TEXTINCLUDE
BEGIN
"#ifndef NO_MANIFEST\r\n"
" CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST ""dsdirectsound.dll.manifest""\r\n"
"#endif\r\n"
"\r\n"
"VS_VERSION_INFO VERSIONINFO\r\n"
"FILEVERSION PLUGIN_VERSION_NUMBER\r\n"
"PRODUCTVERSION PLUGIN_VERSION_NUMBER\r\n"
"# ifdef _DEBUG\r\n"
"FILEFLAGSMASK VS_FF_DEBUG | VS_FF_PRERELEASE\r\n"
"# else\r\n"
"FILEFLAGSMASK 0\r\n"
"# endif\r\n"
"FILEOS VOS_NT_WINDOWS32\r\n"
"FILETYPE VFT_DLL\r\n"
"FILESUBTYPE VFT2_UNKNOWN\r\n"
"BEGIN\r\n"
" BLOCK ""StringFileInfo""\r\n"
" BEGIN\r\n"
" BLOCK ""040904b0""\r\n"
" BEGIN\r\n"
" VALUE ""CompanyName"", ""\0""\r\n"
" VALUE ""FileDescription"", PLUGIN_NICENAME "" (Doomsday Engine audio plugin)\0""\r\n"
" VALUE ""FileVersion"", PLUGIN_VERSION_TEXT ""\0""\r\n"
" VALUE ""InternalName"", PLUGIN_NICENAME ""\0""\r\n"
" VALUE ""LegalCopyright"", ""Copyright � 2003-2012, deng Team\0""\r\n"
" VALUE ""OriginalFilename"", ""dsDirectSound.dll\0""\r\n"
" VALUE ""ProductName"", PLUGIN_NICENAME ""\0""\r\n"
" VALUE ""ProductVersion"", PLUGIN_VERSION_TEXT ""\0""\r\n"
" END\r\n"
" END\r\n"
"\r\n"
" BLOCK ""VarFileInfo""\r\n"
" BEGIN\r\n"
" VALUE ""Translation"", 0x409, 1200\r\n"
" END\r\n"
"END\r\n"
END
# endif

#endif // English (U.S.) resources

#ifndef APSTUDIO_INVOKED
VS_VERSION_INFO VERSIONINFO
FILEVERSION PLUGIN_VERSION_NUMBER
PRODUCTVERSION PLUGIN_VERSION_NUMBER
# ifdef _DEBUG
FILEFLAGSMASK VS_FF_DEBUG | VS_FF_PRERELEASE
# else
FILEFLAGSMASK 0
# endif
FILEOS VOS_NT_WINDOWS32
FILETYPE VFT_DLL
FILESUBTYPE VFT2_UNKNOWN
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904E4"
BEGIN
VALUE "CompanyName", "\0"
VALUE "FileDescription", PLUGIN_NICENAME " (Doomsday Engine audio plugin)\0"
VALUE "FileVersion", PLUGIN_VERSION_TEXT "\0"
VALUE "InternalName", PLUGIN_NICENAME "\0"
VALUE "LegalCopyright", "Copyright � 2003-2012, deng Team\0"
VALUE "OriginalFilename", "dsDirectSound.dll\0"
VALUE "ProductName", PLUGIN_NICENAME "\0"
VALUE "ProductVersion", PLUGIN_VERSION_TEXT "\0"
END
END

BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
#endif
2 changes: 1 addition & 1 deletion doomsday/apps/plugins/doom/CMakeLists.txt
Expand Up @@ -14,4 +14,4 @@ file (GLOB SOURCES src/*.c src/*.cpp include/*.h)

deng_find_resources (libdoom.pk3)

deng_add_plugin (doom ${SOURCES} ${COMMON_SOURCES} api/doom.def)
deng_add_plugin (doom ${SOURCES} ${COMMON_SOURCES})
2 changes: 1 addition & 1 deletion doomsday/apps/plugins/doom64/CMakeLists.txt
Expand Up @@ -14,4 +14,4 @@ file (GLOB SOURCES src/*.c src/*.cpp include/*.h)

deng_find_resources (libdoom64.pk3)

deng_add_plugin (doom64 ${SOURCES} ${COMMON_SOURCES} api/doom64.def)
deng_add_plugin (doom64 ${SOURCES} ${COMMON_SOURCES})
2 changes: 1 addition & 1 deletion doomsday/apps/plugins/example/CMakeLists.txt
Expand Up @@ -7,4 +7,4 @@ include (../PluginConfig.cmake)

include_directories (include)

deng_add_plugin (example src/example.c include/version.h api/example.def)
deng_add_plugin (example src/example.c include/version.h)
2 changes: 1 addition & 1 deletion doomsday/apps/plugins/fluidsynth/CMakeLists.txt
Expand Up @@ -110,7 +110,7 @@ append (CMAKE_CXX_FLAGS_DEBUG "-DDENG_DSFLUIDSYNTH_DEBUG")
include_directories (include)
file (GLOB src src/*.cpp include/*.h)

deng_add_plugin (${tgt} ${src} ${SOURCES} api/dsfluidsynth.def)
deng_add_plugin (${tgt} ${src} ${SOURCES})

# Additional compiler options.
if (DENG_FLUIDSYNTH_EMBEDDED)
Expand Down

0 comments on commit 852e360

Please sign in to comment.