Closed hickford closed 5 years ago
Either teach your tooling to accept *.h
as well, or change the line that CMake is complaining about to search for hpp
. You also need to change the Testfile then to include the hpp
.
@NobbZ is correct, there isn't a reasonable way for us to support both naming conventions.
Thanks
If it helps anyone else, here's a patch for CMakeLists.txt
@@ -26,4 +26,10 @@
+if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${file}.hpp)
+ set(exercise_header ${file}.hpp)
+else()
+ set(exercise_header ${file}.h)
+endif()
+
# Build executable from sources and headers
-add_executable(${exercise} ${file}_test.cpp ${exercise_cpp} ${file}.h)
+add_executable(${exercise} ${file}_test.cpp ${exercise_cpp} ${exercise_header})
I'd send a pull request but not sure how to update 47 files
This wouldn't solve the problem, as you still need to fix the Testsuite manually. And you can not avoid that unless you create some additional compilation there. That again would clutter the testfiles
My tooling requires I use extension
.hpp
rather than.h
for header files. This gives an error fromcmake
.