Skip to content

Commit e681c50

Browse files
committed
Headers added to generated projects
1 parent 93a0d6a commit e681c50

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ endif()
9898
# Cucumber-Cpp
9999
#
100100

101-
set(CUKE_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/include)
101+
set(CUKE_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include)
102102

103-
include_directories(${CUKE_INCLUDE_DIRS})
103+
include_directories(${CUKE_INCLUDE_DIR})
104104

105105
set(CUKE_LIBRARIES cucumber-cpp ${CUKE_EXTRA_LIBRARIES})
106106

src/CMakeLists.txt

+11-3
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,25 @@ set(CUKE_SOURCES
1717

1818
if(GTEST_FOUND)
1919
include_directories(${GTEST_INCLUDE_DIRS})
20-
set(CUKE_SOURCES ${CUKE_SOURCES} drivers/GTestDriver.cpp)
20+
list(APPEND CUKE_SOURCES drivers/GTestDriver.cpp)
2121
endif()
2222

2323
if(CPPSPEC_FOUND)
2424
include_directories(${CPPSPEC_INCLUDE_DIRS})
25-
set(CUKE_SOURCES ${CUKE_SOURCES} drivers/CppSpecDriver.cpp)
25+
list(APPEND CUKE_SOURCES drivers/CppSpecDriver.cpp)
2626
endif()
2727

2828
if(Boost_UNIT_TEST_FRAMEWORK_FOUND)
29-
set(CUKE_SOURCES ${CUKE_SOURCES} drivers/BoostDriver.cpp)
29+
list(APPEND CUKE_SOURCES drivers/BoostDriver.cpp)
3030
endif()
3131

32+
if(CMAKE_EXTRA_GENERATOR OR MSVC_IDE)
33+
message(STATUS "Adding header files to project")
34+
file(GLOB_RECURSE CUKE_HEADERS "${CUKE_INCLUDE_DIR}/cucumber-cpp/*.hpp")
35+
if(MSVC_IDE)
36+
source_group("Header Files" FILES ${CUKE_HEADERS})
37+
endif()
38+
list(APPEND CUKE_SOURCES ${CUKE_HEADERS})
39+
endif()
3240

3341
add_library(cucumber-cpp STATIC ${CUKE_SOURCES})

0 commit comments

Comments
 (0)