Index: trunk/SpanCPTComponent/CMakeLists.txt
===================================================================
--- trunk/SpanCPTComponent/CMakeLists.txt	(revision 59)
+++ trunk/SpanCPTComponent/CMakeLists.txt	(revision 99)
@@ -1,2 +1,8 @@
+#########################quick start############################################
+#cmake ../ -G "CodeBlocks - Unix Makefiles"
+#make
+#make install
+#make clean
+################################################################################
 project(SpanCPTComponent)
 
@@ -4,30 +10,17 @@
 add_definitions( -DCPTCOMPONENT_EXPORTS )
 add_definitions( -DPLUGINLIB_EXPORTS ) 
+################################################################################
+create_export(EXPORT_HDR ${PROJECT_NAME})
+pacpus_plugin(PLUGIN_CPP PLUGIN_HDR ${PROJECT_NAME})
+add_definitions (${QT_DEFINITIONS})
 
-
-# ========================================
-# Configure qt4
-# ========================================
-if(QT4_FOUND)
-  set(QT_USE_QTXML true)
-  set(QT_USE_QTNETWORK true)
-  include(${QT_USE_FILE})
-else()
-  message(ERROR "Qt4 needed")
-endif()
-
-# ========================================
-# Compiler definitions
-# ========================================
-add_definitions(
-  ${QT_DEFINITIONS}
-)
-
-# ========================================
-# Include directories
-# ========================================
-include_directories(
-  ${PROJECT_BINARY_DIR}
-  ${QT_INCLUDE_DIR}
+find_package(Qt5Network REQUIRED)
+################################################################################
+# DIRECTORIES
+include_directories( 
+    ${PROJECT_BINARY_DIR}
+    ${QT_INCLUDE_DIR}
+    ${PACPUS_INCLUDE_DIR}
+    ${PACPUS_INCLUDE_DIR}/Pacpus/
 )
 
@@ -40,16 +33,16 @@
 
 
-pacpus_plugin(PLUGIN_CPP PLUGIN_H ${PROJECT_NAME} )
-
-# ========================================
-# List of sources
-# ========================================
-set(
-    PROJECT_SRCS
-	CPTComponent.h
-	CPTComponent.cpp
+################################################################################
+# FILES
+set(PROJECT_HDRS
+    ${EXPORT_HDR}
+    CPTComponent.h  
     ../driver/AbstractSerialPort.h
-    ../driver/AbstractSerialPort.cpp
+    xml/spancpt.xml 
+)
+set(PROJECT_SRCS
     ${PLUGIN_CPP}
+    CPTComponent.cpp 
+    ../driver/AbstractSerialPort.cpp 
 )
 
@@ -70,9 +63,4 @@
 endif(UNIX)
 
-
-# ========================================
-# Files to MOC
-# ========================================
-
 if(UNIX)
 set(FILES_TO_MOC 
@@ -80,5 +68,5 @@
   CPTComponent.h
   ../driver/PosixSerialPort.h
-    ${PLUGIN_H}
+    ${PLUGIN_HDR}
   )
 endif(UNIX)
@@ -89,30 +77,25 @@
   CPTComponent.h
   ../driver/Win32SerialPort.h
-    ${PLUGIN_H}
+    ${PLUGIN_HDR}
   )
 endif(WIN32)
 
-set(
-    UI_FILES
+set(UI_FILES
 )
 
-# ========================================
-# Call MOC
-# ========================================
-qt4_wrap_cpp(
-    PROJECT_MOC_SRCS
+################################################################################
+# Qt: call moc, uic
+qt_wrap_cpp(PROJECT_MOC_SRCS
     ${FILES_TO_MOC}
 )
 
-qt4_wrap_ui(
-    PROJECT_UI_SRCS
+qt_wrap_ui(PROJECT_UI_SRCS
     ${UI_FILES}
 )
 
-# ========================================
-# Build a library
-# ========================================
-pacpus_add_library(
-    ${PROJECT_NAME} SHARED
+################################################################################
+# BUILD and LINK
+pacpus_add_library(${PROJECT_NAME} SHARED
+    ${PROJECT_HDRS}
     ${PROJECT_SRCS}
     ${PROJECT_MOC_SRCS}
@@ -120,36 +103,31 @@
 )
 
+
 # ========================================
 # Libraries
 # ========================================
-if(WIN32)
-    set(LIBS
-        # add your specific libraries to link here
-        optimized NMEA0183LIB debug NMEA0183LIB_d
-		optimized PacpusTools debug PacpusTools_d
+set(LIBS
+    optimized FileLib debug FileLib_d
+    optimized PacpusLib debug PacpusLib_d
+    optimized PacpusTools debug PacpusTools_d
+    optimized NMEA0183LIB debug NMEA0183LIB_d
+)
+if (WIN32)
+    list(APPEND LIBS
+        optimized ROAD_TIME debug ROAD_TIME_d
     )
-endif(WIN32)
-
-if(UNIX)
-    set(LIBS
-        # add your specific libraries to link here
-
-    )
-endif(UNIX)
-
-# All the platform
-target_link_libraries(
-    ${PROJECT_NAME}
-    ${PACPUS_LIBRARIES}
-    ${QT_LIBRARIES}
-	${PACPUS_DEPENDENCIES_LIB}
-	${LIBS}
-#	optimized PacpusTools debug PacpusTools_d
-)
+endif()
+# LINK 
+target_link_libraries(${PROJECT_NAME} 
+		      ${PACPUS_LIBRARIES} 
+	              ${PACPUS_DEPENDENCIES_LIB} 
+                      ${LIBS}
+                      ${QT_LIBRARIES} 
+                     )
+qt5_use_modules(${PROJECT_NAME} Network)
+################################################################################
+# FOLDERS
 pacpus_folder(${PROJECT_NAME} "components")
-
-# ========================================
-# Install
-# ========================================
-pacpus_install(${PROJECT_NAME})
-
+################################################################################
+# INSTALL
+pacpus_install(${PROJECT_NAME}) 
