- add flags for debug/release/profile
 - also build qt4 as one file with gcc
 
 


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17558 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Peter Kümmel 2007-03-25 22:03:59 +00:00
parent 9b7bd6a910
commit 745c9e91fd
4 changed files with 41 additions and 8 deletions

View File

@ -42,10 +42,34 @@ if(merge OR MERGE_FILES)
message(STATUS "")
endif(merge OR MERGE_FILES)
set(CMAKE_BUILD_TYPE)
if(profile)
set(CMAKE_BUILD_TYPE Profile)
set(profile)
endif(profile)
if(release)
set(CMAKE_BUILD_TYPE Release)
set(release)
endif(release)
if(debug)
set(CMAKE_BUILD_TYPE Debug)
endif(debug)
if(UNIX)
set(LYX_CXX_FLAGS -Wall)
if(stdlib-debug)
set(LYX_CXX_FLAGS "${LYX_CXX_FLAGS} -D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC")
endif(stdlib-debug)
if(concept-checks)
set(LYX_CXX_FLAGS "${LYX_CXX_FLAGS} -D_GLIBCPP_CONCEPT_CHECKS")
endif(concept-checks)
set(CMAKE_CXX_FLAGS "${LYX_CXX_FLAGS}" CACHE TYPE STRING FORCE)
set(CMAKE_CXX_FLAGS_DEBUG "${LYX_CXX_FLAGS} -O -g -D_DEBUG" CACHE TYPE STRING FORCE)
set(CMAKE_CXX_FLAGS_RELEASE "${LYX_CXX_FLAGS} -O3 -DNDEBUG" CACHE TYPE STRING FORCE)
set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE} -pg" CACHE TYPE STRING FORCE)
endif(UNIX)
set(qt_postfix qt4)
@ -57,8 +81,6 @@ if(MERGE_FILES)
endif(MERGE_FILES)
find_package(ZLIB REQUIRED)
find_package(ICONV REQUIRED)
add_definitions(-DHAVE_ICONV=1)
if(all OR aspell)
set(aspell TRUE CACHE TYPE STRING)
@ -196,6 +218,10 @@ endif(MSVC)
include(ConfigureChecks.cmake)
configure_file(config.h.cmake ${CMAKE_BINARY_DIR}/config.h )
find_package(ICONV REQUIRED)
add_definitions(-DHAVE_ICONV=1)
#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)

View File

@ -13,7 +13,9 @@ add_subdirectory(graphics)
add_subdirectory(insets)
add_subdirectory(mathed)
add_subdirectory(support)
add_subdirectory(tex2lyx)
if(NOT MERGE_FILES)
add_subdirectory(tex2lyx)
endif(NOT MERGE_FILES)
configure_file(${TOP_SRC_DIR}/src/version.C.in ${CMAKE_CURRENT_BINARY_DIR}/version.C)

View File

@ -31,7 +31,12 @@ include_directories(
${TOP_SRC_DIR}/src/frontends/controllers
${CMAKE_CURRENT_BINARY_DIR})
if(MERGE_FILES AND MSVC)
if(MERGE_FILES)
list(REMOVE_ITEM frontends_qt4_sources ${TOP_SRC_DIR}/src/frontends/qt4/QCommandEdit.C)
list(APPEND frontends_qt4_sources ${TOP_SRC_DIR}/src/frontends/qt4/QCommandEdit.C)
list(REVERSE frontends_qt4_sources)
list(REMOVE_ITEM frontends_qt4_sources ${TOP_SRC_DIR}/src/frontends/qt4/GuiApplication.C)
list(APPEND frontends_qt4_sources ${TOP_SRC_DIR}/src/frontends/qt4/GuiApplication.C)
lyx_merge_files(allinone frontends_qt4_sources)
set(depends_moc_uic ${frontends_qt4_headers} ${ui_files})
SET_SOURCE_FILES_PROPERTIES(allinone_const.C PROPERTIES OBJECT_DEPENDS "${depends_moc_uic}")
@ -43,9 +48,9 @@ if(MERGE_FILES AND MSVC)
${frontends_qt4_headers}
${ui_files}
)
else(MERGE_FILES AND MSVC)
else(MERGE_FILES)
add_library(frontend_qt4 STATIC ${frontends_qt4_sources} ${frontends_qt4_headers} ${ui_files})
endif(MERGE_FILES AND MSVC)
endif(MERGE_FILES)
target_link_libraries(frontend_qt4 ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} controllers)

View File

@ -28,7 +28,7 @@
#ifdef Q_WS_X11
#include <qwidget.h>
#include <X11/Xlib.h>
//#include <X11/Xlib.h>
#include <algorithm>
#endif