Discussion:
[Cucumber] [c++][cucumber-cpp] Building cucumber-cpp as a shared dynamic library
(too old to reply)
Leonard Norr
2018-03-07 17:12:37 UTC
Permalink
Hello fellow Cukers,
I needed to build cucumber-cpp as a shared dynamic library for integrating
into our project.

This was not documented, so after some trial-and-error, I am at least
providing the steps to do so here:

*Steps to build cucumber-cpp as a shared dynamic library:*

Step 1:
Edit the "CMakeLists.txt" in the cucumber-cpp "src" directory:
..
# Originally: add_library(cucumber-cpp-nomain STATIC ${CUKE_SOURCES})
add_library(cucumber-cpp-nomain SHARED ${CUKE_SOURCES})
# Originally: add_library(cucumber-cpp STATIC ${CUKE_SOURCES} main.cpp)
add_library(cucumber-cpp SHARED ${CUKE_SOURCES} main.cpp)
..
# Originally: target_link_libraries(cucumber-cpp-nomain PRIVATE
${CUKE_DEP_LIBRARIES})
target_link_libraries(cucumber-cpp-nomain PRIVATE ${CUKE_DEP_LIBRARIES}
${Boost_LIBRARIES})
# target_link_libraries(cucumber-cpp PRIVATE ${CUKE_DEP_LIBRARIES})
target_link_libraries(cucumber-cpp PRIVATE ${CUKE_DEP_LIBRARIES}
${Boost_LIBRARIES})

Step 2:
Build as you would normally build cucumber-cpp.

That's it! You should now have cucumber-cpp.so or cucumber.dylib in the
build directory, ready to easily integrate into your larger project. I
haven't build the Windows DLL, so I don't know how well that works.

Regards,

Leonard
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...