Browse files

smartcardpp: Use relative includes for its own headers

This avoid intermediate header staging step and makes building a lot simpler.


git-svn-id: https://esteid.googlecode.com/svn/smartcardpp/trunk@3687 0d7e1ef0-d974-fc83-f0b3-ccc071561e0e
  • Loading branch information...
1 parent 2d67b54 commit a60d1962e0af388a2d24f3b16ff70e4c7e2ee13c kalevlember committed Nov 17, 2010
View
26 CMakeLists.txt
@@ -22,7 +22,6 @@ if(MSVC)
endif(MSVC)
include_directories(
- ${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
${LIBDL_INCLUDE_DIR}
${PCSCLITE_INCLUDE_DIR}
@@ -81,27 +80,9 @@ set(esteid_HDRS
# Public headers which get installed into smartcardpp/sim/ directory
set(sim_HDRS sim/SIMCard.h)
-set(GENERATED_HEADERS "")
-macro(stage_smartcard_headers HEADERS)
- foreach(H ${HEADERS})
- set(SRC "${CMAKE_CURRENT_SOURCE_DIR}/${H}")
- set(DST "${CMAKE_CURRENT_BINARY_DIR}/smartcardpp/${H}")
-
- add_custom_command(
- OUTPUT ${DST}
- COMMAND ${CMAKE_COMMAND} -E copy ${SRC} ${DST}
- DEPENDS ${SRC}
- )
-
- set(GENERATED_HEADERS ${GENERATED_HEADERS} ${DST})
- endforeach(H)
-endmacro(stage_smartcard_headers)
-
-stage_smartcard_headers("${smartcard_HDRS}")
-stage_smartcard_headers("${esteid_HDRS}")
-stage_smartcard_headers("${sim_HDRS}")
-
-install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/smartcardpp DESTINATION ${INCLUDE_INSTALL_DIR})
+install(FILES ${smartcard_HDRS} DESTINATION ${INCLUDE_INSTALL_DIR}/smartcardpp)
+install(FILES ${esteid_HDRS} DESTINATION ${INCLUDE_INSTALL_DIR}/smartcardpp/esteid)
+install(FILES ${sim_HDRS} DESTINATION ${INCLUDE_INSTALL_DIR}/smartcardpp/sim)
if(WIN32 OR APPLE)
set(LIB_TYPE STATIC)
@@ -110,7 +91,6 @@ else(WIN32 OR APPLE)
endif(WIN32 OR APPLE)
add_library(smartcardpp ${LIB_TYPE}
- ${GENERATED_HEADERS}
${smartcard_SRCS}
${sim_SRCS}
${esteid_SRCS}
View
6 CTAPIManager.cpp
@@ -6,9 +6,9 @@
\date $Date: 2009-11-17 01:16:15 +0200 (T, 17 nov 2009) $
*/
// Revision $Revision: 493 $
-#include <smartcardpp/CTAPIManager.h>
-#include <smartcardpp/SCError.h> //for exceptions
-#include <smartcardpp/CardBase.h> //for exceptions
+#include "CTAPIManager.h"
+#include "SCError.h" //for exceptions
+#include "CardBase.h" //for exceptions
#include "helperMacro.h"
#include "common.h"
View
4 CTAPIManager.h
@@ -7,8 +7,8 @@
*/
// Revision $Revision: 345 $
#pragma once
-#include <smartcardpp/ManagerInterface.h>
-#include <smartcardpp/DynamicLibrary.h>
+#include "ManagerInterface.h"
+#include "DynamicLibrary.h"
#ifdef _WIN32
#define CTAPI __stdcall
View
2 CardBase.cpp
@@ -6,7 +6,7 @@
\date $Date: 2009-07-15 21:16:04 +0300 (Wed, 15 Jul 2009) $
*/
// Revision $Revision: 361 $
-#include <smartcardpp/CardBase.h>
+#include "CardBase.h"
#include <algorithm>
#include "helperMacro.h"
#include "common.h"
View
2 CardBase.h
@@ -7,7 +7,7 @@
*/
// Revision $Revision: 422 $
#pragma once
-#include <smartcardpp/ManagerInterface.h>
+#include "ManagerInterface.h"
using std::vector;
View
2 DynamicLibrary.cpp
@@ -6,7 +6,7 @@
\date $Date: 2009-10-05 22:16:29 +0300 (E, 05 okt 2009) $
*/
// Revision $Revision: 473 $
-#include <smartcardpp/DynamicLibrary.h>
+#include "DynamicLibrary.h"
#include <string.h>
#include "common.h"
View
2 ManagerInterface.h
@@ -8,7 +8,7 @@
// Revision $Revision: 345 $
#pragma once
-#include <smartcardpp/types.h>
+#include "types.h"
#include <stdexcept>
struct ConnectionBase;
View
6 PCSCManager.cpp
@@ -14,9 +14,9 @@
#include <arpa/inet.h>
#endif
-#include <smartcardpp/PCSCManager.h>
-#include <smartcardpp/SCError.h>
-#include <smartcardpp/CardBase.h> //for exceptions
+#include "PCSCManager.h"
+#include "SCError.h"
+#include "CardBase.h" //for exceptions
#include "common.h"
#ifndef CM_IOCTL_GET_FEATURE_REQUEST
View
4 PCSCManager.h
@@ -7,8 +7,8 @@
*/
// Revision $Revision: 470 $
#pragma once
-#include <smartcardpp/ManagerInterface.h>
-#include <smartcardpp/DynamicLibrary.h>
+#include "ManagerInterface.h"
+#include "DynamicLibrary.h"
#ifndef _WIN32
#ifdef __APPLE__
typedef void *LPVOID;
View
2 PinString.h
@@ -1,4 +1,4 @@
-#include <smartcardpp/locked_allocator.h>
+#include "locked_allocator.h"
typedef std::basic_string<char, std::char_traits<char>, locked_allocator<char> > base_str;
View
2 SCError.cpp
@@ -6,7 +6,7 @@
\date $Date: 2009-07-06 13:21:43 +0300 (Mon, 06 Jul 2009) $
*/
// Revision $Revision: 345 $
-#include <smartcardpp/SCError.h>
+#include "SCError.h"
#include "common.h"
SCError::SCError(long err) : runtime_error("smart card API error"),error(err)
View
6 SmartCardManager.cpp
@@ -6,9 +6,9 @@
\date $Date: 2009-07-15 21:16:04 +0300 (Wed, 15 Jul 2009) $
*/
// Revision $Revision: 361 $
-#include <smartcardpp/SmartCardManager.h>
-#include <smartcardpp/PCSCManager.h>
-#include <smartcardpp/CTAPIManager.h>
+#include "SmartCardManager.h"
+#include "PCSCManager.h"
+#include "CTAPIManager.h"
#include "common.h"
enum mgrType {
View
2 SmartCardManager.h
@@ -7,7 +7,7 @@
*/
// Revision $Revision: 361 $
#pragma once
-#include <smartcardpp/ManagerInterface.h>
+#include "ManagerInterface.h"
struct SmartCardManagerPriv;
struct SmartCardConnectionPriv;
View
2 common.h
@@ -5,7 +5,7 @@
#include <stdexcept>
#include <sstream>
#include <iomanip>
-#include <smartcardpp/types.h>
+#include "types.h"
#ifdef _WIN32
#include <tchar.h>
View
4 esteid/EstEidCard.cpp
@@ -6,8 +6,8 @@
\date $Date: 2010-02-04 08:10:53 +0200 (N, 04 veebr 2010) $
*/
// Revision $Revision: 512 $
-#include <smartcardpp/esteid/EstEidCard.h>
-#include <smartcardpp/SCError.h>
+#include "EstEidCard.h"
+#include "SCError.h"
#include <algorithm>
#include "helperMacro.h"
#include "common.h"
View
4 esteid/EstEidCard.h
@@ -7,8 +7,8 @@
*/
// Revision $Revision: 512 $
#pragma once
-#include <smartcardpp/CardBase.h>
-#include <smartcardpp/PinString.h>
+#include "../CardBase.h"
+#include "../PinString.h"
/// Estonian ID card class. Supplies most of the card functions
class EstEidCard:
View
2 esteid/EstEidCardMaintainer.cpp
@@ -6,7 +6,7 @@
\date $Date: 2009-07-09 19:31:59 +0300 (Thu, 09 Jul 2009) $
*/
// Revision $Revision: 351 $
-#include <smartcardpp/esteid/EstEidCardMaintainer.h>
+#include "EstEidCardMaintainer.h"
#include "common.h"
void EstEidCardMaintainer::performGenerateNewKeys() {
View
2 esteid/EstEidCardMaintainer.h
@@ -7,7 +7,7 @@
*/
// Revision $Revision: 346 $
#pragma once
-#include <smartcardpp/esteid/EstEidCard.h>
+#include "EstEidCard.h"
/// Estonian ID card maintaier class, for generating keys and replacing certificates
class EstEidCardMaintainer {
View
2 sim/SIMCard.cpp
@@ -1,4 +1,4 @@
-#include <smartcardpp/sim/SIMCard.h>
+#include "SIMCard.h"
#include "common.h"
SIMCard::SIMCard(ManagerInterface &ref) : CardBase(ref) {}
View
2 sim/SIMCard.h
@@ -1,5 +1,5 @@
#pragma once
-#include <smartcardpp/CardBase.h>
+#include "../CardBase.h"
class SIMCard :
public CardBase
View
14 smartcardpp.h
@@ -3,12 +3,12 @@
//This is a main header - it inludes everything else.
-#include <smartcardpp/CardBase.h>
-#include <smartcardpp/DynamicLibrary.h>
-#include <smartcardpp/esteid/EstEidCard.h>
-#include <smartcardpp/SCError.h>
-#include <smartcardpp/sim/SIMCard.h>
-#include <smartcardpp/SmartCardManager.h>
-#include <smartcardpp/types.h>
+#include "CardBase.h"
+#include "DynamicLibrary.h"
+#include "esteid/EstEidCard.h"
+#include "SCError.h"
+#include "sim/SIMCard.h"
+#include "SmartCardManager.h"
+#include "types.h"
#endif // SMARTCARDPP_H
View
2 test.cpp
@@ -1,6 +1,6 @@
#include <iostream>
#include <string>
-#include <smartcardpp/smartcardpp.h>
+#include "smartcardpp.h"
void validateOnPinpad() {
SmartCardManager mgr;

0 comments on commit a60d196

Please sign in to comment.