Permalink
Browse files

Test for ftw.h in CMake.

  • Loading branch information...
1 parent 50530d9 commit 3e95567e9b3d23168e9c45c8436cd0e7e1e2ded7 Rémy Oudompheng committed Sep 6, 2010
Showing with 11 additions and 2 deletions.
  1. +1 −0 .gitignore
  2. +4 −1 CMakeLists.txt
  3. +5 −1 parser/CMakeLists.txt
  4. +1 −0 parser/library.cpp
View
1 .gitignore
@@ -1 +1,2 @@
*~
+build
View
5 CMakeLists.txt
@@ -7,7 +7,9 @@ PROJECT(mathkaba)
# package version
SET(MATHKABA_VERSION "0.2.2")
-configure_file(config.h.cmake config.h)
+
+Include(CheckIncludeFile)
+check_include_file(ftw.h HAVE_FTW_H)
# utilities
find_program(XXD xxd)
@@ -21,6 +23,7 @@ pkg_check_modules(GTKMM REQUIRED gtkmm-2.4>=2.12)
include_directories(${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/parser)
link_directories(${CMAKE_BINARY_DIR}/parser)
+configure_file(config.h.cmake config.h)
add_subdirectory(parser)
add_subdirectory(src)
View
6 parser/CMakeLists.txt
@@ -1,4 +1,8 @@
-include_directories(${GLIBMM_INCLUDE_DIRS})
+if(${HAVE_FTW_H})
+ add_definitions(-DHAVE_FTW_H)
+else()
+ include_directories(${GLIBMM_INCLUDE_DIRS})
+endif()
add_library(parser
library.cpp library.hpp
View
1 parser/library.cpp
@@ -20,6 +20,7 @@
*/
#include "library.hpp"
+#include <config.h>
#include <iostream>
#ifdef HAVE_FTW_H

0 comments on commit 3e95567

Please sign in to comment.