Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt	(revision 680)
+++ CMakeLists.txt	(revision 681)
@@ -23,6 +23,6 @@
 SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
 
-INCLUDE(FindDoxygen)
-INCLUDE(FindGhostscript)
+FIND_PACKAGE(Doxygen)
+FIND_PACKAGE(Ghostscript)
 FIND_PACKAGE(GLPK 4.33)
 FIND_PACKAGE(CPLEX)
@@ -41,5 +41,5 @@
   ADD_SUBDIRECTORY(doc)
   ADD_SUBDIRECTORY(test)
-ENDIF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR})
+ENDIF()
 
 CONFIGURE_FILE(
@@ -58,72 +58,70 @@
     DESTINATION cmake
   )
-ENDIF(UNIX)
+ENDIF()
 
-IF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR})
-  IF(WIN32)
-    SET(CPACK_PACKAGE_NAME ${PROJECT_NAME})
-    SET(CPACK_PACKAGE_VENDOR "EGRES")
-    SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY
-      "LEMON - Library for Efficient Modeling and Optimization in Networks")
-    SET(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")
+IF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR} AND WIN32)
+  SET(CPACK_PACKAGE_NAME ${PROJECT_NAME})
+  SET(CPACK_PACKAGE_VENDOR "EGRES")
+  SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY
+    "LEMON - Library for Efficient Modeling and Optimization in Networks")
+  SET(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")
 
-    SET(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
+  SET(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
 
-    SET(CPACK_PACKAGE_INSTALL_DIRECTORY
-      "${PROJECT_NAME} ${PROJECT_VERSION}")
-    SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY
-      "${PROJECT_NAME} ${PROJECT_VERSION}")
+  SET(CPACK_PACKAGE_INSTALL_DIRECTORY
+    "${PROJECT_NAME} ${PROJECT_VERSION}")
+  SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY
+    "${PROJECT_NAME} ${PROJECT_VERSION}")
 
-    SET(CPACK_COMPONENTS_ALL headers library html_documentation bin)
+  SET(CPACK_COMPONENTS_ALL headers library html_documentation bin)
 
-    SET(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "C++ headers")
-    SET(CPACK_COMPONENT_LIBRARY_DISPLAY_NAME "Dynamic-link library")
-    SET(CPACK_COMPONENT_BIN_DISPLAY_NAME "Command line utilities")
-    SET(CPACK_COMPONENT_HTML_DOCUMENTATION_DISPLAY_NAME "HTML documentation")
+  SET(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "C++ headers")
+  SET(CPACK_COMPONENT_LIBRARY_DISPLAY_NAME "Dynamic-link library")
+  SET(CPACK_COMPONENT_BIN_DISPLAY_NAME "Command line utilities")
+  SET(CPACK_COMPONENT_HTML_DOCUMENTATION_DISPLAY_NAME "HTML documentation")
 
-    SET(CPACK_COMPONENT_HEADERS_DESCRIPTION
-      "C++ header files")
-    SET(CPACK_COMPONENT_LIBRARY_DESCRIPTION
-      "DLL and import library")
-    SET(CPACK_COMPONENT_BIN_DESCRIPTION
-      "Command line utilities")
-    SET(CPACK_COMPONENT_HTML_DOCUMENTATION_DESCRIPTION
-      "Doxygen generated documentation")
+  SET(CPACK_COMPONENT_HEADERS_DESCRIPTION
+    "C++ header files")
+  SET(CPACK_COMPONENT_LIBRARY_DESCRIPTION
+    "DLL and import library")
+  SET(CPACK_COMPONENT_BIN_DESCRIPTION
+    "Command line utilities")
+  SET(CPACK_COMPONENT_HTML_DOCUMENTATION_DESCRIPTION
+    "Doxygen generated documentation")
 
-    SET(CPACK_COMPONENT_HEADERS_DEPENDS library)
+  SET(CPACK_COMPONENT_HEADERS_DEPENDS library)
 
-    SET(CPACK_COMPONENT_HEADERS_GROUP "Development")
-    SET(CPACK_COMPONENT_LIBRARY_GROUP "Development")
-    SET(CPACK_COMPONENT_HTML_DOCUMENTATION_GROUP "Documentation")
+  SET(CPACK_COMPONENT_HEADERS_GROUP "Development")
+  SET(CPACK_COMPONENT_LIBRARY_GROUP "Development")
+  SET(CPACK_COMPONENT_HTML_DOCUMENTATION_GROUP "Documentation")
 
-    SET(CPACK_COMPONENT_GROUP_DEVELOPMENT_DESCRIPTION
-      "Components needed to develop software using LEMON")
-    SET(CPACK_COMPONENT_GROUP_DOCUMENTATION_DESCRIPTION
-      "Documentation of LEMON")
+  SET(CPACK_COMPONENT_GROUP_DEVELOPMENT_DESCRIPTION
+    "Components needed to develop software using LEMON")
+  SET(CPACK_COMPONENT_GROUP_DOCUMENTATION_DESCRIPTION
+    "Documentation of LEMON")
 
-    SET(CPACK_ALL_INSTALL_TYPES Full Developer)
+  SET(CPACK_ALL_INSTALL_TYPES Full Developer)
 
-    SET(CPACK_COMPONENT_HEADERS_INSTALL_TYPES Developer Full)
-    SET(CPACK_COMPONENT_LIBRARY_INSTALL_TYPES Developer Full)
-    SET(CPACK_COMPONENT_HTML_DOCUMENTATION_INSTALL_TYPES Full)
+  SET(CPACK_COMPONENT_HEADERS_INSTALL_TYPES Developer Full)
+  SET(CPACK_COMPONENT_LIBRARY_INSTALL_TYPES Developer Full)
+  SET(CPACK_COMPONENT_HTML_DOCUMENTATION_INSTALL_TYPES Full)
 
-    SET(CPACK_GENERATOR "NSIS")
-    SET(CPACK_NSIS_MUI_ICON "${PROJECT_SOURCE_DIR}/cmake/nsis/lemon.ico")
-    SET(CPACK_NSIS_MUI_UNIICON "${PROJECT_SOURCE_DIR}/cmake/nsis/uninstall.ico")
-    #SET(CPACK_PACKAGE_ICON "${PROJECT_SOURCE_DIR}/cmake/nsis\\\\installer.bmp")
-    SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\lemon.ico")
-    SET(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} ${PROJECT_NAME}")
-    SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\lemon.cs.elte.hu")
-    SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\lemon.cs.elte.hu")
-    SET(CPACK_NSIS_CONTACT "lemon-user@lemon.cs.elte.hu")
-    SET(CPACK_NSIS_CREATE_ICONS_EXTRA "
-      CreateShortCut \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Documentation.lnk\\\" \\\"$INSTDIR\\\\share\\\\doc\\\\index.html\\\"
-      ")
-    SET(CPACK_NSIS_DELETE_ICONS_EXTRA "
-      !insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP
-      Delete \\\"$SMPROGRAMS\\\\$MUI_TEMP\\\\Documentation.lnk\\\"
-      ")
+  SET(CPACK_GENERATOR "NSIS")
+  SET(CPACK_NSIS_MUI_ICON "${PROJECT_SOURCE_DIR}/cmake/nsis/lemon.ico")
+  SET(CPACK_NSIS_MUI_UNIICON "${PROJECT_SOURCE_DIR}/cmake/nsis/uninstall.ico")
+  #SET(CPACK_PACKAGE_ICON "${PROJECT_SOURCE_DIR}/cmake/nsis\\\\installer.bmp")
+  SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\lemon.ico")
+  SET(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} ${PROJECT_NAME}")
+  SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\lemon.cs.elte.hu")
+  SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\lemon.cs.elte.hu")
+  SET(CPACK_NSIS_CONTACT "lemon-user@lemon.cs.elte.hu")
+  SET(CPACK_NSIS_CREATE_ICONS_EXTRA "
+    CreateShortCut \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Documentation.lnk\\\" \\\"$INSTDIR\\\\share\\\\doc\\\\index.html\\\"
+    ")
+  SET(CPACK_NSIS_DELETE_ICONS_EXTRA "
+    !insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP
+    Delete \\\"$SMPROGRAMS\\\\$MUI_TEMP\\\\Documentation.lnk\\\"
+    ")
 
-    INCLUDE(CPack)
-  ENDIF(WIN32)
-ENDIF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR})
+  INCLUDE(CPack)
+ENDIF()
Index: demo/CMakeLists.txt
===================================================================
--- demo/CMakeLists.txt	(revision 622)
+++ demo/CMakeLists.txt	(revision 681)
@@ -4,13 +4,16 @@
 )
 
-LINK_DIRECTORIES(${PROJECT_BINARY_DIR}/lemon)
+LINK_DIRECTORIES(
+  ${PROJECT_BINARY_DIR}/lemon
+)
 
 SET(DEMOS
   arg_parser_demo
   graph_to_eps_demo
-  lgf_demo)
+  lgf_demo
+)
 
 FOREACH(DEMO_NAME ${DEMOS})
   ADD_EXECUTABLE(${DEMO_NAME} ${DEMO_NAME}.cc)
   TARGET_LINK_LIBRARIES(${DEMO_NAME} lemon)
-ENDFOREACH(DEMO_NAME)
+ENDFOREACH()
Index: doc/CMakeLists.txt
===================================================================
--- doc/CMakeLists.txt	(revision 678)
+++ doc/CMakeLists.txt	(revision 681)
@@ -47,5 +47,5 @@
       COMPONENT html_documentation
     )
