CMakeLists pass windows sources (manifest and resource file) to executable targets...
authornOOb3167 <nOOb3167@gmail.com>
Mon, 19 Feb 2018 13:57:01 +0000 (14:57 +0100)
committerSmallJoker <SmallJoker@users.noreply.github.com>
Fri, 23 Feb 2018 16:02:02 +0000 (17:02 +0100)
src/CMakeLists.txt

index c2b28832a19801093a06faf4483684d1a80ca9a6..e7759b7a74b8e5e950496e56067d6071a23b9244 100644 (file)
@@ -471,9 +471,9 @@ if(WIN32)
                        -o ${CMAKE_CURRENT_BINARY_DIR}/winresource_rc.o
                        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
                        DEPENDS ${WINRESOURCE_FILE})
-               SET(common_SRCS ${common_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/winresource_rc.o)
+               SET(extra_windows_SRCS ${CMAKE_CURRENT_BINARY_DIR}/winresource_rc.o)
        else(MINGW) # Probably MSVC
-               set(common_SRCS ${common_SRCS} ${WINRESOURCE_FILE} ${MINETEST_EXE_MANIFEST_FILE})
+               set(extra_windows_SRCS ${WINRESOURCE_FILE} ${MINETEST_EXE_MANIFEST_FILE})
        endif(MINGW)
 endif()
 
@@ -561,7 +561,7 @@ set(EXECUTABLE_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/bin")
 
 
 if(BUILD_CLIENT)
-       add_executable(${PROJECT_NAME} ${client_SRCS})
+       add_executable(${PROJECT_NAME} ${client_SRCS} ${extra_windows_SRCS})
        add_dependencies(${PROJECT_NAME} GenerateVersion)
        set(client_LIBS
                ${PROJECT_NAME}
@@ -629,7 +629,7 @@ endif(BUILD_CLIENT)
 
 
 if(BUILD_SERVER)
-       add_executable(${PROJECT_NAME}server ${server_SRCS})
+       add_executable(${PROJECT_NAME}server ${server_SRCS} ${extra_windows_SRCS})
        add_dependencies(${PROJECT_NAME}server GenerateVersion)
        target_link_libraries(
                ${PROJECT_NAME}server