From efe7edf2f16a4bff60d15f8baf33b866f26619cd Mon Sep 17 00:00:00 2001 From: f3nix Date: Fri, 9 Nov 2007 21:45:26 +0000 Subject: [PATCH] CMake: - Fix minizip build. - Fix eeschema/plugins build. - Update TODO. --- CMake.TODO | 6 +++--- CMakeLists.txt | 4 ++-- eeschema/CMakeLists.txt | 2 +- eeschema/plugins/CMakeLists.txt | 11 +++++------ kicad/CMakeLists.txt | 2 +- kicad/minizip/CMakeLists.txt | 23 +++++++++++++++-------- 6 files changed, 27 insertions(+), 21 deletions(-) diff --git a/CMake.TODO b/CMake.TODO index af06aad845..9a407cda00 100644 --- a/CMake.TODO +++ b/CMake.TODO @@ -1,8 +1,8 @@ TODO: -* Fix kicad/minizip. -* Fix eeschema/plugins. * Add install targets for binaries, docs, translations, libraries (Windows, Mac). Linux version has a preliminary support. -* Add DEBUG target. +* Add DEBUG. +* Add PYTHON. +* Add shared/static. * Testing under Windows and Mac. * More testing ... diff --git a/CMakeLists.txt b/CMakeLists.txt index 9942b0fe86..5b08d78eeb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,7 +15,7 @@ SET(wxWidgets_USE_LIBS base core adv gl html net) # We need the Find package for wxWidgets to work. FIND_PACKAGE(wxWidgets REQUIRED) -#Locations for install targets +# Locations for install targets IF(UNIX) #SET(CMAKE_INSTALL_PATH /usr/local) SET(KICAD_BIN bin CACHE PATH "Location of KiCad binaries.") @@ -31,7 +31,7 @@ ENDIF(UNIX) IF(WIN32) ENDIF(WIN32) -#Should this go to IF(UNIX)? +# Should this go to IF(UNIX)? IF(APPLE) ENDIF(APPLE) diff --git a/eeschema/CMakeLists.txt b/eeschema/CMakeLists.txt index 132b598112..4d7aa0e9db 100644 --- a/eeschema/CMakeLists.txt +++ b/eeschema/CMakeLists.txt @@ -122,4 +122,4 @@ TARGET_LINK_LIBRARIES(eeschema common ${wxWidgets_LIBRARIES}) INSTALL(TARGETS eeschema RUNTIME DESTINATION ${KICAD_BIN}) -#ADD_SUBDIRECTORY(plugins) +ADD_SUBDIRECTORY(plugins) diff --git a/eeschema/plugins/CMakeLists.txt b/eeschema/plugins/CMakeLists.txt index 488fce03c9..323902e902 100644 --- a/eeschema/plugins/CMakeLists.txt +++ b/eeschema/plugins/CMakeLists.txt @@ -1,8 +1,7 @@ -INCLUDE(CheckFunctionExists) -CHECK_FUNCTION_EXISTS(stricmp HAVE_STRICMP) +IF(UNIX) + ADD_DEFINITIONS(-D__UNIX__) +ENDIF(UNIX) -IF(HAVE_STRICMP) - ADD_EXECUTABLE(netlist_form_pads-pcb netlist_form_pads-pcb.cpp) +ADD_EXECUTABLE(netlist_form_pads-pcb netlist_form_pads-pcb.cpp) - INSTALL(TARGETS netlist_form_pads-pcb RUNTIME DESTINATION ${KICAD_PLUGINS}) -ENDIF(HAVE_STRICMP) +INSTALL(TARGETS netlist_form_pads-pcb RUNTIME DESTINATION ${KICAD_PLUGINS}) diff --git a/kicad/CMakeLists.txt b/kicad/CMakeLists.txt index fc868e9049..beb66f8336 100644 --- a/kicad/CMakeLists.txt +++ b/kicad/CMakeLists.txt @@ -29,4 +29,4 @@ TARGET_LINK_LIBRARIES(kicad common ${wxWidgets_LIBRARIES}) INSTALL(TARGETS kicad RUNTIME DESTINATION ${KICAD_BIN}) -#ADD_SUBDIRECTORY(minizip) +ADD_SUBDIRECTORY(minizip) diff --git a/kicad/minizip/CMakeLists.txt b/kicad/minizip/CMakeLists.txt index db3212fce8..394b748cdf 100644 --- a/kicad/minizip/CMakeLists.txt +++ b/kicad/minizip/CMakeLists.txt @@ -1,11 +1,18 @@ -# TODO: -# * Add include for wxzlib +FIND_PACKAGE(ZLIB) +MESSAGE("-- Check for installed ZLIB:") -SET(MINIZIP_SRCS - ioapi.c - minizip.c - zip.c) +IF(ZLIB_FOUND) + MESSAGE(" ZLIB found") + SET(MINIZIP_SRCS + ioapi.c + minizip.c + zip.c) -ADD_EXECUTABLE(minizip ${MINIZIP_SRCS}) + ADD_EXECUTABLE(minizip ${MINIZIP_SRCS} ) -INSTALL(TARGETS minizip RUNTIME DESTINATION bin) + TARGET_LINK_LIBRARIES(minizip ${ZLIB_LIBRARIES}) + + INSTALL(TARGETS minizip RUNTIME DESTINATION bin) +ELSE(ZLIB_FOUND) + MESSAGE(" ZLIB not found") +ENDIF(ZLIB_FOUND)