Commit c77c3906 authored by f3nix's avatar f3nix

CMake:

* Set a NAME_RESOURCES variable in MinGWResourceCompiler.
* Fix looking for zlib under msys (C:\msys\1.0). Minizip now builds under windows with external zlib.
parent 8123d3a5
TODO:
* Fix minizip build on windows.
* Add install targets for binaries and resources on Mac.
* Add PYTHON.
* Testing.
......
# - Find zlib
# Find the native ZLIB includes and library
#
# ZLIB_INCLUDE_DIR - where to find zlib.h, etc.
# ZLIB_LIBRARIES - List of libraries when using zlib.
# ZLIB_FOUND - True if zlib found.
IF(MSYS)
SET(ZLIB_DIR_SEARCH
c:/msys/1.0
)
ENDIF(MSYS)
IF (ZLIB_INCLUDE_DIR)
# Already in cache, be silent
SET(ZLIB_FIND_QUIETLY TRUE)
ENDIF (ZLIB_INCLUDE_DIR)
FIND_PATH(ZLIB_INCLUDE_DIR zlib.h
/usr/local/include
/usr/include
${ZLIB_DIR_SEARCH}/local/include
)
SET(ZLIB_NAMES z zlib zdll)
FIND_LIBRARY(ZLIB_LIBRARY
NAMES ${ZLIB_NAMES}
PATHS /usr/lib /usr/local/lib ${ZLIB_DIR_SEARCH}/local/lib
)
IF (ZLIB_INCLUDE_DIR AND ZLIB_LIBRARY)
SET(ZLIB_FOUND TRUE)
SET( ZLIB_LIBRARIES ${ZLIB_LIBRARY} )
ELSE (ZLIB_INCLUDE_DIR AND ZLIB_LIBRARY)
SET(ZLIB_FOUND FALSE)
SET( ZLIB_LIBRARIES )
ENDIF (ZLIB_INCLUDE_DIR AND ZLIB_LIBRARY)
IF (ZLIB_FOUND)
IF (NOT ZLIB_FIND_QUIETLY)
MESSAGE(STATUS "Found ZLIB: ${ZLIB_LIBRARY}")
ENDIF (NOT ZLIB_FIND_QUIETLY)
ELSE (ZLIB_FOUND)
IF (ZLIB_FIND_REQUIRED)
MESSAGE(STATUS "Looked for Z libraries named ${ZLIBS_NAMES}.")
MESSAGE(FATAL_ERROR "Could NOT find z library")
ENDIF (ZLIB_FIND_REQUIRED)
ENDIF (ZLIB_FOUND)
MARK_AS_ADVANCED(
ZLIB_LIBRARY
ZLIB_INCLUDE_DIR
)
......@@ -5,23 +5,33 @@ macro(dbg_msg _MSG)
endmacro(dbg_msg)
macro(mingw_resource_compiler _NAME)
# Input file.
set(_IN "${CMAKE_CURRENT_SOURCE_DIR}/${_NAME}.rc")
dbg_msg("_IN: ${_IN}")
# Output file.
set(_OUT "${CMAKE_CURRENT_BINARY_DIR}/${_NAME}_rc.o")
dbg_msg("_OUT: ${_OUT}")
# Include directories.
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}")
# windres.exe arguments.
set(_ARGS ${_WINDRES_INCLUDE_DIRS} -i${_IN} -o${_OUT})
dbg_msg("_ARGS: ${_ARGS}")
# Compile resource file.
add_custom_command(OUTPUT ${_OUT}
COMMAND windres.exe
ARGS ${_ARGS}
VERBATIM)
# Set a NAME_RESOURCES variable
string(TOUPPER ${_NAME} _NAME_UPPER)
set(${_NAME_UPPER}_RESOURCES ${_OUT})
dbg_msg("${_NAME_UPPER}_RESOURCES: ${${_NAME_UPPER}_RESOURCES}")
endmacro(mingw_resource_compiler)
......@@ -59,7 +59,6 @@ set(CVPCB_EXTRA_SRCS
if(WIN32)
if(MINGW)
mingw_resource_compiler(cvpcb)
set(CVPCB_RESOURCES ${_OUT})
else(MINGW)
set(CVPCB_RESOURCES cvpcb.rc)
endif(MINGW)
......
......@@ -14,9 +14,9 @@ set(EESCHEMA_SRCS
bus-wire-junction.cpp
class_drawsheet.cpp
class_hierarchical_PIN_sheet.cpp
class_schematic_items.cpp
class_screen.cpp
class_text-label.cpp
class_schematic_items.cpp
cleanup.cpp
component_class.cpp
controle.cpp
......@@ -104,7 +104,6 @@ set(EESCHEMA_EXTRA_SRCS
if(WIN32)
if(MINGW)
mingw_resource_compiler(eeschema)
set(EESCHEMA_RESOURCES ${_OUT})
else(MINGW)
set(EESCHEMA_RESOURCES eeschema.rc)
endif(MINGW)
......
......@@ -61,7 +61,6 @@ set(GERBVIEW_EXTRA_SRCS
if(WIN32)
if(MINGW)
mingw_resource_compiler(gerbview)
set(GERBVIEW_RESOURCES ${_OUT})
else(MINGW)
set(GERBVIEW_RESOURCES gerbview.rc)
endif(MINGW)
......
......@@ -97,7 +97,7 @@ will be. It must be where you can access it from within the msys environment,
such as home/<user>. Edit your msys/1.0/etc/fstab file if needed to provide
access to this build directory from msys. Unzip the zlib123.zip file into this
build directory. Change directories into there, and then:
./configure (CHANGES NEEDED!!!)
./configure
make
make install
......
......@@ -16,7 +16,6 @@ set(KICAD_SRCS
if(WIN32)
if(MINGW)
mingw_resource_compiler(kicad)
set(KICAD_RESOURCES ${_OUT})
else(MINGW)
set(KICAD_RESOURCES kicad.rc)
endif(MINGW)
......
......@@ -8,10 +8,14 @@ else(ZLIB_FOUND)
# include files are in ${wxWidgets_ROOT_DIR}/src/zlib
# and the corresponding library is libwxzlib-<version>.a (like libwxzlib-2.8.a)
# and we try to use it
include_directories(${wxWidgets_ROOT_DIR}/src/zlib)
set(ZLIB_INCLUDE_DIR ${wxWidgets_ROOT_DIR}/src/zlib)
set(ZLIB_LIBRARIES ${wxWidgets_ROOT_DIR}/lib/libwxzlib-2.8.a)
endif(ZLIB_FOUND)
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${ZLIB_INCLUDE_DIR})
set(MINIZIP_SRCS
ioapi.c
minizip.c
......
......@@ -152,7 +152,6 @@ set(PCBNEW_EXTRA_SRCS
if(WIN32)
if(MINGW)
mingw_resource_compiler(pcbnew)
set(PCBNEW_RESOURCES ${_OUT})
else(MINGW)
set(PCBNEW_RESOURCES pcbnew.rc)
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