Changeset 301 in pacpusframework for trunk/src


Ignore:
Timestamp:
Apr 8, 2014, 10:03:01 AM (11 years ago)
Author:
Marek Kurdej
Message:

Some Unix fixes

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore
      •  

        old new  
        11build
         2CMakeLists.txt.user*
  • trunk/src/FileLib/CMakeLists.txt

    r111 r301  
    99project(FileLib)
    1010
    11 # ========================================
    12 # Compiler definitions
    13 # ========================================
    14 add_definitions(
    15     -DFILELIB_EXPORTS
     11################################################################################
     12create_export(EXPORT_HDR ${PROJECT_NAME} "${PACPUS_INCLUDE_DIR}/Pacpus/kernel")
     13
     14################################################################################
     15# DIRECTORIES
     16link_directories(
     17    ${PROJECT_BINARY_DIR}/../PacpusLib
    1618)
    1719
    18 # ========================================
    19 # Link directories
    20 # ========================================
    21 link_directories(
    22         ${PROJECT_BINARY_DIR}/../PacpusLib
     20################################################################################
     21# FILES
     22set(SRCS
     23    src/DbiteException.cpp
     24    src/DbiteFile.cpp
    2325)
    2426
    25 # ========================================
    26 # List of sources
    27 # ========================================
    28 set(
    29     PROJECT_SRCS
     27set(HDRS
     28    ${EXPORT_HDR}
     29
    3030    ${PACPUS_INCLUDE_DIR}/Pacpus/kernel/DbiteException.h
    3131    ${PACPUS_INCLUDE_DIR}/Pacpus/kernel/DbiteFile.h
    3232    ${PACPUS_INCLUDE_DIR}/Pacpus/kernel/DbiteFileTypes.h
    3333    ${PACPUS_INCLUDE_DIR}/Pacpus/kernel/FileLibConfig.h
    34     ${PACPUS_INCLUDE_DIR}/Pacpus/kernel/hdfile_header_t
     34    ${PACPUS_INCLUDE_DIR}/Pacpus/kernel/hdfile_header_t.h
    3535    ${PACPUS_INCLUDE_DIR}/Pacpus/kernel/road_time.h
    36     src/DbiteException.cpp
    37     src/DbiteFile.cpp
    3836)
    3937
    40 # ========================================
    41 # Build a library
    42 # ========================================
    43 pacpus_add_library(
    44     ${PROJECT_NAME} SHARED
    45     ${PROJECT_SRCS}
     38################################################################################
     39# BUILD and LINK
     40pacpus_add_library(${PROJECT_NAME} SHARED
     41    ${SRCS}
     42    ${HDRS}
    4643)
    4744
    48 # ========================================
    49 # Libraries
    50 # ========================================
     45# LIBS
     46set(LIBS
     47    ${PACPUS_DEPENDENCIES_LIB}
     48)
     49
    5150if(WIN32)
    52 target_link_libraries(
    53     ${PROJECT_NAME}
    54     ${PACPUS_DEPENDENCIES_LIB}
    55     optimized PacpusLib debug PacpusLib_d
    56 )
     51    list(APPEND LIBS
     52        optimized PacpusLib debug PacpusLib_d
     53    )
    5754endif()
    5855
    59 # ========================================
     56# LINK
     57target_link_libraries(${PROJECT_NAME}
     58    ${LIBS}
     59)
     60
     61if(${PACPUS_BUILD_TESTS})
     62    link_directories(
     63        ${PROJECT_BINARY_DIR}/../FileLib
     64    )
     65    pacpus_add_test_executable(Test${PROJECT_NAME}
     66        test/TestFileLib.cpp
     67        ${HDRS}
     68    )
     69    list(APPEND LIBS
     70        ${QT_LIBRARIES}
     71        optimized PacpusLib debug PacpusLib_d
     72        optimized ${PROJECT_NAME} debug ${PROJECT_NAME}_d
     73    )
     74    target_link_libraries(Test${PROJECT_NAME}
     75        ${LIBS}
     76    )
     77endif()
     78
     79################################################################################
    6080# Install
    61 # ========================================
    6281pacpus_install(${PROJECT_NAME})
    6382
    64 # ========================================
    65 # Folder
    66 # ========================================
     83################################################################################
     84# FOLDER
    6785pacpus_folder(${PROJECT_NAME} "libraries")
  • trunk/src/FileLib/test/TestFileLib.cpp

    r89 r301  
    1717#endif // _MSC_VER
    1818
     19#include <Pacpus/kernel/DbiteException.h>
     20#include <Pacpus/kernel/DbiteFile.h>
     21#include <Pacpus/kernel/Log.h>
     22
    1923#include <boost/noncopyable.hpp>
    2024#include <cstdio>
    2125
    22 #include "kernel/DbiteException.h"
    23 #include "kernel/DbiteFile.h"
    24 #include "kernel/Log.h"
    25 
    26 DECLARE_STATIC_LOGGER("pacpus.core.TestFileLib");
     26DECLARE_STATIC_LOGGER("pacpus.framework.test.FileLib");
    2727
    2828using namespace boost;
  • trunk/src/PacpusLib/ColorSeverityFormatter.hpp

    r244 r301  
    2626#include <cstdlib>
    2727#include <sstream>
     28#include <string>
    2829
    2930// could use Boost.Predef with Boost >= 1.55
     
    141142#else
    142143    // On non-Windows platforms, we rely on the TERM variable.
    143     const char* const term = std::getenv("TERM");
     144    std::string const term = std::getenv("TERM");
    144145    const bool termSupportsColor = (term == "xterm")
    145             || (term, "xterm-color")
    146             || (term, "xterm-256color")
    147             || (term, "screen")
    148             || (term, "linux")
    149             || (term, "cygwin");
     146            || (term == "xterm-color")
     147            || (term == "xterm-256color")
     148            || (term == "screen")
     149            || (term == "linux")
     150            || (term == "cygwin");
    150151    return stdoutIsTty && termSupportsColor;
    151152#endif // defined(PACPUS_OS_WINDOWS) && !defined(PACPUS_OS_WINDOWS_MOBILE)
Note: See TracChangeset for help on using the changeset viewer.