diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,6 +14,8 @@ INCLUDE(FindDoxygen) INCLUDE(FindGhostscript) +ADD_DEFINITIONS(-DHAVE_CONFIG_H) + INCLUDE(CheckTypeSize) CHECK_TYPE_SIZE("long long" LONG_LONG) diff --git a/demo/CMakeLists.txt b/demo/CMakeLists.txt --- a/demo/CMakeLists.txt +++ b/demo/CMakeLists.txt @@ -1,4 +1,7 @@ -INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}) +INCLUDE_DIRECTORIES( + ${CMAKE_SOURCE_DIR} + ${PROJECT_BINARY_DIR} +) LINK_DIRECTORIES(${CMAKE_BINARY_DIR}/lemon) diff --git a/lemon/CMakeLists.txt b/lemon/CMakeLists.txt --- a/lemon/CMakeLists.txt +++ b/lemon/CMakeLists.txt @@ -1,4 +1,12 @@ -INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}) +INCLUDE_DIRECTORIES( + ${CMAKE_SOURCE_DIR} + ${PROJECT_BINARY_DIR} +) + +CONFIGURE_FILE( + ${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake + ${CMAKE_CURRENT_BINARY_DIR}/config.h +) ADD_LIBRARY(lemon arg_parser.cc @@ -18,3 +26,8 @@ DESTINATION include/lemon COMPONENT headers FILES_MATCHING PATTERN "*.h") + +INSTALL( + FILES ${CMAKE_CURRENT_BINARY_DIR}/config.h + DESTINATION include/lemon + COMPONENT headers) diff --git a/lemon/Makefile.am b/lemon/Makefile.am --- a/lemon/Makefile.am +++ b/lemon/Makefile.am @@ -23,6 +23,7 @@ lemon/bin_heap.h \ lemon/color.h \ lemon/concept_check.h \ + lemon/config.h \ lemon/counter.h \ lemon/core.h \ lemon/dfs.h \ diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,4 +1,7 @@ -INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}) +INCLUDE_DIRECTORIES( + ${CMAKE_SOURCE_DIR} + ${PROJECT_BINARY_DIR} +) LINK_DIRECTORIES(${CMAKE_BINARY_DIR}/lemon)