-  ENDIF(UNIX)
+  ENDIF()
 
-ENDIF(DOXYGEN_EXECUTABLE AND GHOSTSCRIPT_EXECUTABLE)
+ENDIF()
Index: lemon/CMakeLists.txt
===================================================================
--- lemon/CMakeLists.txt	(revision 677)
+++ lemon/CMakeLists.txt	(revision 681)
@@ -26,26 +26,26 @@
     INSTALL(FILES ${GLPK_BIN_DIR}/libltdl3.dll DESTINATION bin)
     INSTALL(FILES ${GLPK_BIN_DIR}/zlib1.dll DESTINATION bin)
-  ENDIF(WIN32)
-ENDIF(LEMON_HAVE_GLPK)
+  ENDIF()
+ENDIF()
 
 IF(LEMON_HAVE_CPLEX)
   SET(LEMON_SOURCES ${LEMON_SOURCES} cplex.cc)
   INCLUDE_DIRECTORIES(${CPLEX_INCLUDE_DIRS})
-ENDIF(LEMON_HAVE_CPLEX)
+ENDIF()
 
 IF(LEMON_HAVE_CLP)
   SET(LEMON_SOURCES ${LEMON_SOURCES} clp.cc)
   INCLUDE_DIRECTORIES(${COIN_INCLUDE_DIRS})
