Browse Source

fixed includes for instalation; switched to c++11

master
Robin Thoni 9 years ago
parent
commit
a2c5b92dd7

+ 14
- 10
src/CMakeLists.txt View File

1
 include_directories(.)
1
 include_directories(.)
2
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -pthread -I${PCSCLITE_INCLUDE_DIR} -I${CMAKE_SOURCE_DIR}/src/include")
2
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -pthread -I${PCSCLITE_INCLUDE_DIR}")
3
 set(SOURCE_FILES
3
 set(SOURCE_FILES
4
   DBO/ScCommand.cpp
4
   DBO/ScCommand.cpp
5
-  include/ScCommand.h
6
-  include/ScCommand.hxx
5
+  libpcsc_cpptools/ScCommand.h
6
+  libpcsc_cpptools/ScCommand.hxx
7
   DBO/ScBasicCommand.cpp
7
   DBO/ScBasicCommand.cpp
8
-  include/ScBasicCommand.h
9
-  include/ScBasicCommand.hxx
8
+  libpcsc_cpptools/ScBasicCommand.h
9
+  libpcsc_cpptools/ScBasicCommand.hxx
10
   DBO/ScResult.cpp
10
   DBO/ScResult.cpp
11
-  include/ScResult.h
12
-  include/ScResult.hxx
11
+  libpcsc_cpptools/ScResult.h
12
+  libpcsc_cpptools/ScResult.hxx
13
   DataAccess/ScReader.cpp
13
   DataAccess/ScReader.cpp
14
-  include/ScReader.h
15
-  include/ScReader.hxx)
16
-add_library(pcsc_cpptools SHARED ${SOURCE_FILES} include/ScHex.h DBO/ScHex.cpp include/ScApduCommand.h DBO/ScApduCommand.cpp)
14
+  libpcsc_cpptools/ScReader.h
15
+  libpcsc_cpptools/ScReader.hxx
16
+  DBO/ScHex.cpp
17
+  libpcsc_cpptools/ScHex.h
18
+  DBO/ScApduCommand.cpp
19
+  libpcsc_cpptools/ScApduCommand.h)
20
+add_library(pcsc_cpptools SHARED ${SOURCE_FILES})
17
 target_link_libraries(pcsc_cpptools pcsclite)
21
 target_link_libraries(pcsc_cpptools pcsclite)

+ 1
- 1
src/DBO/ScApduCommand.cpp View File

2
 // Created by robin on 6/30/15.
2
 // Created by robin on 6/30/15.
3
 //
3
 //
4
 
4
 
5
-#include "ScApduCommand.h"
5
+#include "libpcsc_cpptools/ScApduCommand.h"

+ 2
- 2
src/DBO/ScBasicCommand.cpp View File

3
 //
3
 //
4
 
4
 
5
 #include <string>
5
 #include <string>
6
-#include <ScHex.h>
7
-#include "ScBasicCommand.h"
6
+#include "libpcsc_cpptools/ScHex.h"
7
+#include "libpcsc_cpptools/ScBasicCommand.h"
8
 
8
 
9
 ScBasicCommand::ScBasicCommand(const std::string &data)
9
 ScBasicCommand::ScBasicCommand(const std::string &data)
