development/cmake/CMakeLists.txt
		Use lowercase for PACKAGE iff (USE_POSIX_PACKAGING)
		Set correct PROGRAM_SUFFIX,
			CMakeLists.txt in subdirectories depend now on it
		Define PACKAGE_BASE depending on  PACKAGING type
			for use in subsequent directories
	development/cmake/config.h.cmake
		typo: PPROGRAM_SUFFIX --> PROGRAM_SUFFIX
	development/cmake/src/tex2lyx/CMakeLists.txt +
	+ development/cmake/src/CMakeLists.txt +
	+ development/cmake/src/client/CMakeLists.txt +
	+ development/cmake/man/CMakeLists.txt
		added desired version-info to executables and manuals
			tex2lyx, lyx, lyxclient respectivelly

	Kornel



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28438 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Peter Kümmel 2009-02-10 22:21:39 +00:00
parent e029b216b7
commit fb3d47a14d
6 changed files with 44 additions and 36 deletions

View File

@ -30,14 +30,26 @@ set(VERSION_INFO "CMake Build")
include(LyXPaths) #called here to define the needed TOP_SRC_DIR-variable include(LyXPaths) #called here to define the needed TOP_SRC_DIR-variable
file(STRINGS "${TOP_SRC_DIR}/configure.ac" _config_lines) file(STRINGS "${TOP_SRC_DIR}/configure.ac" _config_lines)
if(WIN32)
set(USE_WINDOWS_PACKAGING 1)
elseif(APPLE)
set(USE_MACOSX_PACKAGING 1)
else()
set(USE_POSIX_PACKAGING 1)
endif()
macro(setstripped _varname _value) macro(setstripped _varname _value)
string(STRIP ${_value} _v) string(STRIP ${_value} _v)
set(${_varname} ${_v}) if(USE_POSIX_PACKAGING)
string(TOLOWER ${_v} ${_varname})
else()
set(${_varname} ${_v})
endif()
endmacro(setstripped) endmacro(setstripped)
foreach(_c_l ${_config_lines} ) foreach(_c_l ${_config_lines} )
if(_c_l MATCHES "^AC_INIT\\(\([^,]+\),\([^,]+\),\([^,]+\)\(.*\)") if(_c_l MATCHES "^AC_INIT\\(\([^,]+\),\([^,]+\),\([^,]+\)\(.*\)")
setstripped(PACKAGE_tmp ${CMAKE_MATCH_1}) setstripped(PACKAGE_BASE ${CMAKE_MATCH_1})
setstripped(PACKAGE_VERSION ${CMAKE_MATCH_2}) setstripped(PACKAGE_VERSION ${CMAKE_MATCH_2})
if(PACKAGE_VERSION MATCHES "^\([0-9]+\)\\.\([0-9]+\).*$") if(PACKAGE_VERSION MATCHES "^\([0-9]+\)\\.\([0-9]+\).*$")
set(LYX_DIR_VER "LYX_DIR_${CMAKE_MATCH_1}${CMAKE_MATCH_2}x") set(LYX_DIR_VER "LYX_DIR_${CMAKE_MATCH_1}${CMAKE_MATCH_2}x")
@ -52,13 +64,14 @@ endforeach(_c_l)
if(UseVersionSuffix) if(UseVersionSuffix)
message("-- Using versioned PACKAGE. Disable with -DUseVersionSuffix=0") message("-- Using versioned PACKAGE. Disable with -DUseVersionSuffix=0")
set(PACKAGE ${PACKAGE_tmp}${LYX_INSTALL_SUFFIX}) set(PACKAGE ${PACKAGE_BASE}${LYX_INSTALL_SUFFIX})
set(PROGRAM_SUFFIX "${LYX_INSTALL_SUFFIX}")
else() else()
message("-- PACKAGE not versioned, to enable use -DUseVersionSuffix=1") message("-- PACKAGE not versioned, to enable use -DUseVersionSuffix=1")
set(PACKAGE ${PACKAGE_tmp}) set(PACKAGE ${PACKAGE_BASE})
set(PROGRAM_SUFFIX "")
endif() endif()
set(PROGRAM_SUFFIX "\"\"")
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
# see http://www.cmake.org/pipermail/cmake/2006-October/011559.html # see http://www.cmake.org/pipermail/cmake/2006-October/011559.html
if (UNIX) if (UNIX)
@ -79,14 +92,6 @@ set(LYX_ABS_INSTALLED_LOCALEDIR "${LYX_ABS_INSTALLED_DATADIR}/${LYX_LOCALEDIR}")
set(LYX_ABS_TOP_SRCDIR "${TOP_SRC_DIR}") set(LYX_ABS_TOP_SRCDIR "${TOP_SRC_DIR}")
if(WIN32)
set(USE_WINDOWS_PACKAGING 1)
elseif(APPLE)
set(USE_MACOSX_PACKAGING 1)
else()
set(USE_POSIX_PACKAGING 1)
endif()
if(NOT GROUP_CODE) if(NOT GROUP_CODE)
#set(GROUP_CODE "The Golden Code") #set(GROUP_CODE "The Golden Code")
set(GROUP_CODE flat) set(GROUP_CODE flat)