-ENDIF(LEMON_HAVE_CLP)
+ENDIF()
 
 IF(LEMON_HAVE_CBC)
   SET(LEMON_SOURCES ${LEMON_SOURCES} cbc.cc)
   INCLUDE_DIRECTORIES(${COIN_INCLUDE_DIRS})
-ENDIF(LEMON_HAVE_CBC)
+ENDIF()
 
 ADD_LIBRARY(lemon ${LEMON_SOURCES})
 IF(UNIX)
   SET_TARGET_PROPERTIES(lemon PROPERTIES OUTPUT_NAME emon)
-ENDIF(UNIX)
+ENDIF()
 
 INSTALL(
Index: test/CMakeLists.txt
===================================================================
--- test/CMakeLists.txt	(revision 647)
+++ test/CMakeLists.txt	(revision 681)
@@ -4,5 +4,7 @@
 )
 
-LINK_DIRECTORIES(${PROJECT_BINARY_DIR}/lemon)
+LINK_DIRECTORIES(
+  ${PROJECT_BINARY_DIR}/lemon
+)
 
 SET(TESTS
@@ -36,18 +38,21 @@
   suurballe_test
   time_measure_test
-  unionfind_test)
+  unionfind_test
+)
 
 IF(LEMON_HAVE_LP)
   ADD_EXECUTABLE(lp_test lp_test.cc)
   SET(LP_TEST_LIBS lemon)
