OpenWaterAnalytics / EPANET

The Water Distribution System Hydraulic and Water Quality Analysis Toolkit
MIT License
272 stars 201 forks source link

No install(runepanet) in CMakeLists.txt #796

Open 0tkl opened 1 month ago

0tkl commented 1 month ago

I suggest adding something like

 target_include_directories(epanet2 PUBLIC ${PROJECT_SOURCE_DIR}/include)

+IF (NOT BUILD_PY_LIB)
+  install(TARGETS runepanet DESTINATION bin)
+ENDIF (NOT BUILD_PY_LIB)
 install(TARGETS epanet2 DESTINATION lib)
 install(FILES ./include/epanet2.h DESTINATION include)
 install(FILES ./include/epanet2_2.h DESTINATION include)

to CMakeList.txt. It would be helpful for packagers. Yeah, I have put it on Archlinux User Repo and I'd like to submit v2.3 to Debian in the future.

Btw, the BUILD_PY_LIB option looks counter-intuitive, from a packager's perspective. The library seems to be built under any input option, although it could be either static-linked or shared (controled by BUILD_SHARED_LIBS). If it doesn't break compatibility, I think flip BUILD_PY_LIB and use a more straightforward name BUILD_EXECUTABLE/BUILD_BIN would be better.