10
 {
10
 {

+ 1
- 1
src/DBO/ScCommand.cpp View File

2
 // Created by robin on 6/27/15.
2
 // Created by robin on 6/27/15.
3
 //
3
 //
4
 
4
 
5
-#include "ScCommand.h"
5
+#include "libpcsc_cpptools/ScCommand.h"
6
 
6
 
7
 ScCommand::~ScCommand()
7
 ScCommand::~ScCommand()
8
 {
8
 {

+ 1
- 1
src/DBO/ScHex.cpp View File

4
 
4
 
5
 #include <string>
5
 #include <string>
6
 #include <wintypes.h>
6
 #include <wintypes.h>
7
-#include "ScHex.h"
7
+#include "libpcsc_cpptools/ScHex.h"
8
 
8
 
9
 
9
 
10
 const char ScHex::hexCharToInt(const char& c)
10
 const char ScHex::hexCharToInt(const char& c)

+ 1
- 1
src/DBO/ScResult.cpp View File

2
 // Created by robin on 6/27/15.
2
 // Created by robin on 6/27/15.
3
 //
3
 //
4
 
4
 
5
-#include "ScResult.h"
5
+#include "libpcsc_cpptools/ScResult.h"
6
 
6
 
7
 ScResult::ScResult(const std::string &data)
7
 ScResult::ScResult(const std::string &data)
8
     : _data(data)
8
     : _data(data)

+ 3
- 3
src/DataAccess/ScReader.cpp View File

5
 #include <winscard.h>
5
 #include <winscard.h>
6
 #include <vector>
6
 #include <vector>
7
 #include <string.h>
7
 #include <string.h>
8
-#include "ScReader.h"
8
+#include "libpcsc_cpptools/ScReader.h"
9
 
9
 
10
-thread_local LPSCARDCONTEXT ScReader::_context = nullptr;
11
-thread_local LONG ScReader::_lastStaticResult = SCARD_S_SUCCESS;
10
+/*thread_local*/ LPSCARDCONTEXT ScReader::_context = nullptr;
11
+/*thread_local*/ LONG ScReader::_lastStaticResult = SCARD_S_SUCCESS;
12
 
12
 
13
 ScReader::~ScReader()
13
 ScReader::~ScReader()
14
 {
14
 {

src/include/ScApduCommand.h → src/libpcsc_cpptools/ScApduCommand.h View File


src/include/ScBasicCommand.h → src/libpcsc_cpptools/ScBasicCommand.h View File


src/include/ScBasicCommand.hxx → src/libpcsc_cpptools/ScBasicCommand.hxx View File


src/include/ScCommand.h → src/libpcsc_cpptools/ScCommand.h View File


src/include/ScCommand.hxx → src/libpcsc_cpptools/ScCommand.hxx View File


src/include/ScHex.h → src/libpcsc_cpptools/ScHex.h View File


src/include/ScReader.h → src/libpcsc_cpptools/ScReader.h View File

50
 private:
50
 private:
51
     std::string _name;
51
     std::string _name;
52
 
52
 
53
-    static thread_local LPSCARDCONTEXT _context;
53
+    static /*thread_local*/ LPSCARDCONTEXT _context;
54
 
54
 
55
-    static thread_local LONG _lastStaticResult;
55
+    static /*thread_local*/ LONG _lastStaticResult;
56
 
56
 
57
     LPSCARDHANDLE _card;
57
     LPSCARDHANDLE _card;
58
 
58
 

src/include/ScReader.hxx → src/libpcsc_cpptools/ScReader.hxx View File


src/include/ScResult.h → src/libpcsc_cpptools/ScResult.h View File


src/include/ScResult.hxx → src/libpcsc_cpptools/ScResult.hxx View File


+ 1
- 1
tests/CMakeLists.txt View File

2
 include_directories(${CHECK_INCLUDE_DIRS})
2
 include_directories(${CHECK_INCLUDE_DIRS})
3
 set(LIBS ${LIBS} pcsc_cpptools gtest)
3
 set(LIBS ${LIBS} pcsc_cpptools gtest)
4
 include_directories(. ../src)
4
 include_directories(. ../src)
5
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -pthread -I/usr/include/PCSC -I${CMAKE_SOURCE_DIR}/src/include")
5
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -pthread -I/usr/include/PCSC -I${CMAKE_SOURCE_DIR}/src/include")
6
 add_executable(test_pcsc_cpp_tools test_pcsc_cpp_tools.cpp)
6
 add_executable(test_pcsc_cpp_tools test_pcsc_cpp_tools.cpp)
7
 target_link_libraries(test_pcsc_cpp_tools ${LIBS})
7
 target_link_libraries(test_pcsc_cpp_tools ${LIBS})
8
 add_test(test_pcsc_cpp_tools ${CMAKE_CURRENT_BINARY_DIR}/test_pcsc_cpp_tools)
8
 add_test(test_pcsc_cpp_tools ${CMAKE_CURRENT_BINARY_DIR}/test_pcsc_cpp_tools)

+ 3
- 3
tests/test_pcsc_cpp_tools.cpp View File

1
 #include <iostream>
1
 #include <iostream>
2
 #include <string.h>
2
 #include <string.h>
3
 #include <gtest/gtest.h>
3
 #include <gtest/gtest.h>
4
-#include <ScHex.h>
5
-#include <ScReader.h>
6
-#include <ScBasicCommand.h>
4
+#include <libpcsc_cpptools/ScHex.h>
5
+#include <libpcsc_cpptools/ScReader.h>
6
+#include <libpcsc_cpptools/ScBasicCommand.h>
7
 
7
 
8
 #define TEST_Hex(FUNCTION) do {                                                   \
8
 #define TEST_Hex(FUNCTION) do {                                                   \
9
     FUNCTION("", "", 0);                                                          \
9
     FUNCTION("", "", 0);                                                          \

Loading…
Cancel
Save