From e681c5028a756d8f711574a86e84ca8b98333d5c Mon Sep 17 00:00:00 2001 From: Paolo Ambrosio Date: Sat, 9 Mar 2013 17:43:59 +0000 Subject: [PATCH] Headers added to generated projects --- CMakeLists.txt | 4 ++-- src/CMakeLists.txt | 14 +++++++++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3e719630..6a446174 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -98,9 +98,9 @@ endif() # Cucumber-Cpp # -set(CUKE_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/include) +set(CUKE_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include) -include_directories(${CUKE_INCLUDE_DIRS}) +include_directories(${CUKE_INCLUDE_DIR}) set(CUKE_LIBRARIES cucumber-cpp ${CUKE_EXTRA_LIBRARIES}) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e1985da8..ce0658da 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -17,17 +17,25 @@ set(CUKE_SOURCES if(GTEST_FOUND) include_directories(${GTEST_INCLUDE_DIRS}) - set(CUKE_SOURCES ${CUKE_SOURCES} drivers/GTestDriver.cpp) + list(APPEND CUKE_SOURCES drivers/GTestDriver.cpp) endif() if(CPPSPEC_FOUND) include_directories(${CPPSPEC_INCLUDE_DIRS}) - set(CUKE_SOURCES ${CUKE_SOURCES} drivers/CppSpecDriver.cpp) + list(APPEND CUKE_SOURCES drivers/CppSpecDriver.cpp) endif() if(Boost_UNIT_TEST_FRAMEWORK_FOUND) - set(CUKE_SOURCES ${CUKE_SOURCES} drivers/BoostDriver.cpp) + list(APPEND CUKE_SOURCES drivers/BoostDriver.cpp) endif() +if(CMAKE_EXTRA_GENERATOR OR MSVC_IDE) + message(STATUS "Adding header files to project") + file(GLOB_RECURSE CUKE_HEADERS "${CUKE_INCLUDE_DIR}/cucumber-cpp/*.hpp") + if(MSVC_IDE) + source_group("Header Files" FILES ${CUKE_HEADERS}) + endif() + list(APPEND CUKE_SOURCES ${CUKE_HEADERS}) +endif() add_library(cucumber-cpp STATIC ${CUKE_SOURCES})