1.1 --- a/CMakeLists.txt Tue Jun 02 14:55:23 2009 +0100
1.2 +++ b/CMakeLists.txt Tue Jun 02 16:27:06 2009 +0100
1.3 @@ -1,13 +1,32 @@
1.4 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
1.5
1.6 +## Here comes the name of your project:
1.7 +
1.8 SET(PROJECT_NAME "LEMON-PROJECT-TEMPLATE")
1.9 +
1.10 +## Change 'hg-tip' to the current version number of your project if you wish.
1.11 +## Optionally, you can leave it as is as set PROJECT_VERSION from the cmake-gui
1.12 +## when you make a release.
1.13 +## The last parameter is a help string displayed by CMAKE.
1.14 +
1.15 SET(PROJECT_VERSION "hg-tip"
1.16 - CACHE STRING "LEMON PROJECT TEMPLATE version string.")
1.17 + CACHE STRING "LEMON PROJECT TEMPLATE version string.")
1.18
1.19 +## Do not edit this.
1.20 PROJECT(${PROJECT_NAME})
1.21
1.22 SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
1.23
1.24 +## The next part looks for LEMON. Typically, you don't want to modify it.
1.25 +##
1.26 +## First, it checks if there exists a 'lemon' subdirectory which should contain
1.27 +## the LEMON source tree. If it is there, then it will compile it locally and
1.28 +## use it as a subproject. If it isn't, then CMAKE will try to find an
1.29 +## installed version of LEMON. If it is installed to some non-standard place,
1.30 +## then you must tell its location to 'cmake-gui' in the LEMON_ROOT_DIR
1.31 +## config variable. (Do not hard code it into your config! Others may keep
1.32 +## LEMON at different places.)
1.33 +
1.34 IF(EXISTS ${CMAKE_SOURCE_DIR}/lemon)
1.35 ADD_SUBDIRECTORY(lemon)
1.36 SET(LEMON_INCLUDE_DIRS
1.37 @@ -20,39 +39,71 @@
1.38 FIND_PACKAGE(LEMON REQUIRED)
1.39 ENDIF()
1.40
1.41 +## This line finds doxygen (for document creation)
1.42 +
1.43 FIND_PACKAGE(Doxygen)
1.44
1.45 +## These are the include directories used by the compiler.
1.46 +
1.47 INCLUDE_DIRECTORIES(
1.48 ${PROJECT_SOURCE_DIR}
1.49 ${PROJECT_BINARY_DIR}
1.50 ${LEMON_INCLUDE_DIRS}
1.51 )
1.52
1.53 +## Here we define an executable target. Its name is 'lemon-project' and
1.54 +## is compiled from 'main.cc'. You can add more source files separated
1.55 +## with whitespaces (including newlines). If you want to build more
1.56 +## executables, simple repeat (and edit) the following ADD_EXECUTABLE and
1.57 +## TARGET_LINK_LIBRARIES statements.
1.58 +
1.59 ADD_EXECUTABLE(lemon-project main.cc)
1.60 TARGET_LINK_LIBRARIES(lemon-project ${LEMON_LIBRARIES})
1.61 +
1.62 +## This tells cmake to install 'lemon-project' to $PREFIX/bin when
1.63 +## 'make install' is executed. You can give more targets separated
1.64 +## by whitespaces.
1.65 +
1.66 INSTALL(
1.67 TARGETS lemon-project
1.68 RUNTIME DESTINATION bin
1.69 COMPONENT bin
1.70 )
1.71
1.72 -# IF(MSVC)
1.73 -# SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4250 /wd4355 /wd4503 /wd4800 /wd4996")
1.74 +## Sometimes MSVC overwhelms you with compiler warnings which are impossible to
1.75 +## avoid. Then comment out these sections. Normally you won't need it as the
1.76 +## LEMON include headers suppress these warnings anyway.
1.77 +
1.78 +#IF(MSVC)
1.79 +# SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}
1.80 +# /wd4250 /wd4355 /wd4503 /wd4800 /wd4996")
1.81 # # Suppressed warnings:
1.82 # # C4250: 'class1' : inherits 'class2::member' via dominance
1.83 # # C4355: 'this' : used in base member initializer list
1.84 # # C4503: 'function' : decorated name length exceeded, name was truncated
1.85 -# # C4800: 'type' : forcing value to bool 'true' or 'false' (performance warning)
1.86 +# # C4800: 'type' : forcing value to bool 'true' or 'false'
1.87 +# # (performance warning)
1.88 # # C4996: 'function': was declared deprecated
1.89 # ENDIF(MSVC)
1.90
1.91 ENABLE_TESTING()
1.92
1.93 +## This auxiliary doxygen files (.dox) should be placed in the 'doc'
1.94 +## subdirectory. The next line includes the CMAKE config of that directory.
1.95 +
1.96 ADD_SUBDIRECTORY(doc)
1.97
1.98 -######################################################################
1.99 -# CPACK configuration
1.100 -######################################################################
1.101 +#######################################################################
1.102 +## CPACK configuration
1.103 +##
1.104 +## It is used to configure the .exe installer created by CPACK.
1.105 +## Consider editing these values:
1.106 +## - CPACK_PACKAGE_VENDOR
1.107 +## - CPACK_PACKAGE_DESCRIPTION_SUMMARY
1.108 +## - CPACK_NSIS_HELP_LINK
1.109 +## - CPACK_NSIS_URL_INFO_ABOUT
1.110 +## - CPACK_NSIS_CONTACT
1.111 +#######################################################################
1.112
1.113 IF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR})
1.114 SET(CPACK_PACKAGE_NAME ${PROJECT_NAME})