View File

@ -30,7 +30,7 @@
#cmakedefine LYX_DIR_VER "${LYX_DIR_VER}" #cmakedefine LYX_DIR_VER "${LYX_DIR_VER}"
#cmakedefine LYX_USERDIR_VER "${LYX_USERDIR_VER}" #cmakedefine LYX_USERDIR_VER "${LYX_USERDIR_VER}"
#define PROGRAM_SUFFIX "${PPROGRAM_SUFFIX}" #define PROGRAM_SUFFIX "${PROGRAM_SUFFIX}"
#define LYX_ABS_INSTALLED_DATADIR "${LYX_ABS_INSTALLED_DATADIR}" #define LYX_ABS_INSTALLED_DATADIR "${LYX_ABS_INSTALLED_DATADIR}"
#define LYX_ABS_INSTALLED_LOCALEDIR "${LYX_ABS_INSTALLED_LOCALEDIR}" #define LYX_ABS_INSTALLED_LOCALEDIR "${LYX_ABS_INSTALLED_LOCALEDIR}"
#define LYX_ABS_TOP_SRCDIR "${TOP_SRC_DIR}" #define LYX_ABS_TOP_SRCDIR "${TOP_SRC_DIR}"

View File

@ -10,7 +10,7 @@ project(man)
SET(_manuals) SET(_manuals)
macro(add_manual _mansrc) macro(add_manual _mansrc)
get_filename_component(_mandest ${_mansrc} NAME_WE) get_filename_component(_mandest ${_mansrc} NAME_WE)
SET(_created_manual "${CMAKE_CURRENT_BINARY_DIR}/${_mandest}.1") SET(_created_manual "${CMAKE_CURRENT_BINARY_DIR}/${_mandest}${PROGRAM_SUFFIX}.1")
configure_file("${TOP_SRC_DIR}/${_mansrc}" ${_created_manual} @ONLY) configure_file("${TOP_SRC_DIR}/${_mansrc}" ${_created_manual} @ONLY)
SET_SOURCE_FILES_PROPERTIES(${_created_manual} GENERATED) SET_SOURCE_FILES_PROPERTIES(${_created_manual} GENERATED)
LIST(APPEND _manuals ${_created_manual}) LIST(APPEND _manuals ${_created_manual})

View File

