]> git.lyx.org Git - lyx.git/blobdiff - development/cmake/CMakeLists.txt
autogeneration of tex2lyx.1 now from tex2lyx.1in
[lyx.git] / development / cmake / CMakeLists.txt
index 71d930641dec52e5c9e1de36cd6f67a79f2ad663..fb72be7426b36db5afd1d9bce0f309e2f53b7149 100644 (file)
@@ -66,11 +66,11 @@ foreach(_c_l ${_config_lines} )
 endforeach(_c_l)
 
 if(UseVersionSuffix)
-  message("-- Using versioned PACKAGE. Disable with -DUseVersionSuffix=0")
+  message(STATUS "-- Using versioned PACKAGE. Disable with -DUseVersionSuffix=0")
   set(PACKAGE ${PACKAGE_BASE}${LYX_INSTALL_SUFFIX})
   set(PROGRAM_SUFFIX "${LYX_INSTALL_SUFFIX}")
 else()
-  message("-- PACKAGE not versioned, to enable use -DUseVersionSuffix=1")
+  message(STATUS "-- PACKAGE not versioned, to enable use -DUseVersionSuffix=1")
   set(PACKAGE ${PACKAGE_BASE})
   set(PROGRAM_SUFFIX "")
 endif()
@@ -81,7 +81,7 @@ if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
     # don't use the default "/usr/local"
     # but respect the user-choice on the command-line
     SET(CMAKE_INSTALL_PREFIX
-      "/usr/local/share/lyx${LYX_INSTALL_SUFFIX}" CACHE PATH "LyX install prefix" FORCE)
+      "/usr/local/lyx${LYX_INSTALL_SUFFIX}" CACHE PATH "LyX install prefix" FORCE)
   endif()
   if(WIN32)
     SET(CMAKE_INSTALL_PREFIX
@@ -194,20 +194,20 @@ if(use_external_libintl)
        add_definitions(-DHAVE_GETTEXT)
 endif()
 
-message("")
+message(STATUS "")
 if(nls OR all)
        set(nls TRUE CACHE TYPE STRING)
        add_definitions(-DENABLE_NLS=1)
-       message("----- Building with ENABLE_NLS")
+       message(STATUS "----- Building with ENABLE_NLS")
 else() 
-       message("----- No nls, to enable use -Dnls=1")
+       message(STATUS "----- No nls, to enable use -Dnls=1")
 endif()
 set(nls)
 if(ASPELL_FOUND)
        add_definitions(-DUSE_ASPELL=1)
-       message("----- Building with USE_ASPELL")
+       message(STATUS "----- Building with USE_ASPELL")
 else() 
-       message("----- No aspell, to get more information use -Daspell=1")
+       message(STATUS "----- No aspell, to get more information use -Daspell=1")
 endif()
 set(all)
 
@@ -216,9 +216,9 @@ if(WIN32)
                set(noconsole TRUE CACHE TYPE STRING)
                set(WIN32_CONSOLE WIN32)
                set(LYX_QTMAIN_LIBRARY ${QT_QTMAIN_LIBRARY})
-               message("----- Console disabled")
+               message(STATUS "----- Console disabled")
        else()
-               message("----- Console enabled, disable it with -Dnoconsole=1")
+               message(STATUS "----- Console enabled, disable it with -Dnoconsole=1")
        endif()
        if(MSVC)
                add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DNOMINMAX)      
@@ -229,7 +229,7 @@ if(WIN32)
        endif()
 endif()
 
