aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt24
-rw-r--r--cmake/Toolchain_generic.cmake2
-rw-r--r--cmake/Toolchain_mingw32.cmake2
-rw-r--r--cmake/configure.cmake40
4 files changed, 37 insertions, 31 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 89d39207..97d415d3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -83,17 +83,19 @@ add_executable (gawk ${GAWK_SOURCES} ${BISON_awkgram_OUTPUTS})
target_link_libraries (gawk m ${EXTRA_LIBS})
install(PROGRAMS ${CMAKE_BINARY_DIR}/gawk DESTINATION bin)
-# Beware: before building the extension, -DGAWK gets undefined.
-add_subdirectory(extension)
+if (CMAKE_HOST_UNIX)
+ # Beware: before building the extension, -DGAWK gets undefined.
+ add_subdirectory(extension)
-if(NOT ${CMAKE_CROSSCOMPILING} STREQUAL "TRUE")
- enable_testing()
- add_subdirectory(test)
- if (LATEX_COMPILER)
- add_subdirectory(doc)
+ if(NOT ${CMAKE_CROSSCOMPILING} STREQUAL "TRUE")
+ enable_testing()
+ add_subdirectory(test)
+ if (LATEX_COMPILER)
+ add_subdirectory(doc)
+ endif()
endif()
-endif()
-include(InstallRequiredSystemLibraries)
-set(CPACK_PACKAGING_INSTALL_PREFIX /usr)
-include(cmake/package.cmake)
+ include(InstallRequiredSystemLibraries)
+ set(CPACK_PACKAGING_INSTALL_PREFIX /usr)
+ include(cmake/package.cmake)
+endif()
diff --git a/cmake/Toolchain_generic.cmake b/cmake/Toolchain_generic.cmake
index bbd25593..91ddc6e7 100644
--- a/cmake/Toolchain_generic.cmake
+++ b/cmake/Toolchain_generic.cmake
@@ -10,7 +10,7 @@ SET(CMAKE_C_COMPILER /usr/bin/gcc)
# here is the target environment located
# Settings for Ubuntu 12.04.1 LTS
-SET(CMAKE_FIND_ROOT_PATH /usr/include)
+SET(CMAKE_FIND_ROOT_PATH /usr/)
# adjust the default behaviour of the FIND_XXX() commands:
# search headers and libraries in the target environment, search
diff --git a/cmake/Toolchain_mingw32.cmake b/cmake/Toolchain_mingw32.cmake
index 8f1d2fbd..bb885f2f 100644
--- a/cmake/Toolchain_mingw32.cmake
+++ b/cmake/Toolchain_mingw32.cmake
@@ -12,7 +12,7 @@ SET(CMAKE_RC_COMPILER /usr/bin/i686-w64-mingw32-windres)
# here is the target environment located
# Settings for Ubuntu 12.04.1 LTS
-SET(CMAKE_FIND_ROOT_PATH /usr/i686-w64-mingw32 /usr/i686-w64-mingw32/include)
+SET(CMAKE_FIND_ROOT_PATH /usr/i686-w64-mingw32)
# adjust the default behaviour of the FIND_XXX() commands:
# search headers and libraries in the target environment, search
diff --git a/cmake/configure.cmake b/cmake/configure.cmake
index 38265b98..cd66e24b 100644
--- a/cmake/configure.cmake
+++ b/cmake/configure.cmake
@@ -143,13 +143,15 @@ DefineHFileIfAvailable(stdint.h HAVE_STDINT_H)
DefineHFileIfAvailable(inttypes.h HAVE_INTTYPES_H)
DefineHFileIfAvailable(stdlib.h HAVE_STDLIB_H)
DefineHFileIfAvailable(unistd.h HAVE_UNISTD_H)
-DefineFunctionIfAvailable(gettext HAVE_GETTEXT)
-DefineFunctionIfAvailable(dcgettext HAVE_DCGETTEXT)
+if (CMAKE_HOST_UNIX)
+ DefineFunctionIfAvailable(gettext HAVE_GETTEXT)
+ DefineFunctionIfAvailable(dcgettext HAVE_DCGETTEXT)
FIND_PACKAGE(Gettext REQUIRED)
-# FIND_PACKAGE(XGettext REQUIRED)
-# FIND_PACKAGE(Iconv REQUIRED)
+ # FIND_PACKAGE(XGettext REQUIRED)
+ # FIND_PACKAGE(Iconv REQUIRED)
FIND_PATH(INTL_INCLUDE_DIR libintl.h PATHS /usr/include /usr/local/include)
FIND_LIBRARY(INTL_LIBRARIES intl c PATHS /usr/lib/ /usr/local/lib)
+endif()
DefineSymbolIfAvailable("CODESET" "langinfo.h" HAVE_LANGINFO_CODESET)
DefineSymbolIfAvailable("LC_MESSAGES" "locale.h" HAVE_LC_MESSAGES)
DefineTypeIfAvailable("_Bool" HAVE__BOOL)
@@ -246,22 +248,24 @@ 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()
+if (CMAKE_HOST_UNIX)
+ 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()
+ #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)
+ find_package(LATEX)
+ include(GNUInstallDirs)
+ include(GetPrerequisites)
+endif()
# For some unknown reason the defines for the extension
# are written into config.h only if they are implemented