diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..ddaebcd --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 3.19.0) + +project(ncom2csv) + +if(${CMAKE_SYSTEM_NAME} MATCHES Darwin) + message("Apple OS (Darwin) detected") +elseif(${CMAKE_SYSTEM_NAME} MATCHES Linux) + message("Linux OS detected") +else() + message(FATAL_ERROR "${CMAKE_SYSTEM_NAME} OS detected - currently not supported - EXIT") +endif() + +set(SOURCES nav/NComRxC.c example/NcomToCsv.c) +add_executable(${PROJECT_NAME} ${SOURCES}) +target_include_directories(${PROJECT_NAME} PRIVATE nav) \ No newline at end of file diff --git a/example/Makefile b/example/Makefile deleted file mode 100644 index 1650dfe..0000000 --- a/example/Makefile +++ /dev/null @@ -1,38 +0,0 @@ -############################################################# -# # -# Make file for the NComToCsv example using the NCOMdecoder # -# # -############################################################# - -#Directories -IDIR =../nav -EXAMPLE_DIR=. - -#Compiler settings -CC =gcc -CFLAGS=-I$(IDIR) -lm - -#NCOMdecoder dependencies -_DEPS = NComRxC.h -DEPS = $(patsubst %,$(IDIR)/%,$(_DEPS)) - -#NCOMdecoder object files required -_OBJ = NComRxC.o -OBJ = $(patsubst %,$(IDIR)/%,$(_OBJ)) - -#Example object files required -_EXAMPLE = NcomToCsv.o -EXAMPLE = $(patsubst %,$(EXAMPLE_DIR)/%,$(_EXAMPLE)) - -#Rule for *library* object files -$(IDIR)/%.o: %.c $(DEPS) - $(CC) -c -o $@ $< $(CFLAGS) - -#Rule for the executable -NComToCsv: $(OBJ) $(EXAMPLE) - gcc -o $@ $^ $(CFLAGS) - -.PHONY: clean - -clean: - rm $(IDIR)/*.o $(EXAMPLE_DIR)/*.o $(EXAMPLE_DIR)/*.exe