* Add mingw_resource_compiler macro (Win32).
* Fix windres wxWidgets include paths (Win32).
This commit is contained in:
f3nix 2008-04-13 19:07:32 +00:00
parent 2c7eaa608b
commit 63de4115dc
7 changed files with 40 additions and 30 deletions

View File

@ -75,6 +75,9 @@ check_find_package_result(wxWidgets_FOUND "wxWidgets")
# Include wxWidgets macros. # Include wxWidgets macros.
include(${wxWidgets_USE_FILE}) include(${wxWidgets_USE_FILE})
# Include MinGW resource compiler.
include(MinGWResourceCompiler)
# Include paths. # Include paths.
include_directories( include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/include

View File

@ -0,0 +1,27 @@
# resource compilation for mingw (http://www.cmake.org/Bug/view.php?id=4068)
macro(dbg_msg _MSG)
# message(STATUS "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}): ${_MSG}")
endmacro(dbg_msg)
macro(mingw_resource_compiler _NAME)
set(_IN "${CMAKE_CURRENT_SOURCE_DIR}/${_NAME}.rc")
dbg_msg("_IN: ${_IN}")
set(_OUT "${CMAKE_CURRENT_BINARY_DIR}/${_NAME}_rc.o")
dbg_msg("_OUT: ${_OUT}")
set(_WINDRES_INCLUDE_DIRS -I${CMAKE_CURRENT_SOURCE_DIR})
foreach(wx_include_dir ${wxWidgets_INCLUDE_DIRS})
set(_WINDRES_INCLUDE_DIRS ${_WINDRES_INCLUDE_DIRS} -I${wx_include_dir})
endforeach(wx_include_dir ${wxWidgets_INCLUDE_DIRS})
dbg_msg("_WINDRES_INCLUDE_DIRS: ${_WINDRES_INCLUDE_DIRS}")
set(_ARGS ${_WINDRES_INCLUDE_DIRS} -i${_IN} -o${_OUT})
dbg_msg("_ARGS: ${_ARGS}")
add_custom_command(OUTPUT ${_OUT}
COMMAND windres.exe
ARGS ${_ARGS}
VERBATIM)
endmacro(mingw_resource_compiler)

View File

@ -58,12 +58,8 @@ set(CVPCB_EXTRA_SRCS
if(WIN32) if(WIN32)
if(MINGW) if(MINGW)
# resource compilation for mingw (http://www.cmake.org/Bug/view.php?id=4068) mingw_resource_compiler(cvpcb)
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/cvpcb_rc.o set(CVPCB_RESOURCES ${_OUT})
COMMAND windres.exe -I ${CMAKE_CURRENT_SOURCE_DIR} -I ${wxWidgets_ROOT_DIR}/include
-i ${CMAKE_CURRENT_SOURCE_DIR}/cvpcb.rc
-o ${CMAKE_CURRENT_BINARY_DIR}/cvpcb_rc.o)
set(CVPCB_RESOURCES ${CMAKE_CURRENT_BINARY_DIR}/cvpcb_rc.o)
else(MINGW) else(MINGW)
set(CVPCB_RESOURCES cvpcb.rc) set(CVPCB_RESOURCES cvpcb.rc)
endif(MINGW) endif(MINGW)

View File

@ -104,12 +104,8 @@ set(EESCHEMA_EXTRA_SRCS
if(WIN32) if(WIN32)
if(MINGW) if(MINGW)
# resource compilation for mingw (http://www.cmake.org/Bug/view.php?id=4068) mingw_resource_compiler(eeschema)
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/eeschema_rc.o set(EESCHEMA_RESOURCES ${_OUT})
COMMAND windres.exe -I ${CMAKE_CURRENT_SOURCE_DIR} -I ${wxWidgets_ROOT_DIR}/include
-i ${CMAKE_CURRENT_SOURCE_DIR}/eeschema.rc
-o ${CMAKE_CURRENT_BINARY_DIR}/eeschema_rc.o)
set(EESCHEMA_RESOURCES ${CMAKE_CURRENT_BINARY_DIR}/eeschema_rc.o)
else(MINGW) else(MINGW)
set(EESCHEMA_RESOURCES eeschema.rc) set(EESCHEMA_RESOURCES eeschema.rc)
endif(MINGW) endif(MINGW)

View File

@ -60,12 +60,8 @@ set(GERBVIEW_EXTRA_SRCS
if(WIN32) if(WIN32)
if(MINGW) if(MINGW)
# resource compilation for mingw (http://www.cmake.org/Bug/view.php?id=4068) mingw_resource_compiler(gerbview)
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/gerbview_rc.o set(GERBVIEW_RESOURCES ${_OUT})
COMMAND windres.exe -I ${CMAKE_CURRENT_SOURCE_DIR} -I ${wxWidgets_ROOT_DIR}/include
-i ${CMAKE_CURRENT_SOURCE_DIR}/gerbview.rc
-o ${CMAKE_CURRENT_BINARY_DIR}/gerbview_rc.o)
set(GERBVIEW_RESOURCES ${CMAKE_CURRENT_BINARY_DIR}/gerbview_rc.o)
else(MINGW) else(MINGW)
set(GERBVIEW_RESOURCES gerbview.rc) set(GERBVIEW_RESOURCES gerbview.rc)
endif(MINGW) endif(MINGW)

View File

@ -15,12 +15,8 @@ set(KICAD_SRCS
if(WIN32) if(WIN32)
if(MINGW) if(MINGW)
# resource compilation for mingw (http://www.cmake.org/Bug/view.php?id=4068) mingw_resource_compiler(kicad)
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/kicad_rc.o set(KICAD_RESOURCES ${_OUT})
COMMAND windres.exe -I ${CMAKE_CURRENT_SOURCE_DIR} -I ${wxWidgets_ROOT_DIR}/include
-i ${CMAKE_CURRENT_SOURCE_DIR}/kicad.rc
-o ${CMAKE_CURRENT_BINARY_DIR}/kicad_rc.o)
set(KICAD_RESOURCES ${CMAKE_CURRENT_BINARY_DIR}/kicad_rc.o)
else(MINGW) else(MINGW)
set(KICAD_RESOURCES kicad.rc) set(KICAD_RESOURCES kicad.rc)
endif(MINGW) endif(MINGW)

View File

@ -151,12 +151,8 @@ set(PCBNEW_EXTRA_SRCS
if(WIN32) if(WIN32)
if(MINGW) if(MINGW)
# resource compilation for mingw (http://www.cmake.org/Bug/view.php?id=4068) mingw_resource_compiler(pcbnew)
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/pcbnew_rc.o set(PCBNEW_RESOURCES ${_OUT})
COMMAND windres.exe -I ${CMAKE_CURRENT_SOURCE_DIR} -I ${wxWidgets_ROOT_DIR}/include
-i ${CMAKE_CURRENT_SOURCE_DIR}/pcbnew.rc
-o ${CMAKE_CURRENT_BINARY_DIR}/pcbnew_rc.o)
set(PCBNEW_RESOURCES ${CMAKE_CURRENT_BINARY_DIR}/pcbnew_rc.o)
else(MINGW) else(MINGW)
set(PCBNEW_RESOURCES pcbnew.rc) set(PCBNEW_RESOURCES pcbnew.rc)
endif(MINGW) endif(MINGW)