1
0
Fork 0

CMake: Added resources to windows projects.

This commit is contained in:
madmaxoft 2014-01-13 17:15:34 +01:00
parent b9eb38a17f
commit 89e641071e
1 changed files with 14 additions and 1 deletions

View File

@ -25,6 +25,15 @@ if (NOT MSVC)
list(REMOVE_ITEM SOURCE "${PROJECT_SOURCE_DIR}/StackWalker.cpp" "${PROJECT_SOURCE_DIR}/LeakFinder.cpp")
# If building a windows version, but not using MSVC, add the resources directly to the makefile:
if (WIN32)
FILE(GLOB ResourceFiles
"Resources/*.rc"
)
list(APPEND SOURCE "${ResourceFiles}")
endif()
else ()
# Generate the Bindings if they don't exist:
@ -37,12 +46,16 @@ else ()
)
endif()
# Add all subfolders as solution-folders:
list(APPEND FOLDERS "Resources")
function(includefolder PATH)
FILE(GLOB FOLDER_FILES
"${PATH}/*.cpp"
"${PATH}/*.h"
"${PATH}/*.rc"
)
source_group("${PATH}" FILES ${FOLDER_FILES})
message("Files included in folder " ${PATH} ": " "${FOLDER_FILES}")
endfunction(includefolder)
foreach(folder ${FOLDERS})
@ -69,9 +82,9 @@ else ()
SET_SOURCE_FILES_PROPERTIES(
"StackWalker.cpp LeakFinder.h" PROPERTIES COMPILE_FLAGS "/Yc\"Globals.h\""
)
list(APPEND SOURCE "Resources/MCServer.rc")
endif()
set(EXECUTABLE MCServer)
add_executable(${EXECUTABLE} ${SOURCE})