From 1eade34854d9bfa858ffd2aa44cd1f5baf5951f8 Mon Sep 17 00:00:00 2001 From: Juergen Kahrs Date: Mon, 11 Feb 2013 09:11:27 +0100 Subject: Preparations for proper handling of bison, gettext and latex. --- CMakeLists.txt | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f67d3d10..d76f834f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -217,6 +217,21 @@ DefineFunctionIfAvailable(mbrtowc HAVE_MBRTOWC) add_definitions(-D HAVE_STRINGIZE) add_definitions(-D _Noreturn=) +find_package(BISON REQUIRED) +if (${BISON_FOUND} STREQUAL "TRUE") + BISON_TARGET(awkgram awkgram.y ${CMAKE_SOURCE_DIR}/awkgram.c) +endif() +#http://www.cmake.org/cmake/help/v2.8.10/cmake.html#module:FindGettext +find_package(Gettext REQUIRED) +if (GETTEXT_FOUND STREQUAL "TRUE") + include_directories(${GETTEXT_INCLUDE_DIR}) +else () + message( FATAL_ERROR "Gettext not found" ) +endif() +find_package(LATEX) +include(GNUInstallDirs) +include(GetPrerequisites) + set (EXTRA_LIBS "") DefineLibraryIfAvailable(m sin "" HAVE_LIBM) @@ -273,7 +288,7 @@ set (GAWK_SOURCES ${GAWK_SOURCES} version.c ) -add_executable (gawk ${GAWK_SOURCES}) +add_executable (gawk ${GAWK_SOURCES} ${BISON_awkgram_OUTPUTS}) target_link_libraries (gawk m ${EXTRA_LIBS}) set(CPACK_PACKAGING_INSTALL_PREFIX /usr) install(PROGRAMS ${CMAKE_BINARY_DIR}/gawk DESTINATION bin) @@ -284,7 +299,9 @@ add_subdirectory(extension) if(NOT ${CMAKE_CROSSCOMPILING} STREQUAL "TRUE") enable_testing() add_subdirectory(test) - add_subdirectory(doc) + if (${LATEX_COMPILER}) + add_subdirectory(doc) + endif() endif() include(InstallRequiredSystemLibraries) -- cgit v1.2.3