ref: bd8f0e81e774c8241b5bd985fe5563b302834db9
parent: a10578ede677e72c7832775f5020d855dccc01ce
author: Alex Mayfield <[email protected]>
date: Mon May 21 14:29:14 EDT 2018
Fix setup executable rc and manifest files
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -5,6 +5,7 @@
# Autotools variables
set(top_srcdir ${CMAKE_CURRENT_SOURCE_DIR})
+set(top_builddir ${CMAKE_CURRENT_BINARY_DIR})
# AC_INIT variables
set(PACKAGE_NAME "${PROJECT_NAME}")
@@ -36,6 +37,8 @@
configure_file(config.h.cin config.h)
configure_file(src/resource.rc.in src/resource.rc)
+configure_file(src/setup-res.rc.in src/setup-res.rc)
+configure_file(src/setup/setup-manifest.xml.in src/setup/setup-manifest.xml)
foreach(SUBDIR textscreen midiproc opl pcsound src)
add_subdirectory("${SUBDIR}")
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -183,12 +183,17 @@
net_structrw.c net_structrw.h
z_native.c z_zone.h)
-#if(WIN32)
- #add_executable("${PROGRAM_PREFIX}setup" ${SETUP_FILES} ${COMMON_SOURCE_FILES} "${CMAKE_CURRENT_BINARY_DIR}/setup-res.rc")
-#else()
+if(WIN32)
+ add_executable("${PROGRAM_PREFIX}setup" ${SETUP_FILES} ${COMMON_SOURCE_FILES} "${CMAKE_CURRENT_BINARY_DIR}/setup-res.rc")
+else()
add_executable("${PROGRAM_PREFIX}setup" ${SETUP_FILES} ${COMMON_SOURCE_FILES})
-#endif()
+endif()
target_include_directories("${PROGRAM_PREFIX}setup"
PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/../")
target_link_libraries("${PROGRAM_PREFIX}setup" setup textscreen SDL2::SDL2main SDL2::SDL2 SDL2::mixer SDL2::net)
+
+if(MSVC)
+ set_target_properties("${PROGRAM_PREFIX}setup" PROPERTIES
+ LINK_FLAGS "/MANIFEST:NO")
+endif()