git repos / PlatformFolders

commit 1cbbe99f

Poul Sander · 2018-04-17 16:13
1cbbe99f5e339ec689c58d35e212156f414dc33a patch · browse files
parent 68df0922aca1dc54831ae5b1c31e6ec95b40bc53

Change README. Fix version. Remove old Makefile

Changed files

M CMakeLists.txt before
D Makefile before
M README.md before
D compile_test.sh before
diff --git a/CMakeLists.txt b/CMakeLists.txt index ab4bd89..f860d47 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.0.0 FATAL_ERROR)
-project(platform_folders VERSION 3.0.0 LANGUAGES CXX)
+project(platform_folders VERSION 3.1.0 LANGUAGES CXX)
# Since it's off, the library will be static by default
option(BUILD_SHARED_LIBS "Build shared instead of static." OFF)
diff --git a/Makefile b/Makefile deleted file mode 100644 index bf6b328..0000000 --- a/Makefile +++ /dev/null
@@ -1,46 +0,0 @@
-ifdef CROSS
-CC=$(CROSS)gcc
-CXX=$(CROSS)g++
-LD=$(CROSS)ld
-AR=$(CROSS)ar
-PKG_CONFIG=$(CROSS)pkg-config
-endif
-
-BASE_LIBS=
-BASE_CFLAGS=-c -g -O2 -Wall -Wextra -pedantic-errors
-
-#The files should compile on both C++03 and C++11
-ifdef TESTCPP11
-BASE_CFLAGS+= -std=c++11
-else
-BASE_CFLAGS+= -std=c++03
-endif
-
-#This is used to detect Mac because Mac needs CoreServices for linking
-ifneq ($(OS),Windows_NT)
-UNAME := $(shell uname -s)
-ifeq ($(UNAME),Darwin)
-BASE_LIBS+= -framework CoreServices
-endif
-endif
-
-PROGRAMNAME=platform_folders
-
-O_FILES=${PROGRAMNAME}.o sago/platform_folders.o
-
-total: ${PROGRAMNAME}.out
-
-clean:
- rm -f */*.o *.o *.P */*.P ${PROGRAMNAME}.out
-
-${PROGRAMNAME}.out: $(O_FILES)
- $(CXX) -O -o ${PROGRAMNAME}.out $(O_FILES) $(BASE_LIBS)
-
-%.o : %.cpp
- $(CXX) -MD ${BASE_CFLAGS} -o $@ $<
- @mkdir -p `dirname .$(CROSS)deps/$*.P` && cp $*.d .$(CROSS)deps/$*.P; \
- sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
- -e '/^$$/ d' -e 's/$$/ :/' < $*.d >> .$(CROSS)deps/$*.P; \
- rm -f $*.d
-
--include .$(CROSS)deps/*.P
diff --git a/README.md b/README.md index 2b859e6..80035fe 100644 --- a/README.md +++ b/README.md
@@ -1,5 +1,5 @@
-# PlatformFolders [![Build Status](https://travis-ci.org/sago007/PlatformFolders.svg?branch=master)](https://travis-ci.org/sago007/PlatformFolders) [![license](https://img.shields.io/github/license/sago007/PlatformFolders.svg)](https://raw.githubusercontent.com/sago007/PlatformFolders/master/LICENSE) [![Join the chat at https://gitter.im/PlatformFolders/Lobby](https://badges.gitter.im/PlatformFolders/Lobby.svg)](https://gitter.im/PlatformFolders/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/729e36adcf5c4523bd136de1b33441cb)](https://www.codacy.com/app/github_43/PlatformFolders?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=sago007/PlatformFolders&amp;utm_campaign=Badge_Grade)
-A C++ library to look for special directories like "My Documents" and "%APPDATA%" so that you do not need to write Linux, Windows or Mac OS X specific code
+# PlatformFolders [![Build Status](https://travis-ci.org/sago007/PlatformFolders.svg?branch=master)](https://travis-ci.org/sago007/PlatformFolders) [![license](https://img.shields.io/github/license/sago007/PlatformFolders.svg)](https://raw.githubusercontent.com/sago007/PlatformFolders/master/LICENSE)
+A C++ library to look for special directories like "My Documents" and "%APPDATA%" so that you do not need to write Linux, Windows and Mac OS X specific code
Can be found at: https://github.com/sago007/PlatformFolders
@@ -34,11 +34,22 @@ Uses the deprecated FSFindFolder (there is no C++ alternative). It requires "-fr
# Usage
Copy "sago/platform_files.cpp" and "sago/platform_fildes.h" to your program and make sure that the cpp file is compiled and linked.
+It is also possible to compile and it like:
+```
+mkdir -p build
+cd build
+cmake ..
+make
+```
+Just be aware that Mac OS X requires "-framework CoreServices" during linking no matter the choice.
+
# Hello World
This sample program gets all folders from the system:
```
#include <iostream>
+#include <stirng>
+#include <vector>
#include "sago/platform_folders.h"
using std::cout;
@@ -102,8 +113,14 @@ Download: /Users/poul/Downloads
Save Games 1: /Users/poul/Library/Application Support
```
+# C++ support
+Versions up to 3.X.X should compile with any C++98 compiler.
+Versions from 4.0.0 and up requires a C++11 compatible compiler.
+
+The aim is to always support the default C++ compiler on the oldest supported version of Ubuntu. This is a very basic library and it is not supposed to force you to upgrade.
+
# Encoding
-From version 3.0 UTF-8 is always used on Windows and will also be the default in almost any other system.
+From version 3.0 UTF-8 is always used on Windows and will also be the default on almost any other system.
Before version 3.0 Windows used ANSI encoding. Microsoft's default choice of UTF-16 is not compatible with platform independent code.
Although the user may use an charectors they want I recommend, that the progran should not have non ASCII charectors in the soruce code itself.
diff --git a/compile_test.sh b/compile_test.sh deleted file mode 100755 index 56ffb1e..0000000 --- a/compile_test.sh +++ /dev/null
@@ -1,12 +0,0 @@
-#! /bin/bash
-set -e
-#This script will attempt to compile with C++11, cross compile to windows with C++11, cross compile to windows with C++03, compile with C++03
-make clean
-make TESTCPP11=1
-make clean
-make CROSS=i686-w64-mingw32.static- TESTCPP11=1
-make clean
-make CROSS=i686-w64-mingw32.static-
-mv platform_folders.out platform_folders.exe
-make clean
-make