2006-09-15 17:05:20 +00:00
|
|
|
|
# This file is part of LyX, the document processor.
|
|
|
|
|
# Licence details can be found in the file COPYING.
|
|
|
|
|
#
|
|
|
|
|
# Copyright (c) 2006, Peter K<>mmel, <syntheticpp@gmx.net>
|
|
|
|
|
#
|
|
|
|
|
|
2006-06-11 11:57:25 +00:00
|
|
|
|
# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked
|
|
|
|
|
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/modules")
|
|
|
|
|
|
2006-09-21 10:50:27 +00:00
|
|
|
|
set (EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
|
|
|
|
|
|
2006-09-21 10:51:50 +00:00
|
|
|
|
set(PACKAGE lyx)
|
|
|
|
|
set(PACKAGE_VERSION 1.5.0svn)
|
2006-10-19 21:35:44 +00:00
|
|
|
|
set(LYX_DATE "not released yet")
|
|
|
|
|
#TODO
|
|
|
|
|
set(VERSION_INFO "CMake Build")
|
2006-09-21 10:51:50 +00:00
|
|
|
|
|
|
|
|
|
if(WIN32)
|
|
|
|
|
set(USE_WINDOWS_PACKAGING 1)
|
|
|
|
|
else(WIN32)
|
|
|
|
|
set(USE_POSIX_PACKAGING 1)
|
|
|
|
|
endif(WIN32)
|
|
|
|
|
|
2006-09-03 23:50:16 +00:00
|
|
|
|
if(NOT GROUP_CODE)
|
|
|
|
|
#set(GROUP_CODE "The Golden Code")
|
|
|
|
|
set(GROUP_CODE flat)
|
|
|
|
|
endif(NOT GROUP_CODE)
|
2006-09-03 17:51:53 +00:00
|
|
|
|
|
2006-06-11 11:57:25 +00:00
|
|
|
|
include(LyXPaths)
|
|
|
|
|
include(LyXMacros)
|
2006-09-03 23:50:16 +00:00
|
|
|
|
include(ProjectSourceGroup)
|
2006-06-11 11:57:25 +00:00
|
|
|
|
|
2006-06-15 15:11:25 +00:00
|
|
|
|
if(release)
|
2006-06-21 10:32:17 +00:00
|
|
|
|
set(CMAKE_BUILD_TYPE Release)
|
2006-06-15 15:11:25 +00:00
|
|
|
|
set(release)
|
|
|
|
|
endif(release)
|
|
|
|
|
|
2006-06-20 09:57:19 +00:00
|
|
|
|
|
2006-10-21 08:35:47 +00:00
|
|
|
|
set(qt_postfix qt4)
|
|
|
|
|
project(lyx-${qt_postfix})
|
|
|
|
|
find_package(Qt4 REQUIRED)
|
2006-06-20 09:57:19 +00:00
|
|
|
|
|
2006-06-11 11:57:25 +00:00
|
|
|
|
find_package(ZLIB REQUIRED)
|
2006-08-14 11:18:51 +00:00
|
|
|
|
find_package(ICONV REQUIRED)
|
|
|
|
|
add_definitions(-DHAVE_ICONV=1)
|
2006-06-11 11:57:25 +00:00
|
|
|
|
|
|
|
|
|
if(all OR aspell)
|
2006-10-20 12:46:30 +00:00
|
|
|
|
set(aspell TRUE CACHE TYPE STRING)
|
2006-06-11 11:57:25 +00:00
|
|
|
|
find_package(ASPELL REQUIRED)
|
|
|
|
|
else(all OR aspell)
|
|
|
|
|
find_package(ASPELL)
|
|
|
|
|
endif(all OR aspell)
|
|
|
|
|
set(aspell)
|
|
|
|
|
|
|
|
|
|
message("")
|
2006-08-14 11:46:57 +00:00
|
|
|
|
if(nls OR all)
|
2006-10-20 12:46:30 +00:00
|
|
|
|
set(nls TRUE CACHE TYPE STRING)
|
2006-08-14 11:18:51 +00:00
|
|
|
|
add_definitions(-DENABLE_NLS=1)
|
2006-08-14 11:46:57 +00:00
|
|
|
|
message("----- Building with ENABLE_NLS")
|
|
|
|
|
else(nls OR all)
|
|
|
|
|
message("----- No nls, to enable use -Dnls=1")
|
|
|
|
|
endif(nls OR all)
|
2006-08-14 11:18:51 +00:00
|
|
|
|
set(nls)
|
2006-06-11 11:57:25 +00:00
|
|
|
|
if(ASPELL_FOUND)
|
|
|
|
|
add_definitions(-DUSE_ASPELL=1)
|
|
|
|
|
message("----- Building with USE_ASPELL")
|
|
|
|
|
else(ASPELL_FOUND)
|
|
|
|
|
message("----- No aspell, to get more information use -Daspell=1")
|
|
|
|
|
endif(ASPELL_FOUND)
|
|
|
|
|
message("")
|
|
|
|
|
set(all)
|
|
|
|
|
|
|
|
|
|
# create config.h
|
|
|
|
|
include(ConfigureChecks.cmake)
|
|
|
|
|
configure_file(config.h.cmake ${CMAKE_BINARY_DIR}/config.h )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(MSVC)
|
|
|
|
|
if(MSVC_IDE)
|
|
|
|
|
add_definitions(-DBOOST_USER_CONFIG=<\;config.h>\;)
|
|
|
|
|
else(MSVC_IDE)
|
|
|
|
|
add_definitions(-DBOOST_USER_CONFIG="<config.h>")
|
|
|
|
|
SET(CMAKE_EXE_LINKER_FLAGS /MANIFEST)
|
|
|
|
|
endif(MSVC_IDE)
|
|
|
|
|
|
2006-10-23 13:32:46 +00:00
|
|
|
|
ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
|
2006-10-26 18:38:46 +00:00
|
|
|
|
|
|
|
|
|
# disable checked iterators for msvc release builds to get maximum speed
|
|
|
|
|
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /D_SECURE_SCL=0")
|
2006-06-11 11:57:25 +00:00
|
|
|
|
else(MSVC)
|
|
|
|
|
add_definitions(-DBOOST_USER_CONFIG="<config.h>")
|
|
|
|
|
endif(MSVC)
|
|
|
|
|
|
2006-10-25 17:57:04 +00:00
|
|
|
|
if(MSVC AND NOT disable-pch)
|
2006-10-23 19:04:29 +00:00
|
|
|
|
configure_file(${CMAKE_SOURCE_DIR}/pcheaders.h ${CMAKE_BINARY_DIR}/pcheaders.h)
|
2006-10-25 17:57:04 +00:00
|
|
|
|
configure_file(${CMAKE_SOURCE_DIR}/config.C.cmake ${CMAKE_CURRENT_BINARY_DIR}/config_pch.C)
|
2006-10-23 19:04:29 +00:00
|
|
|
|
macro(lyx_add_msvc_pch name_)
|
2006-10-25 17:57:04 +00:00
|
|
|
|
SET_SOURCE_FILES_PROPERTIES(${${name_}_sources} PROPERTIES COMPILE_FLAGS "/Yuconfig.h /Fp\$(IntDir)/config.pch")
|
|
|
|
|
SET_SOURCE_FILES_PROPERTIES(${CMAKE_BINARY_DIR}/config_pch.C PROPERTIES COMPILE_FLAGS "/Ycconfig.h /Fp\$(IntDir)/config.pch")
|
2006-10-23 19:04:29 +00:00
|
|
|
|
add_definitions(/DLYX_PRECOMPILED_HEADERS)
|
2006-10-25 17:57:04 +00:00
|
|
|
|
set(${name_}_sources ${${name_}_sources} ${CMAKE_BINARY_DIR}/config_pch.C ${CMAKE_BINARY_DIR}/pcheaders.h)
|
2006-10-23 13:32:46 +00:00
|
|
|
|
endmacro(lyx_add_msvc_pch)
|
2006-10-25 17:57:04 +00:00
|
|
|
|
else(MSVC AND NOT disable-pch)
|
|
|
|
|
set(disable-pch TRUE CACHE TYPE STRING)
|
2006-10-23 13:32:46 +00:00
|
|
|
|
macro(lyx_add_msvc_pch)
|
|
|
|
|
endmacro(lyx_add_msvc_pch)
|
2006-10-25 17:57:04 +00:00
|
|
|
|
endif(MSVC AND NOT disable-pch)
|
2006-10-23 13:32:46 +00:00
|
|
|
|
|
2006-10-19 21:35:44 +00:00
|
|
|
|
|
|
|
|
|
#TODO: insource is not the best place
|
|
|
|
|
configure_file(${TOP_SRC_DIR}/lib/lyx2lyx/lyx2lyx_version.py.in
|
|
|
|
|
${TOP_SRC_DIR}/lib/lyx2lyx/lyx2lyx_version.py)
|
2006-06-11 11:57:25 +00:00
|
|
|
|
|
|
|
|
|
include_directories(
|
|
|
|
|
${CMAKE_BINARY_DIR}
|
|
|
|
|
${TOP_SRC_DIR}/src
|
|
|
|
|
${TOP_SRC_DIR}/boost
|
|
|
|
|
${QT_INCLUDES}
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
add_subdirectory(boost)
|
|
|
|
|
add_subdirectory(intl)
|
|
|
|
|
add_subdirectory(src)
|