[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[vidalia-svn] r3796: Fix an error message related to finding windres.exe, and mak (in vidalia/trunk: cmake src/vidalia)
Author: edmanm
Date: 2009-05-26 02:37:07 -0400 (Tue, 26 May 2009)
New Revision: 3796
Modified:
vidalia/trunk/cmake/VidaliaMacros.cmake
vidalia/trunk/src/vidalia/CMakeLists.txt
Log:
Fix an error message related to finding windres.exe, and make windres.exe
required only if we are building with MinGW. MSVC can handle .rc files by
itself just fine.
Modified: vidalia/trunk/cmake/VidaliaMacros.cmake
===================================================================
--- vidalia/trunk/cmake/VidaliaMacros.cmake 2009-05-25 20:49:14 UTC (rev 3795)
+++ vidalia/trunk/cmake/VidaliaMacros.cmake 2009-05-26 06:37:07 UTC (rev 3796)
@@ -34,14 +34,14 @@
## We need windres.exe when building on Win32 to compile the .rc file
-if (WIN32)
+if (WIN32 AND NOT MSVC)
find_program(WIN32_WINDRES_EXECUTABLE NAMES windres.exe ${QT_BINARY_DIR})
if (NOT WIN32_WINDRES_EXECUTABLE)
message(FATAL_ERROR
- "Vidalia could not find windres. Please make sure Qt is installed and its bin directory is in your PATH environment variable."
+ "Vidalia could not find windres. Please make sure MinGW is installed and its bin directory is in your PATH environment variable."
)
endif(NOT WIN32_WINDRES_EXECUTABLE)
-endif(WIN32)
+endif(WIN32 AND NOT MSVC)
## Adds custom commands to the specified target that will update each of the
## supplied .po files
@@ -149,23 +149,29 @@
if (WIN32)
- ## Wraps the supplied .rc files in windres commands
- macro(WIN32_WRAP_RC outfiles)
+ ## Wraps the supplied .rc files in windres commands if we're building
+ ## with MinGW. Otherwise, it just adds the .rc files directly to the
+ ## list of output files.
+ macro(WIN32_ADD_RC outfiles)
foreach(it ${ARGN})
- get_filename_component(it ${it} ABSOLUTE)
- get_filename_component(outfile ${it} NAME_WE)
- get_filename_component(rc_path ${it} PATH)
+ if (NOT MSVC)
+ get_filename_component(it ${it} ABSOLUTE)
+ get_filename_component(outfile ${it} NAME_WE)
+ get_filename_component(rc_path ${it} PATH)
- set(outfile
- ${CMAKE_CURRENT_BINARY_DIR}/${outfile}_res${CMAKE_CXX_OUTPUT_EXTENSION}
- )
- add_custom_command(OUTPUT ${outfile}
- COMMAND ${WIN32_WINDRES_EXECUTABLE}
- ARGS -i ${it} -o ${outfile} --include-dir=${rc_path}
- MAIN_DEPENDENCY ${it}
- )
- set(${outfiles} ${${outfiles}} ${outfile})
+ set(outfile
+ ${CMAKE_CURRENT_BINARY_DIR}/${outfile}_res${CMAKE_CXX_OUTPUT_EXTENSION}
+ )
+ add_custom_command(OUTPUT ${outfile}
+ COMMAND ${WIN32_WINDRES_EXECUTABLE}
+ ARGS -i ${it} -o ${outfile} --include-dir=${rc_path}
+ MAIN_DEPENDENCY ${it}
+ )
+ set(${outfiles} ${${outfiles}} ${outfile})
+ else (NOT MSVC)
+ set(${outfiles} ${${outfiles}} ${it})
+ endif(NOT MSVC)
endforeach(it)
- endmacro(WIN32_WRAP_RC)
+ endmacro(WIN32_ADD_RC)
endif(WIN32)
Modified: vidalia/trunk/src/vidalia/CMakeLists.txt
===================================================================
--- vidalia/trunk/src/vidalia/CMakeLists.txt 2009-05-25 20:49:14 UTC (rev 3795)
+++ vidalia/trunk/src/vidalia/CMakeLists.txt 2009-05-26 06:37:07 UTC (rev 3796)
@@ -396,7 +396,7 @@
if (WIN32)
## Create a Windows binary
- win32_wrap_rc(vidalia_SRCS res/vidalia_win.rc)
+ win32_add_rc(vidalia_SRCS res/vidalia_win.rc)
add_executable(${vidalia_BIN} WIN32 ${vidalia_SRCS})
## Copy the Marble data into the data/ directory under the binary