Commit 63de4115 authored by f3nix's avatar f3nix

CMake:

* Add mingw_resource_compiler macro (Win32).
* Fix windres wxWidgets include paths (Win32).
parent 2c7eaa60
...@@ -75,6 +75,9 @@ check_find_package_result(wxWidgets_FOUND "wxWidgets") ...@@ -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
......
# 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)
...@@ -58,12 +58,8 @@ set(CVPCB_EXTRA_SRCS ...@@ -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)
......
...@@ -104,12 +104,8 @@ set(EESCHEMA_EXTRA_SRCS ...@@ -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)
......
...@@ -60,12 +60,8 @@ set(GERBVIEW_EXTRA_SRCS ...@@ -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)
......
...@@ -15,12 +15,8 @@ set(KICAD_SRCS ...@@ -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)
......
...@@ -151,12 +151,8 @@ set(PCBNEW_EXTRA_SRCS ...@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment