mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-18 21:45:24 +00:00
cmake: add Aiksaurus option, fix build system for Aiksaurus
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_6_X@34926 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
02a847a9bc
commit
8383ec013f
@ -34,12 +34,13 @@ message(STATUS "Switch LYX_* variables by -DLYX_*=1 or 0:")
|
||||
message(STATUS)
|
||||
LYX_OPTION(NLS "Use nls" OFF ALL)
|
||||
LYX_OPTION(ASPELL "Require aspell" OFF ALL)
|
||||
LYX_OPTION(AIKSAURUS "Require Aiksaurus" OFF ALL)
|
||||
LYX_OPTION(DEBUG "Build debug version" OFF ALL)
|
||||
LYX_OPTION(RELEASE "Build release version" ON ALL)
|
||||
LYX_OPTION(PROFILE "Build profile version" OFF GCC)
|
||||
LYX_OPTION(USE_EXTERNAL_BOOST "Use external boost" OFF GCC)
|
||||
LYX_OPTION(USE_EXTERNAL_LIBINTL "Use external libintl" ON ALL)
|
||||
LYX_OPTION(INSTALL "Build install projects/rules" ON ALL)
|
||||
LYX_OPTION(INSTALL "Build install projects/rules" OFF ALL)
|
||||
LYX_OPTION(PACKAGE_SUFFIX "Use version suffix for packaging" OFF ALL)
|
||||
LYX_OPTION(PROGRAM_SUFFIX "Append version suffix to binaries" ON GCC)
|
||||
LYX_OPTION(NO_CONSOLE "Suppress console on Windows" OFF MSVC)
|
||||
@ -58,13 +59,15 @@ message(STATUS)
|
||||
|
||||
|
||||
if(LYX_INSTALL)
|
||||
set(LYX_ASPELL ON CACHE BOOL "Aspell option" FORCE)
|
||||
set(LYX_NLS ON CACHE BOOL "Nls option" FORCE)
|
||||
set(LYX_ASPELL ON CACHE BOOL "Aspell option" FORCE)
|
||||
set(LYX_AIKSAURUS ON CACHE BOOL "Aiksaurus option" FORCE)
|
||||
set(LYX_NO_CONSOLE ON CACHE BOOL "No console option" FORCE)
|
||||
set(LYX_PACKAGE_SUFFIX ON CACHE BOOL "Package suffix option" FORCE)
|
||||
set(LYX_RELEASE ON CACHE BOOL "Release option" FORCE)
|
||||
set(LYX_DEBUG OFF CACHE BOOL "Debug option" FORCE)
|
||||
set(LYX_PROFILE OFF CACHE BOOL "Profile option" FORCE)
|
||||
set(LYX_MERGE_FILES ON CACHE BOOL "Merge option" FORCE)
|
||||
endif()
|
||||
|
||||
|
||||
@ -242,8 +245,16 @@ find_package(ZLIB REQUIRED)
|
||||
|
||||
if(LYX_ASPELL)
|
||||
find_package(ASPELL REQUIRED)
|
||||
include_directories(${ASPELL_INCLUDE_DIR})
|
||||
endif()
|
||||
|
||||
if (LYX_AIKSAURUS)
|
||||
find_package(AiksaurusLIB REQUIRED)
|
||||
include_directories(${AIKSAURUSLIB_INCLUDE_DIR})
|
||||
endif()
|
||||
|
||||
|
||||
|
||||
|
||||
if(LYX_USE_EXTERNAL_LIBINTL)
|
||||
find_package(Libintl REQUIRED)
|
||||
@ -251,6 +262,7 @@ if(LYX_USE_EXTERNAL_LIBINTL)
|
||||
endif()
|
||||
|
||||
|
||||
# TODO make Find*.cmake
|
||||
if(WIN32)
|
||||
find_library(ENCHANT_LIBRARY "libenchant")
|
||||
find_path(ENCHANT_INCLUDE_DIR "enchant++.h")
|
||||
@ -265,6 +277,9 @@ if (ENCHANT_LIBRARY AND ENCHANT_INCLUDE_DIR)
|
||||
else()
|
||||
message(STATUS "Enchant not found, building without enchant support")
|
||||
endif()
|
||||
if (ENCHANT_FOUND)
|
||||
include_directories("${ENCHANT_INCLUDE_DIR}")
|
||||
endif()
|
||||
|
||||
|
||||
if(LYX_NLS)
|
||||
@ -433,12 +448,7 @@ else()
|
||||
configure_file(configCompiler.h.cmake ${CMAKE_BINARY_DIR}/configCompiler.h)
|
||||
endif()
|
||||
|
||||
find_package(AiksaurusLIB)
|
||||
if(AIKSAURUSLIB_FOUND)
|
||||
# Variables in config.h will be set correctly with configure_file()
|
||||
set(HAVE_LIBAIKSAURUS 1)
|
||||
set(AIKSAURUS_H_LOCATION 1)
|
||||
endif()
|
||||
|
||||
|
||||
configure_file(config.h.cmake ${CMAKE_BINARY_DIR}/config.h)
|
||||
|
||||
|
@ -48,6 +48,12 @@
|
||||
#endif
|
||||
|
||||
|
||||
#cmakedefine AIKSAURUSLIB_FOUND 1
|
||||
#ifdef AIKSAURUSLIB_FOUND
|
||||
#define HAVE_LIBAIKSAURUS 1
|
||||
#define AIKSAURUS_H_LOCATION "${AIKSAURUSLIB_H}"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -14,9 +14,9 @@ find_path(AIKSAURUSLIB_INCLUDE_DIR NAMES Aiksaurus.h
|
||||
PATH_SUFFIXES "" "Aiksaurus")
|
||||
if(AIKSAURUSLIB_INCLUDE_DIR)
|
||||
if(AIKSAURUSLIB_INCLUDE_DIR MATCHES "Aiksaurus")
|
||||
set(AIKSAURUS_H Aiksaurus/Aiksaurus.h)
|
||||
set(AIKSAURUSLIB_H Aiksaurus/Aiksaurus.h)
|
||||
else()
|
||||
set(AIKSAURUS_H Aiksaurus.h)
|
||||
set(AIKSAURUSLIB_H Aiksaurus.h)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@ -31,4 +31,6 @@ find_library(AIKSAURUSLIB_LIBRARY NAMES ${POTENTIAL_AIKSAURUS_LIBS}
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(AIKSAURUSLIB DEFAULT_MSG AIKSAURUSLIB_LIBRARY AIKSAURUSLIB_INCLUDE_DIR)
|
||||
|
||||
mark_as_advanced(AIKSAURUSLIB_LIBRARY AIKSAURUSLIB_INCLUDE_DIR)
|
||||
set(AIKSAURUSLIB_H ${AIKSAURUSLIB_H} CACHE STRING "Aiksaurus header" FORCE)
|
||||
|
||||
mark_as_advanced(AIKSAURUSLIB_LIBRARY AIKSAURUSLIB_INCLUDE_DIR AIKSAURUSLIB_H)
|
||||
|
@ -31,16 +31,12 @@ list(REMOVE_ITEM lyx_sources
|
||||
${TOP_SRC_DIR}/src/lyxinsets.cpp
|
||||
${TOP_SRC_DIR}/src/lyxmathed.cpp)
|
||||
|
||||
if (ASPELL_FOUND)
|
||||
include_directories(${ASPELL_INCLUDE_DIR})
|
||||
else()
|
||||
if (NOT ASPELL_FOUND)
|
||||
list(REMOVE_ITEM lyx_sources ${TOP_SRC_DIR}/src/ASpell.cpp)
|
||||
list(REMOVE_ITEM lyx_headers ${TOP_SRC_DIR}/src/ASpell_local.h)
|
||||
endif()
|
||||
|
||||
if (ENCHANT_FOUND)
|
||||
include_directories("${ENCHANT_INCLUDE_DIR}")
|
||||
else()
|
||||
if (NOT ENCHANT_FOUND)
|
||||
list(REMOVE_ITEM lyx_sources ${TOP_SRC_DIR}/src/Enchant.cpp)
|
||||
list(REMOVE_ITEM lyx_headers ${TOP_SRC_DIR}/src/Enchant.h)
|
||||
endif()
|
||||
@ -105,6 +101,10 @@ if (ENCHANT_FOUND)
|
||||
target_link_libraries(${_lyx} ${ENCHANT_LIBRARY})
|
||||
endif()
|
||||
|
||||
if (AIKSAURUSLIB_FOUND)
|
||||
target_link_libraries(${_lyx} ${AIKSAURUSLIB_LIBRARY})
|
||||
endif()
|
||||
|
||||
if (APPLE)
|
||||
target_link_libraries(${_lyx} "-bind_at_load")
|
||||
target_link_libraries(${_lyx} "-framework Carbon")
|
||||
@ -114,9 +114,6 @@ if (MINGW)
|
||||
target_link_libraries(${_lyx} ole32)
|
||||
endif()
|
||||
|
||||
if (AIKSAURUSLIB_FOUND)
|
||||
target_link_libraries(${_lyx} ${AIKSAURUSLIB_LIBRARY})
|
||||
endif()
|
||||
project_source_group("${GROUP_CODE}" lyx_sources lyx_headers)
|
||||
|
||||
install(TARGETS ${_lyx} DESTINATION bin)
|
||||
|
Loading…
x
Reference in New Issue
Block a user