Changeset 99 in pacpussensors for trunk/Wifibot/CMakeLists.txt


Ignore:
Timestamp:
10/15/15 14:47:01 (9 years ago)
Author:
nguyenhu
Message:

compilation under linux with 0.2.X framework

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Wifibot/CMakeLists.txt

    r21 r99  
     1#########################quick start############################################
     2#cmake ../ -G "CodeBlocks - Unix Makefiles"
     3#make
     4#make install
     5#make clean
     6################################################################################
    17project(Wifibot)
     8set(${PROJECT_NAME}_VERSION_MAJOR 0)
     9set(${PROJECT_NAME}_VERSION_MINOR 1)
     10add_definitions( -DWIFIBOTXT_EXPORTS )
    211################################################################################
    3 add_definitions( -DWIFIBOTXT_EXPORTS )
     12create_export(EXPORT_HDR ${PROJECT_NAME})
     13pacpus_plugin(PLUGIN_CPP PLUGIN_HDR ${PROJECT_NAME})
     14add_definitions (${QT_DEFINITIONS})
    415
    5 # ========================================
    6 # Configure qt4
    7 # ========================================
    8 if(QT4_FOUND)
    9   set(QT_USE_QTXML true)
    10   set(QT_USE_QTNETWORK true)
    11   include(${QT_USE_FILE})
    12 else()
    13   message(ERROR "Qt4 needed")
    14 endif()
    15 
    16 # ========================================
    17 # Compiler definitions
    18 # ========================================
    19 add_definitions(
    20   ${QT_DEFINITIONS}
    21 )
    22 
    23 # ========================================
    24 # Include directories
    25 # ========================================
    26 include_directories(
    27   ${PROJECT_BINARY_DIR}
    28   ${QT_INCLUDE_DIR}
     16find_package(Qt5Network REQUIRED)
     17################################################################################
     18# DIRECTORIES
     19include_directories(
     20    ${PROJECT_BINARY_DIR}
     21    ${QT_INCLUDE_DIR}
     22    ${PACPUS_INCLUDE_DIR}
     23    ${PACPUS_INCLUDE_DIR}/Pacpus/
    2924)
    3025
     
    3227# Link directories
    3328# ========================================
    34 link_directories( ${PACPUS_LIB_DIR}
     29link_directories(
     30        ${PACPUS_LIB_DIR}
    3531)
    3632
    37 message (STATUS ${PACPUS_LIB_DIR})
    3833
    39 pacpus_plugin(PLUGIN_CPP PLUGIN_H ${PROJECT_NAME} )
    40 
    41 # ========================================
    42 # List of sources
    43 # ========================================
    44 set(
    45     PROJECT_SRCS
     34################################################################################
     35# FILES
     36set(PROJECT_HDRS
     37    ${EXPORT_HDR}
     38    wifibot.h
     39    ps3remote.h
     40)
     41set(PROJECT_SRCS
     42    ${PLUGIN_CPP}
    4643    wifibot.cpp
    4744    ps3remote.cpp
    48     ${PLUGIN_CPP}
    4945)
    5046
    51 # ========================================
    52 # Files to MOC
    53 # ========================================
    54 set(
    55     FILES_TO_MOC
     47set(FILES_TO_MOC
     48    ${PLUGIN_HDR}
    5649    wifibot.h
    5750    ps3remote.h
    58     ${PLUGIN_H}
    5951)
    6052
    61 set(
    62     UI_FILES
    63 
     53set(UI_FILES
    6454)
    6555
    66 # ========================================
    67 # Call MOC
    68 # ========================================
    69 qt4_wrap_cpp(
    70     PROJECT_MOC_SRCS
     56################################################################################
     57# Qt: call moc, uic
     58qt_wrap_cpp(PROJECT_MOC_SRCS
    7159    ${FILES_TO_MOC}
    7260)
    7361
    74 qt4_wrap_ui(
    75     PROJECT_UI_SRCS
     62qt_wrap_ui(PROJECT_UI_SRCS
    7663    ${UI_FILES}
    7764)
    7865
    79 # ========================================
    80 # Build a library
    81 # ========================================
    82 pacpus_add_library(
    83     ${PROJECT_NAME} SHARED
     66################################################################################
     67# BUILD and LINK
     68pacpus_add_library(${PROJECT_NAME} SHARED
     69    ${PROJECT_HDRS}
    8470    ${PROJECT_SRCS}
    8571    ${PROJECT_MOC_SRCS}
     
    8773)
    8874
    89 message(STATUS  ${PACPUS_DEPENDENCIES_LIB} )
    9075
    9176# ========================================
    9277# Libraries
    9378# ========================================
    94 # All the platform
    95 target_link_libraries(
    96     ${PROJECT_NAME}
    97     ${PACPUS_LIBRARIES}
    98     ${QT_LIBRARIES}
    99         ${PACPUS_DEPENDENCIES_LIB}
    100         PacpusTools
    101         PacpusSocket
     79set(LIBS
     80    optimized FileLib debug FileLib_d
     81    optimized PacpusLib debug PacpusLib_d
     82    optimized PacpusTools debug PacpusTools_d
     83    optimized PacpusSocket debug PacpusSocket_d
    10284)
    103 
    104 # ========================================
    105 # Install
    106 # ========================================
    107 pacpus_install(${PROJECT_NAME})
    108 
     85if (WIN32)
     86    list(APPEND LIBS
     87        optimized ROAD_TIME debug ROAD_TIME_d
     88    )
     89endif()
     90# LINK
     91target_link_libraries(${PROJECT_NAME}
     92                      ${PACPUS_LIBRARIES}
     93                      ${PACPUS_DEPENDENCIES_LIB}
     94                      ${LIBS}
     95                      ${QT_LIBRARIES} 
     96                     )
     97qt5_use_modules(${PROJECT_NAME} Network)
     98################################################################################
     99# FOLDERS
     100pacpus_folder(${PROJECT_NAME} "components")
     101################################################################################
     102# INSTALL
     103pacpus_install(${PROJECT_NAME})
Note: See TracChangeset for help on using the changeset viewer.