2 # This file is part of LyX, the document processor.
3 # Licence details can be found in the file COPYING.
5 # Copyright (c) 2006-2010 Peter Kümmel, <syntheticpp@gmx.net>
6 # Copyright (c) 2008-2010 Kornel Benko, <Kornel.Benko@berlin.de>
9 cmake_minimum_required(VERSION 2.4)
11 if(COMMAND cmake_policy)
12 cmake_policy(SET CMP0003 OLD)
13 cmake_policy(SET CMP0005 OLD)
14 endif(COMMAND cmake_policy)
18 set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
20 # where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/
22 set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/modules")
23 set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
24 set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib)
27 option(lyxinstall "Build install projects/rules" ON)
32 # Supress regeneration
33 set(CMAKE_SUPPRESS_REGENERATION TRUE)
35 set(VERSION_INFO "CMake Build")
37 # Try to get some informations from configure.ac
39 include(LyXPaths) #called here to define the needed TOP_SRC_DIR-variable
40 file(STRINGS "${TOP_SRC_DIR}/configure.ac" _config_lines)
43 set(USE_WINDOWS_PACKAGING 1)
45 set(USE_MACOSX_PACKAGING 1)
47 set(USE_POSIX_PACKAGING 1)
50 macro(setstripped _varname _value)
51 string(STRIP ${_value} _v)
52 if(USE_POSIX_PACKAGING)
53 string(TOLOWER ${_v} ${_varname})
55 set(${_varname} ${_v})
59 foreach(_c_l ${_config_lines} )
60 if(_c_l MATCHES "^AC_INIT\\(\([^,]+\),\([^,]+\), *\\[\([^,]+\)\\] *,\(.*\)")
61 setstripped(PACKAGE_BASE ${CMAKE_MATCH_1})
62 setstripped(PACKAGE_VERSION ${CMAKE_MATCH_2})
63 setstripped(PACKAGE_BUGREPORT ${CMAKE_MATCH_3})
64 if(PACKAGE_VERSION MATCHES "^\([0-9]+\)\\.\([0-9]+\).*$")
65 set(LYX_MAJOR_VERSION ${CMAKE_MATCH_1})
66 set(LYX_MINOR_VERSION ${CMAKE_MATCH_2})
67 set(LYX_DIR_VER "LYX_DIR_${CMAKE_MATCH_1}${CMAKE_MATCH_2}x")
68 set(LYX_USERDIR_VER "LYX_USERDIR_${CMAKE_MATCH_1}${CMAKE_MATCH_2}x")
69 set(LYX_INSTALL_SUFFIX "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}")
72 if(_c_l MATCHES "^AC_SUBST\\( *LYX_DATE *, *\\[\\\"(.*)\\\"\\].*")
73 set(LYX_DATE "${CMAKE_MATCH_1}")
78 message(STATUS "-- Using versioned PACKAGE. Disable with -DUseVersionSuffix=0")
79 set(PACKAGE ${PACKAGE_BASE}${LYX_INSTALL_SUFFIX})
80 set(PROGRAM_SUFFIX "${LYX_INSTALL_SUFFIX}")
82 message(STATUS "-- PACKAGE not versioned, to enable use -DUseVersionSuffix=1")
83 set(PACKAGE ${PACKAGE_BASE})
84 set(PROGRAM_SUFFIX "")
87 if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
88 # see http://www.cmake.org/pipermail/cmake/2006-October/011559.html
90 # don't use the default "/usr/local"
91 # but respect the user-choice on the command-line
92 SET(CMAKE_INSTALL_PREFIX
93 "/usr/local/${project}${LYX_INSTALL_SUFFIX}" CACHE PATH "LyX install prefix" FORCE)
96 SET(CMAKE_INSTALL_PREFIX
97 ${CMAKE_INSTALL_PREFIX}/${LYX_INSTALL_SUFFIX} CACHE PATH "LyX install prefix" FORCE)
99 endif(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
102 set(DATA_SUBDIR "Resources/" CACHE STRING "Subdirectory for all lyx-system-data" FORCE)
104 set(DATA_SUBDIR "" CACHE STRING "Subdirectory for all lyx-system-data" FORCE)
107 set(LYX_ABS_INSTALLED_DATADIR "${CMAKE_INSTALL_PREFIX}")
108 set(LYX_LOCALEDIR "locale")
109 set(LYX_ABS_INSTALLED_LOCALEDIR "${LYX_ABS_INSTALLED_DATADIR}/${LYX_LOCALEDIR}")
110 set(LYX_ABS_TOP_SRCDIR "${TOP_SRC_DIR}")
114 #set(GROUP_CODE "The Golden Code")
119 set(LYX_CPP_FILES *.cpp)
120 set(LYX_HPP_FILES *.h)
121 set(LYX_MOC_FILES moc_*.cpp)
124 include(ProjectSourceGroup)
126 if(merge OR merge_rebuild)
127 set(merge 1 CACHE TYPE STRING FORCE)
128 set(MERGE_FILES 1 CACHE TYPE STRING FORCE)
130 message(STATUS "All *.cpp files of a project are merged into two files, disable with -Dmerge=0")
132 add_definitions(-DLYX_MERGED_BUILD)
134 set(merge 0 CACHE TYPE STRING FORCE)
135 set(MERGE_FILES 0 CACHE TYPE STRING FORCE)
136 message(STATUS "Enable merging files with -Dmerge=1")
140 set(CMAKE_BUILD_TYPE Release)
143 set(CMAKE_BUILD_TYPE Profile CACHE TYPE STRING FORCE)
144 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pg"
145 CACHE TYPE STRING FORCE)
150 set(CMAKE_BUILD_TYPE Release CACHE TYPE STRING FORCE)
151 set(release TRUE CACHE TYPE STRING FORCE)
156 set(CMAKE_BUILD_TYPE Debug CACHE TYPE STRING FORCE)
157 set(debug TRUE CACHE TYPE STRING FORCE)
162 set(library_type SHARED)
163 message(STATUS "building shared libraries")
165 set(library_type STATIC)
170 set(CMAKE_VERBOSE_MAKEFILE ON CACHE TYPE STRING FORCE)
171 message(STATUS "verbose Makefile, disable with -Dquiet=1")
174 set(CMAKE_VERBOSE_MAKEFILE OFF CACHE TYPE STRING FORCE)
176 set(LYX_CXX_FLAGS -Wall)
178 set(LYX_CXX_FLAGS "${LYX_CXX_FLAGS} -D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC")
181 set(LYX_CXX_FLAGS "${LYX_CXX_FLAGS} -D_GLIBCPP_CONCEPT_CHECKS")
183 set(CMAKE_CXX_FLAGS "${LYX_CXX_FLAGS} -fno-strict-aliasing " CACHE TYPE STRING FORCE)
184 set(CMAKE_CXX_FLAGS_DEBUG "${LYX_CXX_FLAGS} -fno-strict-aliasing -O -D_DEBUG" CACHE TYPE STRING FORCE)
186 set(CMAKE_CXX_FLAGS_RELEASE "${LYX_CXX_FLAGS} -O2 -DNDEBUG" CACHE TYPE STRING FORCE)
188 set(CMAKE_CXX_FLAGS_RELEASE "${LYX_CXX_FLAGS} -O3 -DNDEBUG" CACHE TYPE STRING FORCE)
190 set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE} -pg" CACHE TYPE STRING FORCE)
194 find_package(Qt4 REQUIRED)
195 add_definitions(-DQT_NO_STL -DQT_NO_KEYWORDS)
197 find_package(ZLIB REQUIRED)
200 set(aspell TRUE CACHE TYPE STRING)
201 find_package(ASPELL REQUIRED)
207 set(use_external_libintl TRUE)
209 if(use_external_libintl)
210 find_package(Libintl REQUIRED)
211 add_definitions(-DHAVE_GETTEXT)
215 find_library(HUNSPELL_LIBRARY "libhunspell")
217 #find_library(HUNSPELL_LIBRARY NAME "hunspell" PATH "/usr/local/lib" "/usr/lib" NO_DEFAULT_PATH)
218 find_library(HUNSPELL_LIBRARY NAMES "hunspell" "hunspell-1.2" PATHS "/usr/local/lib" "/usr/lib" "/usr/lib64")
220 if (HUNSPELL_LIBRARY)
221 find_file(HUNSPELL_FOUND "hunspell/hunspell.hxx")
225 add_definitions(-DUSE_HUNSPELL=1)
226 message(STATUS "----- Building with USE_HUNSPELL")
228 message(STATUS "----- Hunspell not found, building without hunspell support")
232 find_library(ENCHANT_LIBRARY "libenchant")
233 find_path(ENCHANT_INCLUDE_DIR "enchant++.h")
235 find_library(ENCHANT_LIBRARY "enchant" "/usr/local/lib" "/usr/lib" "/usr/local/lib" "/opt/local/lib")
236 find_path(ENCHANT_INCLUDE_DIR "enchant++.h" PATHS /usr/local/include /usr/local/include/enchant /usr/include /usr/include/enchant /opt/local/include/enchant)
238 if (ENCHANT_LIBRARY AND ENCHANT_INCLUDE_DIR)
239 set(ENCHANT_FOUND TRUE)
240 add_definitions(-DUSE_ENCHANT=1)
241 message(STATUS "----- Building with USE_ENCHANT")
243 message(STATUS "----- Enchant not found, building without enchant support")
248 set(nls TRUE CACHE TYPE STRING)
249 add_definitions(-DENABLE_NLS=1)
250 message(STATUS "----- Building with ENABLE_NLS")
252 message(STATUS "----- No nls, to enable use -Dnls=1")
256 add_definitions(-DUSE_ASPELL=1)
257 message(STATUS "----- Building with USE_ASPELL")
259 message(STATUS "----- No aspell, to get more information use -Daspell=1")
265 set(noconsole TRUE CACHE TYPE STRING)
266 set(WIN32_CONSOLE WIN32)
267 set(LYX_QTMAIN_LIBRARY ${QT_QTMAIN_LIBRARY})
268 message(STATUS "----- Console disabled")
270 message(STATUS "----- Console enabled, disable it with -Dnoconsole=1")
273 add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DNOMINMAX)
274 # disable checked iterators for msvc release builds to get maximum speed
275 set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /D_SECURE_SCL=0")
277 add_definitions(-DWINVER=0x0500)
282 foreach(_v PACKAGE PACKAGE_VERSION
283 PROGRAM_SUFFIX LYX_DATE LYX_DIR_VER LYX_USERDIR_VER
285 LYX_ABS_INSTALLED_DATADIR LYX_ABS_INSTALLED_LOCALEDIR LYX_INSTALL_SUFFIX)
286 if(NOT DEFINED ${_v})
287 message(FATAL_ERROR "${_v} not defined")
289 string(SUBSTRING "${_v} " 0 28 _v1)
290 message(STATUS "----- ${_v1}: ${${_v}}")
295 # PCHs not supported by cmake: http://www.cmake.org/Bug/view.php?id=1260
296 # Not sure if it works for all non-msvc compilers
297 include(PCHSupport_26)
299 option(disable-pch "Disable precompiled headers" ON)
301 option(disable-pch "Disable precompiled headers" ON)
306 message(STATUS "-----")
307 message(STATUS "----- using precompiled headers, disable with -Ddisable-pch=1")
308 message(STATUS "-----")
309 configure_file(${CMAKE_SOURCE_DIR}/pcheaders.h ${CMAKE_BINARY_DIR}/pcheaders.h)
310 configure_file(${CMAKE_SOURCE_DIR}/config.cpp.cmake ${CMAKE_BINARY_DIR}/config_pch.cpp)
311 add_definitions(-DLYX_ENABLE_PCH)
313 if(MSVC AND NOT MERGE_FILES)
314 macro(lyx_add_msvc_pch name_)
315 set_source_files_properties(${${name_}_sources} PROPERTIES
316 COMPILE_FLAGS "/Yuconfig.h /Fp\$(IntDir)/config.pch")
317 set_source_files_properties(${CMAKE_BINARY_DIR}/config_pch.cpp PROPERTIES
318 COMPILE_FLAGS "/Ycconfig.h /Fp\$(IntDir)/config.pch")
319 set(${name_}_sources ${${name_}_sources} ${CMAKE_BINARY_DIR}/config_pch.cpp
320 ${CMAKE_BINARY_DIR}/pcheaders.h)
321 set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /DLYX_PCH_STL /DLYX_PCH_BOOST /DLYX_PCH_QT4")
322 set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /DLYX_PCH_STL /DLYX_PCH_BOOST /DLYX_PCH_QT4")
323 set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} /DLYX_PCH_STL /DLYX_PCH_BOOST")
324 endmacro(lyx_add_msvc_pch)
325 macro(lyx_add_gcc_pch name_)
328 macro(lyx_add_msvc_pch name_)
330 macro(lyx_add_gcc_pch name_)
331 add_definitions(-DLYX_PCH_STL -DLYX_PCH_BOOST -DLYX_PCH_QT4)
332 ADD_PRECOMPILED_HEADER(${name_} ${CMAKE_BINARY_DIR}/config_pch.cpp ${CMAKE_BINARY_DIR}/config.h.gch)
337 message(STATUS "-----")
338 message(STATUS "----- precompiled headers disabled, enable with -Ddisable-pch=0")
339 message(STATUS "-----")
341 set(disable-pch TRUE CACHE TYPE STRING)
342 macro(lyx_add_msvc_pch)
343 endmacro(lyx_add_msvc_pch)
344 macro(lyx_add_gcc_pch name_)
350 set(vld 1 CACHE TYPE STRING FORCE)
351 set(LYX_LEAK_DETECTION 1 CACHE TYPE STRING FORCE)
353 message(STATUS "Leak detection enabled, disable with -Dvld=0")
355 set(LIBRARY_OUTPUT_PATH ${EXECUTABLE_OUTPUT_PATH})
356 set(vld_path ${CMAKE_CURRENT_SOURCE_DIR}/../Win32/vld)
357 include(${vld_path}/tools/cmake/vld.cmake)
359 set(vld 0 CACHE TYPE STRING FORCE)
360 set(LYX_LEAK_DETECTION 0 CACHE TYPE STRING FORCE)
362 message(STATUS "Enable leak detection with -Dvld=1")
367 set(WALL 1 CACHE TYPE STRING FORCE)
369 # Use the highest warning level
370 set(CMAKE_CXX_WARNING_LEVEL 4 CACHE TYPE STRING FORCE)
371 set(WARNING_LEVEL_MESSAGE "(switch to warning level 3 with -DWALL=0)")
373 if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
374 string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
376 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
379 if(CMAKE_C_FLAGS MATCHES "/W[0-4]")
380 string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
382 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4")
385 # add here warnings which should produce an error /weXXXX
386 set(MSVC_W_ERROR "/we4101 /we4189")
387 # add here warnings which should be disabled /wdXXXX
388 set(MSVC_W_DISABLE "/wd4288 /wd4355 /wd4800 /wd4996 /wd4311 /wd4312 /wd4505 /wd4267 /wd4512 /wd4245 /wd4127 /wd4180 /wd4231")
390 set(CMAKE_CXX_FLAGS_DEBUG
391 "${CMAKE_CXX_FLAGS_DEBUG} /Wp64 ${MSVC_W_ERROR} ${MSVC_W_DISABLE}")
392 set(CMAKE_CXX_FLAGS_RELEASE
393 "${CMAKE_CXX_FLAGS_RELEASE} /Wp64 ${MSVC_W_ERROR} ${MSVC_W_DISABLE}")
394 set(CMAKE_CXX_FLAGS_MINSIZEREL
395 "${CMAKE_CXX_FLAGS_MINSIZEREL} /Wp64 ${MSVC_W_ERROR} ${MSVC_W_DISABLE}")
398 set(WALL 0 CACHE TYPE STRING FORCE)
400 set(CMAKE_CXX_WARNING_LEVEL 3 CACHE TYPE STRING FORCE)
401 set(WARNING_LEVEL_MESSAGE "(switch to warning level 4 with -DWALL=1)")
403 # add here warnings which should produce an error /weXXXX
404 set(MSVC_W_ERROR "/we4101 /we4189")
405 # add here warnings which should be disabled /wdXXXX
406 set(MSVC_W_DISABLE "/wd4288 /wd4355 /wd4800 /wd4996 /wd4267 /wd4180 /wd4231")
408 set(CMAKE_CXX_FLAGS_DEBUG
409 "${CMAKE_CXX_FLAGS_DEBUG} ${MSVC_W_ERROR} ${MSVC_W_DISABLE}")
410 set(CMAKE_CXX_FLAGS_RELEASE
411 "${CMAKE_CXX_FLAGS_RELEASE} ${MSVC_W_ERROR} ${MSVC_W_DISABLE}")
412 set(CMAKE_CXX_FLAGS_MINSIZEREL
413 "${CMAKE_CXX_FLAGS_MINSIZEREL} ${MSVC_W_ERROR} ${MSVC_W_DISABLE}")
416 set(CMAKE_CXX_FLAGS_DEBUG
417 "${CMAKE_CXX_FLAGS_DEBUG} /Zc:wchar_t-")
418 set(CMAKE_CXX_FLAGS_RELEASE
419 "${CMAKE_CXX_FLAGS_RELEASE} /Zc:wchar_t-")
420 set(CMAKE_CXX_FLAGS_MINSIZEREL
421 "${CMAKE_CXX_FLAGS_MINSIZEREL} /Zc:wchar_t-")
423 message(STATUS "----- Warning level : ${CMAKE_CXX_WARNING_LEVEL} ${WARNING_LEVEL_MESSAGE}")
424 message(STATUS "----- Warnings as errors : ${MSVC_W_ERROR}")
425 message(STATUS "----- Warnings disabled : ${MSVC_W_DISABLE}")
431 FIND_PROGRAM(_PERL_EXECUTABLE perl)
432 if(NOT ${_PERL_EXECUTABLE} MATCHES "-NOTFOUND")
434 find_package(LyXGettext REQUIRED)
435 include_directories(${TOP_SRC_DIR}/po)
440 option(debug_glibc "Enable libstdc++ debug mode" OFF)
441 option(debug_glibc_pedantic "Enable libstdc++pedantic debug mode" OFF)
444 set(_GLIBCXX_DEBUG 1)
447 if(debug_glibc_pedantic)
448 set(_GLIBCXX_DEBUG_PEDANTIC 1)
451 # compiler tests, config.h generation
452 if(MSVC AND NOT CONFIGURECHECKS)
453 configure_file(configCompiler.h.msvc ${CMAKE_BINARY_DIR}/configCompiler.h)
455 include(ConfigureChecks.cmake)
456 configure_file(configCompiler.h.cmake ${CMAKE_BINARY_DIR}/configCompiler.h)
459 configure_file(config.h.cmake ${CMAKE_BINARY_DIR}/config.h)
461 find_package(ICONV REQUIRED)
462 add_definitions(-DHAVE_ICONV=1)
469 option(UseExternalBoost "Use external boost" OFF)
471 message(STATUS "Searching for boost")
472 find_package(Boost COMPONENTS signals regex)
474 message(STATUS "Boost found")
475 message(STATUS "Boost-libs = ${Boost_LIBRARIES}")
476 set(Lyx_Boost_Libraries ${Boost_LIBRARIES})
478 message(FATAL_ERROR "Boost not found" ${Boost_ERROR_REASON})
481 message(STATUS "----- Using internal boost. To build with installed version use -DUseExternalBoost:BOOL=ON")
482 set(Lyx_Boost_Libraries boost_signals boost_regex)
483 add_definitions(-DBOOST_USER_CONFIG="<config.h>")
484 include_directories(${TOP_SRC_DIR}/boost)
485 add_subdirectory(boost)
489 if(NOT use_external_libintl)
490 add_subdirectory(intl)
492 add_subdirectory(src)
495 add_subdirectory(man)
496 if(NOT ${_PERL_EXECUTABLE} MATCHES "-NOTFOUND")
497 add_subdirectory(doc)
500 add_subdirectory(lyx2lyx)
501 add_subdirectory(scripts)
507 SET(CPACK_PACKAGE_VERSION_MAJOR "${LYX_MAJOR_VERSION}")
508 SET(CPACK_PACKAGE_VERSION_MINOR "${LYX_MINOR_VERSION}")
509 FILE(STRINGS "${TOP_SRC_DIR}/development/cmake/LyX_summary.txt" CPACK_PACKAGE_DESCRIPTION_SUMMARY)
511 SET(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${LYX_INSTALL_SUFFIX}")
514 SET(CPACK_SET_DESTDIR "ON")
515 FILE(READ "${TOP_SRC_DIR}/development/cmake/LyX_license.txt" CPACK_RPM_PACKAGE_LICENSE)
516 SET(CPACK_RPM_PACKAGE_GROUP "Applications/Publishing")
517 SET(CPACK_RPM_PACKAGE_VENDOR "The LyX team")
519 # the next ones are needed by deb
520 SET(CPACK_PACKAGE_CONTACT "${PACKAGE_BUGREPORT}")
521 SET(CPACK_SOURCE_PACKAGE_FILE_NAME "${project}-${LYX_INSTALL_SUFFIX}")
523 # This is experimental, valid on _my_ system (Kornel)
524 SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libqtgui4 (>= 4.4.3-0)")
526 SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libaspell15 (>= 0.60.6-1),${CPACK_DEBIAN_PACKAGE_DEPENDS}")
529 # for the next ones, cpack insists on data with values in some file
530 SET(CPACK_PACKAGE_DESCRIPTION_FILE "${TOP_SRC_DIR}/development/cmake/LyX_description.txt")
531 SET(CPACK_RESOURCE_FILE_LICENSE "${TOP_SRC_DIR}/development/cmake/LyX_license.txt")
533 # Find the revision number and use it as the release in rpm-package-build.
534 # This way we may omit the otherwise needed "--force" parameter when
535 # installing from that rpm package.
536 FIND_PROGRAM(_svnversion svnversion)
537 message(STATUS "svnversion = ${_svnversion}")
538 if(NOT ${_svnversion} MATCHES "-NOTFOUND")
539 EXECUTE_PROCESS(COMMAND ${_svnversion} WORKING_DIRECTORY "${TOP_SRC_DIR}" OUTPUT_VARIABLE CPACK_RPM_PACKAGE_RELEASE OUTPUT_STRIP_TRAILING_WHITESPACE)
540 # We use this value also to set the package-patch-value
541 if(CPACK_RPM_PACKAGE_RELEASE MATCHES "^\([0-9]+\)")
542 set(CPACK_PACKAGE_VERSION_PATCH ${CMAKE_MATCH_1})
546 # we do not have a readme or welcome data,
547 # so we do not provide infofiles for
548 # CPACK_RESOURCE_FILE_README and CPACK_RESOURCE_FILE_WELCOME
554 #Now it is possible to create some packages
557 #############################################################################################
558 # So, e.g. for variables
559 # CMAKE_PROJECT_NAME : lyx
560 # CPACK_PACKAGE_VERSION_MAJOR : 2
561 # CPACK_PACKAGE_VERSION_MINOR : 0
562 # CPACK_PACKAGE_VERSION_PATCH : 1
563 # CMAKE_SYSTEM_NAME : Linux
564 # CPACK_BINARY_DEB:BOOL : ON
566 # the package name builds as "lyx-2.0.1-Linux.deb"
568 ############################## rpm ################################### deb ##################
569 # create # cpack -G RPM --config CPackConfig.cmake # cpack -G DEB --config CPackConfig.cmake
570 # creates =># lyx-2.0.1-Linux.rpm # lyx-2.0.1-Linux.deb
571 # list # rpm -qlp lyx-2.0.1-Linux.rpm # dpkg-deb -c lyx-2.0.1-Linux.deb
572 # install # rpm -U lyx-2.0.1-Linux.rpm # dpkg -i lyx-2.0.1-Linux.deb