-message("")
+message(STATUS "")
 foreach(_v PACKAGE PACKAGE_VERSION
     PROGRAM_SUFFIX LYX_DATE LYX_DIR_VER LYX_USERDIR_VER
     LYX_ABS_TOP_SRCDIR
@@ -238,17 +238,17 @@ foreach(_v PACKAGE PACKAGE_VERSION
     message(FATAL_ERROR "${_v} not defined")
   endif()
   string(SUBSTRING "${_v}                            " 0 28 _v1)
-  message("----- ${_v1}: ${${_v}}")
+  message(STATUS "----- ${_v1}: ${${_v}}")
 endforeach(_v)
-message("")
+message(STATUS "")
 
 
 add_definitions(-DBOOST_USER_CONFIG="<config.h>")
        
 if(MSVC AND NOT disable-pch AND NOT MERGE_FILES)
-       message("-----")
-       message("----- using precompiled headers, disable with -Ddisable-pch=1")
-       message("-----")
+       message(STATUS "-----")
+       message(STATUS "----- using precompiled headers, disable with -Ddisable-pch=1")
+       message(STATUS "-----")
        configure_file(${CMAKE_SOURCE_DIR}/pcheaders.h
                ${CMAKE_BINARY_DIR}/pcheaders.h)
        configure_file(${CMAKE_SOURCE_DIR}/config.cpp.cmake
@@ -270,9 +270,9 @@ if(MSVC AND NOT disable-pch AND NOT MERGE_FILES)
                "${CMAKE_CXX_FLAGS_MINSIZEREL} /DLYX_PCH_STL /DLYX_PCH_BOOST")
 else()
        if(MSVC)
-               message("-----")
-               message("----- precompiled headers disabled, enable with -Ddisable-pch=0")
-               message("-----")
+               message(STATUS "-----")
+               message(STATUS "----- precompiled headers disabled, enable with -Ddisable-pch=0")
+               message(STATUS "-----")
        endif()
        set(disable-pch TRUE CACHE TYPE STRING)
        macro(lyx_add_msvc_pch)
@@ -323,7 +323,7 @@ if(MSVC)
                
                set(CMAKE_CXX_FLAGS_DEBUG
                        "${CMAKE_CXX_FLAGS_DEBUG} /Wp64 ${MSVC_W_ERROR} ${MSVC_W_DISABLE}")
-               set(CMAKE_CXX_FLAGS_RELEASEs
+               set(CMAKE_CXX_FLAGS_RELEASE
                        "${CMAKE_CXX_FLAGS_RELEASE} /Wp64 ${MSVC_W_ERROR} ${MSVC_W_DISABLE}")
                set(CMAKE_CXX_FLAGS_MINSIZEREL
                        "${CMAKE_CXX_FLAGS_MINSIZEREL} /Wp64 ${MSVC_W_ERROR} ${MSVC_W_DISABLE}")
@@ -348,10 +348,10 @@ if(MSVC)
                
        endif()
        
-       message("----- Warning level      : ${CMAKE_CXX_WARNING_LEVEL}  ${WARNING_LEVEL_MESSAGE}")
-       message("----- Warnings as errors : ${MSVC_W_ERROR}")
-       message("----- Warnings disabled  : ${MSVC_W_DISABLE}")
-       message("")
+       message(STATUS "----- Warning level      : ${CMAKE_CXX_WARNING_LEVEL}  ${WARNING_LEVEL_MESSAGE}")
+       message(STATUS "----- Warnings as errors : ${MSVC_W_ERROR}")
+       message(STATUS "----- Warnings disabled  : ${MSVC_W_DISABLE}")
+       message(STATUS "")
        
 endif()
 
@@ -402,7 +402,7 @@ SET(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${LYX_INSTALL_SUFFIX}")
 #
 # needed by rpm
 SET(CPACK_SET_DESTDIR "ON")
-SET(CPACK_RPM_PACKAGE_LICENSE "GPL")
+FILE(READ "${TOP_SRC_DIR}/development/cmake/LyX_license.txt" CPACK_RPM_PACKAGE_LICENSE)
 SET(CPACK_RPM_PACKAGE_GROUP "Applications/Publishing")
 SET(CPACK_RPM_PACKAGE_VENDOR "The LyX team")
 #
@@ -413,6 +413,13 @@ SET(CPACK_SOURCE_PACKAGE_FILE_NAME "lyx-${LYX_INSTALL_SUFFIX}")
 # for the next ones, cmake insists on data  with values in some file
 SET(CPACK_PACKAGE_DESCRIPTION_FILE "${TOP_SRC_DIR}/development/cmake/LyX_description.txt")
 SET(CPACK_RESOURCE_FILE_LICENSE "${TOP_SRC_DIR}/development/cmake/LyX_license.txt")
+
+# Find the revision number and use it as the release in rpm-package-build.
+# This way we may omit the otherwise needed "--force" parameter when
+# installing from that rpm package.
+FIND_PROGRAM(_svnversion svnversion)
+EXECUTE_PROCESS(COMMAND ${_svnversion} WORKING_DIRECTORY "${TOP_SRC_DIR}" OUTPUT_VARIABLE CPACK_RPM_PACKAGE_RELEASE OUTPUT_STRIP_TRAILING_WHITESPACE)
+
 # we do not have a readme or welcome data,
 # so we do not provide infofiles for
 # CPACK_RESOURCE_FILE_README and CPACK_RESOURCE_FILE_WELCOME
@@ -427,4 +434,3 @@ include(CPack)
 # list      # rpm -qlp lyx-2.0.1-Linux.rpm              # dpkg-deb -c lyx-2.0.1-Linux.deb
 # install   # rpm -U lyx-2.0.1-Linux.rpm                # dpkg -i lyx-2.0.1-Linux.deb
 #
-