+
   IF(LEMON_HAVE_GLPK)
     SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${GLPK_LIBRARIES})
-  ENDIF(LEMON_HAVE_GLPK)
+  ENDIF()
   IF(LEMON_HAVE_CPLEX)
     SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${CPLEX_LIBRARIES})
-  ENDIF(LEMON_HAVE_CPLEX)
+  ENDIF()
   IF(LEMON_HAVE_CLP)
     SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${COIN_CLP_LIBRARIES})
-  ENDIF(LEMON_HAVE_CLP)
+  ENDIF()
+
   TARGET_LINK_LIBRARIES(lp_test ${LP_TEST_LIBS})
   ADD_TEST(lp_test lp_test)
@@ -57,30 +62,33 @@
     GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
     ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
-      COMMAND cmake -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
-      COMMAND cmake -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
-      COMMAND cmake -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
+      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
+      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
+      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
     )
-  ENDIF(WIN32 AND LEMON_HAVE_GLPK)
+  ENDIF()
+
   IF(WIN32 AND LEMON_HAVE_CPLEX)
     GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
     GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
     ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
-      COMMAND cmake -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
+      COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
     )
-  ENDIF(WIN32 AND LEMON_HAVE_CPLEX)
-ENDIF(LEMON_HAVE_LP)
+  ENDIF()
+ENDIF()
 
 IF(LEMON_HAVE_MIP)
   ADD_EXECUTABLE(mip_test mip_test.cc)
   SET(MIP_TEST_LIBS lemon)
+
   IF(LEMON_HAVE_GLPK)
     SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${GLPK_LIBRARIES})
-  ENDIF(LEMON_HAVE_GLPK)
+  ENDIF()
   IF(LEMON_HAVE_CPLEX)
     SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${CPLEX_LIBRARIES})
-  ENDIF(LEMON_HAVE_CPLEX)
+  ENDIF()
   IF(LEMON_HAVE_CBC)
     SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${COIN_CBC_LIBRARIES})
-  ENDIF(LEMON_HAVE_CBC)
+  ENDIF()
+
   TARGET_LINK_LIBRARIES(mip_test ${MIP_TEST_LIBS})
   ADD_TEST(mip_test mip_test)
@@ -90,17 +98,18 @@
     GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
     ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
-      COMMAND cmake -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
-      COMMAND cmake -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
-      COMMAND cmake -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
+      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
+      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
+      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
     )
-  ENDIF(WIN32 AND LEMON_HAVE_GLPK)
+  ENDIF()
+
   IF(WIN32 AND LEMON_HAVE_CPLEX)
     GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
     GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
     ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
-      COMMAND cmake -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
+      COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
     )
-  ENDIF(WIN32 AND LEMON_HAVE_CPLEX)
-ENDIF(LEMON_HAVE_MIP)
+  ENDIF()
+ENDIF()
 
 FOREACH(TEST_NAME ${TESTS})
@@ -108,3 +117,3 @@
   TARGET_LINK_LIBRARIES(${TEST_NAME} lemon)
   ADD_TEST(${TEST_NAME} ${TEST_NAME})
-ENDFOREACH(TEST_NAME)
+ENDFOREACH()
Index: tools/CMakeLists.txt
===================================================================
--- tools/CMakeLists.txt	(revision 538)
+++ tools/CMakeLists.txt	(revision 681)
@@ -4,5 +4,7 @@
 )
 
-LINK_DIRECTORIES(${PROJECT_BINARY_DIR}/lemon)
+LINK_DIRECTORIES(
+  ${PROJECT_BINARY_DIR}/lemon
+)
 
 ADD_EXECUTABLE(lgf-gen lgf-gen.cc)
@@ -25,4 +27,5 @@
     PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/lemon-0.x-to-1.x.sh
     DESTINATION bin
-    COMPONENT bin)
-ENDIF(NOT WIN32)
+    COMPONENT bin
+  )
+ENDIF()