@ -4,7 +4,8 @@
# Copyright (c) 2006, Peter Kümmel, <syntheticpp@gmx.net> # Copyright (c) 2006, Peter Kümmel, <syntheticpp@gmx.net>
# #
project(lyx) set(_lyx ${PACKAGE_BASE}${PROGRAM_SUFFIX})
project(${_lyx})
include_directories(${TOP_SRC_DIR}/src) include_directories(${TOP_SRC_DIR}/src)
@ -52,14 +53,14 @@ if (LYX_LEAK_DETECTION)
set(vld_files ${CMAKE_CURRENT_BINARY_DIR}/vld.ini ${CMAKE_CURRENT_BINARY_DIR}/memory_leak_report.txt) set(vld_files ${CMAKE_CURRENT_BINARY_DIR}/vld.ini ${CMAKE_CURRENT_BINARY_DIR}/memory_leak_report.txt)
endif() endif()
add_executable(lyx add_executable(${_lyx}
${WIN32_CONSOLE} ${WIN32_CONSOLE}
${lyx_sources} ${lyx_sources}
${lyx_headers} ${lyx_headers}
${vld_files} ${vld_files}
) )
target_link_libraries(lyx target_link_libraries(${_lyx}
mathed mathed
insets insets
frontends frontends
@ -72,19 +73,19 @@ target_link_libraries(lyx
${vld_dll}) ${vld_dll})
if (ASPELL_FOUND) if (ASPELL_FOUND)
target_link_libraries(lyx ${ASPELL_LIBRARY}) target_link_libraries(${_lyx} ${ASPELL_LIBRARY})
endif() endif()
if (APPLE) if (APPLE)
target_link_libraries(lyx "-bind_at_load") target_link_libraries(${_lyx} "-bind_at_load")
target_link_libraries(lyx "-framework Carbon") target_link_libraries(${_lyx} "-framework Carbon")
endif() endif()
if (MINGW) if (MINGW)
target_link_libraries(lyx ole32) target_link_libraries(${_lyx} ole32)
endif() endif()
project_source_group("${GROUP_CODE}" lyx_sources lyx_headers) project_source_group("${GROUP_CODE}" lyx_sources lyx_headers)
install(TARGETS lyx DESTINATION bin) install(TARGETS ${_lyx} DESTINATION bin)

View File

@ -5,7 +5,8 @@
# Copyright (c) 2008, 2009 Kornel Benko, <Kornel.Benko@berlin.de> # Copyright (c) 2008, 2009 Kornel Benko, <Kornel.Benko@berlin.de>
# #
project(lyxclient) set(_lyxclient lyxclient${PROGRAM_SUFFIX})
project(${_lyxclient})
file(GLOB _lyxclient_sources ${TOP_SRC_DIR}/src/client/*.cpp) file(GLOB _lyxclient_sources ${TOP_SRC_DIR}/src/client/*.cpp)
file(GLOB _lyxclient_headers ${TOP_SRC_DIR}/src/client/*.h) file(GLOB _lyxclient_headers ${TOP_SRC_DIR}/src/client/*.h)
@ -14,10 +15,10 @@ list(REMOVE_ITEM _lyxclient_headers "${TOP_SRC_DIR}/src/client/pch.h")
include_directories(BEFORE "${TOP_SRC_DIR}/src/client" include_directories(BEFORE "${TOP_SRC_DIR}/src/client"
"${TOP_SRC_DIR}/boost" ${ZLIB_INCLUDE_DIR}) "${TOP_SRC_DIR}/boost" ${ZLIB_INCLUDE_DIR})
add_executable(lyxclient ${_lyxclient_sources} ${_lyxclient_headers}) add_executable(${_lyxclient} ${_lyxclient_sources} ${_lyxclient_headers})
target_link_libraries(lyxclient target_link_libraries(${_lyxclient}
support support
boost_regex boost_regex
${LIBINTL_LIBRARIES} ${LIBINTL_LIBRARIES}
@ -27,12 +28,12 @@ target_link_libraries(lyxclient
) )
if (ASPELL_FOUND) if (ASPELL_FOUND)
target_link_libraries(lyxclient ${ASPELL_LIBRARY}) target_link_libraries(${_lyxclient} ${ASPELL_LIBRARY})
endif() endif()
if (APPLE) if (APPLE)
target_link_libraries(lyxclient "-framework Carbon") target_link_libraries(${_lyxclient} "-framework Carbon")
endif() endif()
install(TARGETS lyxclient DESTINATION bin) install(TARGETS ${_lyxclient} DESTINATION bin)

View File

@ -4,7 +4,8 @@
# Copyright (c) 2006, Peter Kümmel, <syntheticpp@gmx.net> # Copyright (c) 2006, Peter Kümmel, <syntheticpp@gmx.net>
# #
project(tex2lyx) set(_tex2lyx tex2lyx${PROGRAM_SUFFIX})
project(${_tex2lyx})
set(LINKED_sources set(LINKED_sources
${TOP_SRC_DIR}/src/insets/InsetLayout.cpp ${TOP_SRC_DIR}/src/insets/InsetLayout.cpp
@ -47,16 +48,16 @@ include_directories(BEFORE ${TOP_SRC_DIR}/src/tex2lyx
add_definitions(-DTEX2LYX) add_definitions(-DTEX2LYX)
if(NOT MERGE_FILES) if(NOT MERGE_FILES)
add_executable(tex2lyx ${tex2lyx_sources} ${LINKED_sources} add_executable(${_tex2lyx} ${tex2lyx_sources} ${LINKED_sources}
${tex2lyx_headers} ${LINKED_headers}) ${tex2lyx_headers} ${LINKED_headers})
else() else()
lyx_const_touched_files(_allinone tex2lyx_sources) lyx_const_touched_files(_allinone tex2lyx_sources)
lyx_const_touched_files(_allinone_linked LINKED_sources) lyx_const_touched_files(_allinone_linked LINKED_sources)
add_executable(tex2lyx ${_allinone_files} ${_allinone_linked_files}) add_executable(${_tex2lyx} ${_allinone_files} ${_allinone_linked_files})
endif() endif()
target_link_libraries(tex2lyx target_link_libraries(${_tex2lyx}
support support
boost_regex boost_regex
${QT_QTCORE_LIBRARY} ${QT_QTCORE_LIBRARY}
@ -64,14 +65,14 @@ target_link_libraries(tex2lyx
${ICONV_LIBRARY}) ${ICONV_LIBRARY})
if(WIN32) if(WIN32)
target_link_libraries(tex2lyx shlwapi ole32) target_link_libraries(${_tex2lyx} shlwapi ole32)
endif() endif()
if(APPLE) if(APPLE)
target_link_libraries(tex2lyx "-framework Carbon") target_link_libraries(${_tex2lyx} "-framework Carbon")
endif() endif()
project_source_group("${GROUP_CODE}" tex2lyx_sources tex2lyx_headers) project_source_group("${GROUP_CODE}" tex2lyx_sources tex2lyx_headers)
install(TARGETS tex2lyx DESTINATION bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) install(TARGETS ${_tex2lyx} DESTINATION bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)