Loading CMakeLists.txt +21 −0 Original line number Diff line number Diff line Loading @@ -60,3 +60,24 @@ install(EXPORT CsgEbConfig if (CSG_CGAL_ENABLED) target_compile_definitions(csg-eb PUBLIC USE_CGAL) endif() set(CSGEB_GIT_HASH "") execute_process( COMMAND git describe --abbrev=12 --dirty --always --tags WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} OUTPUT_VARIABLE CSGEB_GIT_HASH ERROR_VARIABLE _tmperr OUTPUT_STRIP_TRAILING_WHITESPACE ) if(_tmperr) message(WARNING "Failing to retrieve Git commit from repo: ${PROJECT_SOURCE_DIR}") endif() set_target_properties(csg-eb PROPERTIES CSGEB_GIT_HASH ${CSGEB_GIT_HASH} EXPORT_PROPERTIES CSGEB_GIT_HASH) # to be used by gnumake file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/CsgEbConfig.mk "CSGEB_GIT_HASH := ${CSGEB_GIT_HASH}") install(FILES ${CMAKE_CURRENT_BINARY_DIR}/CsgEbConfig.mk DESTINATION "${CMAKE_INSTALL_PREFIX}" ) GNUmakefile +6 −1 Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ TARGET ?= libcsg-eb.a BUILD_DIR ?= ./build CONFIG_FILE ?= CsgEbConfig.mk SRCFILENAMES := csg.cpp \ levelset_2d.cpp \ Loading Loading @@ -46,11 +47,15 @@ $(BUILD_DIR)/%.cpp.o: %.cpp $(MKDIR_P) $(dir $@) $(CXX) $(CPPFLAGS) $(CXXFLAGS) -std=c++17 -c $< -o $@ $(CONFIG_FILE): $(TARGET) @echo "CSGEB_GIT_HASH := $(shell git describe --abbrev=12 --dirty --always --tags)" > $@ .PHONY: install install: $(TARGET) install: $(TARGET) $(CONFIG_FILE) @$(MKDIR_P) $(DESTDIR)/lib $(DESTDIR)/include install -m 0755 $< $(DESTDIR)/lib install -m 0755 include/*.hpp $(DESTDIR)/include install -m 0755 $(CONFIG_FILE) $(DESTDIR) .PHONY: clean clean: Loading Loading
CMakeLists.txt +21 −0 Original line number Diff line number Diff line Loading @@ -60,3 +60,24 @@ install(EXPORT CsgEbConfig if (CSG_CGAL_ENABLED) target_compile_definitions(csg-eb PUBLIC USE_CGAL) endif() set(CSGEB_GIT_HASH "") execute_process( COMMAND git describe --abbrev=12 --dirty --always --tags WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} OUTPUT_VARIABLE CSGEB_GIT_HASH ERROR_VARIABLE _tmperr OUTPUT_STRIP_TRAILING_WHITESPACE ) if(_tmperr) message(WARNING "Failing to retrieve Git commit from repo: ${PROJECT_SOURCE_DIR}") endif() set_target_properties(csg-eb PROPERTIES CSGEB_GIT_HASH ${CSGEB_GIT_HASH} EXPORT_PROPERTIES CSGEB_GIT_HASH) # to be used by gnumake file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/CsgEbConfig.mk "CSGEB_GIT_HASH := ${CSGEB_GIT_HASH}") install(FILES ${CMAKE_CURRENT_BINARY_DIR}/CsgEbConfig.mk DESTINATION "${CMAKE_INSTALL_PREFIX}" )
GNUmakefile +6 −1 Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ TARGET ?= libcsg-eb.a BUILD_DIR ?= ./build CONFIG_FILE ?= CsgEbConfig.mk SRCFILENAMES := csg.cpp \ levelset_2d.cpp \ Loading Loading @@ -46,11 +47,15 @@ $(BUILD_DIR)/%.cpp.o: %.cpp $(MKDIR_P) $(dir $@) $(CXX) $(CPPFLAGS) $(CXXFLAGS) -std=c++17 -c $< -o $@ $(CONFIG_FILE): $(TARGET) @echo "CSGEB_GIT_HASH := $(shell git describe --abbrev=12 --dirty --always --tags)" > $@ .PHONY: install install: $(TARGET) install: $(TARGET) $(CONFIG_FILE) @$(MKDIR_P) $(DESTDIR)/lib $(DESTDIR)/include install -m 0755 $< $(DESTDIR)/lib install -m 0755 include/*.hpp $(DESTDIR)/include install -m 0755 $(CONFIG_FILE) $(DESTDIR) .PHONY: clean clean: Loading