Am Montag, 9. Mai 2011 schrieb Kornel: > What we could do, is convert development/cmake/CMakeLists.txt to a > something like TopLyx.cmake and include directly in the top-level > CMakeLists.txt. Also the add_subdirectory() calls in this TopLyx.cmake has > to be expanded with a second parameter, e.g. add_subdirectory(src) > will be changed to > add_subdirectory(src "$TOP_BINARY_DIR/src")
I have a patch ready for this. May I commit? It works here. Part1, make the changes Part 2, a moment later, make the rename. Attached the patch for changes. Kornel
Index: development/cmake/CMakeLists.txt =================================================================== --- development/cmake/CMakeLists.txt (Revision 38662) +++ development/cmake/CMakeLists.txt (Arbeitskopie) @@ -21,7 +21,6 @@ include(LyXMacros) - # Usage LYX_OPTION # 1. parameter: option name without prefix 'LYX_' # 2. parameter: description @@ -302,7 +301,7 @@ endif() find_package(LyXGettext REQUIRED) include_directories(${TOP_SRC_DIR}/po) - add_subdirectory(po) + add_subdirectory(po "${TOP_BINARY_DIR}/po") endif() if(LYX_EXTERNAL_LIBINTL) @@ -310,7 +309,7 @@ add_definitions(-DHAVE_GETTEXT) #TODO move to config.h else() if(LYX_NLS) - add_subdirectory(intl) + add_subdirectory(intl "${TOP_BINARY_DIR}/intl") else() # do not compile if nls disabled endif() @@ -334,7 +333,7 @@ endif() add_definitions(-DBOOST_USER_CONFIG="<config.h>") include_directories(${TOP_SRC_DIR}/boost) - add_subdirectory(boost) + add_subdirectory(boost "${TOP_BINARY_DIR}/boost") endif() @@ -372,8 +371,8 @@ # PCHs not supported by cmake: http://www.cmake.org/Bug/view.php?id=1260 # Not sure if it works for all non-msvc compilers include(PCHSupport_26) - configure_file(${TOP_SRC_DIR}/development/cmake/pcheaders.h ${TOP_BINARY_DIR}/pcheaders.h) - configure_file(${TOP_SRC_DIR}/development/cmake/config.cpp.cmake ${TOP_BINARY_DIR}/config_pch.cpp) + configure_file(${TOP_SRC_DIR}/${LYX_CMAKE_DIR}/pcheaders.h ${TOP_BINARY_DIR}/pcheaders.h) + configure_file(${TOP_SRC_DIR}/${LYX_CMAKE_DIR}/config.cpp.cmake ${TOP_BINARY_DIR}/config_pch.cpp) add_definitions(-DLYX_ENABLE_PCH) if(MSVC) @@ -474,16 +473,16 @@ if(MSVC AND NOT LYX_CONFIGURE_CHECKS) configure_file(configCompiler.h.msvc ${TOP_BINARY_DIR}/configCompiler.h) else() - include(ConfigureChecks.cmake) - configure_file(configCompiler.h.cmake ${TOP_BINARY_DIR}/configCompiler.h) + include(${LYX_CMAKE_DIR}/ConfigureChecks.cmake) + configure_file(${LYX_CMAKE_DIR}/configCompiler.h.cmake ${TOP_BINARY_DIR}/configCompiler.h) endif() -configure_file(config.h.cmake ${TOP_BINARY_DIR}/config.h) +configure_file(${LYX_CMAKE_DIR}/config.h.cmake ${TOP_BINARY_DIR}/config.h) -add_subdirectory(src) -add_subdirectory(lyx2lyx) -add_subdirectory(scripts) +add_subdirectory(src "${TOP_BINARY_DIR}/src") +add_subdirectory(lyx2lyx "${TOP_BINARY_DIR}/lyx2lyx") +add_subdirectory(scripts "${TOP_BINARY_DIR}/scripts") if(LYX_INSTALL) @@ -491,8 +490,8 @@ if(${LYX_PERL_EXECUTABLE} MATCHES "-NOTFOUND") message(FATAL_ERROR "Perl required!") endif() - add_subdirectory(man) - add_subdirectory(doc) + add_subdirectory(man "${TOP_BINARY_DIR}/man") + add_subdirectory(doc "${TOP_BINARY_DIR}/doc") include(../Install) endif() @@ -505,7 +504,7 @@ set(CPACK_PACKAGE_VERSION_MAJOR "${LYX_MAJOR_VERSION}") set(CPACK_PACKAGE_VERSION_MINOR "${LYX_MINOR_VERSION}") -FILE(STRINGS "${TOP_SRC_DIR}/development/cmake/LyX_summary.txt" CPACK_PACKAGE_DESCRIPTION_SUMMARY) +FILE(STRINGS "${TOP_SRC_DIR}/${LYX_CMAKE_DIR}/LyX_summary.txt" CPACK_PACKAGE_DESCRIPTION_SUMMARY) set(CPACK_SOURCE_GENERATOR TGZ ZIP TBZ2) set(CPACK_SOURCE_INSTALLED_DIRECTORIES "${TOP_SRC_DIR};/") # http://www.mail-archive.com/cmake@cmake.org/msg33720.html @@ -517,7 +516,7 @@ # # needed by rpm set(CPACK_SET_DESTDIR "ON") -FILE(READ "${TOP_SRC_DIR}/development/cmake/LyX_license.txt" CPACK_RPM_PACKAGE_LICENSE) +FILE(READ "${TOP_SRC_DIR}/${LYX_CMAKE_DIR}/LyX_license.txt" CPACK_RPM_PACKAGE_LICENSE) set(CPACK_RPM_PACKAGE_GROUP "Applications/Publishing") set(CPACK_RPM_PACKAGE_VENDOR "The LyX team") # @@ -540,8 +539,8 @@ endif() # # for the next ones, cpack 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") +set(CPACK_PACKAGE_DESCRIPTION_FILE "${TOP_SRC_DIR}/${LYX_CMAKE_DIR}/LyX_description.txt") +set(CPACK_RESOURCE_FILE_LICENSE "${TOP_SRC_DIR}/${LYX_CMAKE_DIR}/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 Index: CMakeLists.txt =================================================================== --- CMakeLists.txt (Revision 38662) +++ CMakeLists.txt (Arbeitskopie) @@ -22,9 +22,10 @@ else() message(STATUS "Building out-of-source") set(TOP_BINARY_DIR "${CMAKE_BINARY_DIR}") - cmake_policy(SET CMP0013 OLD) + #cmake_policy(SET CMP0013 OLD) endif() -add_subdirectory(development/cmake "${TOP_BINARY_DIR}") +set(LYX_CMAKE_DIR "development/cmake") +include("${TOP_SRC_DIR}/${LYX_CMAKE_DIR}/CMakeLists.txt")
signature.asc
Description: This is a digitally signed message part.