diff --git a/CMakeLists.txt b/CMakeLists.txt index a9c6062..7d352ff 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,7 +10,6 @@ set(LIB_MINOR_VERSION 1) set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) include(Version) -#SET(CMAKE_C_COMPILER "/usr/bin/g++") set(CMAKE_MACOSX_RPATH 0) set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} -Wall) set(CMAKE_INSTALL_PREFIX /opt/MESA) @@ -35,26 +34,21 @@ endif() include_directories(${PROJECT_SOURCE_DIR}/inc/) -file(GLOB SRC - "src/*.c" - "src/*.cpp" -) - # Shared Library Output -add_library(${lib_name}_shared SHARED ${SRC}) +add_library(${lib_name}_shared SHARED src/MESA_handle_logger.c) if(DEFINED MESA_SHARED_INSTALL_DIR) set_target_properties(${lib_name}_shared PROPERTIES OUTPUT_NAME ${lib_name} LIBRARY_OUTPUT_DIRECTORY ${MESA_SHARED_INSTALL_DIR}) else() set_target_properties(${lib_name}_shared PROPERTIES OUTPUT_NAME ${lib_name}) endif() -set_target_properties(${lib_name}_shared PROPERTIES VERSION ${LIB_MAJOR_VERSION}.${LIB_MINOR_VERSION}) -set_target_properties(${lib_name}_shared PROPERTIES SOVERSION ${LIB_MAJOR_VERSION}) +#set_target_properties(${lib_name}_shared PROPERTIES VERSION ${LIB_MAJOR_VERSION}.${LIB_MINOR_VERSION}) +#set_target_properties(${lib_name}_shared PROPERTIES SOVERSION ${LIB_MAJOR_VERSION}) # static Library Output -add_library(${lib_name}_static STATIC ${SRC}) +add_library(${lib_name}_static STATIC src/MESA_handle_logger.c) set_target_properties(${lib_name}_static PROPERTIES OUTPUT_NAME ${lib_name}) set(CMAKE_INSTALL_PREFIX /opt/MESA) @@ -64,12 +58,7 @@ install(FILES inc/${lib_name}.h DESTINATION ${CMAKE_INSTALL_PREFIX}/include/ME -file(GLOB DEMO - "demo/*.c" - "demo/*.cpp" -) - -add_executable(${lib_name}_demo ${DEMO}) +add_executable(${lib_name}_demo demo/test_handle_logger.c) target_link_libraries(${lib_name}_demo rt pthread ${lib_name}_static) include(Package) diff --git a/README b/README index d933733..1d2d219 100644 --- a/README +++ b/README @@ -4,13 +4,16 @@ *Author:yangwei@iie.ac.cn *History: 2014-03-24 created by yw - 1)first version + 1)第一个动态库版本 2014-04-16 modified by yw - 1)strict inspection parameters, compatible with g++ 4.4.4 + 1) 支持g++ 4.4.4编译 2014-05-29 update by yw - 1)create directory is supported + 1)支持创建用户指定的日志目录 + + 2019-2-18 update by yw + 1)性能优化,句柄中存储文件fp,定期flush至文件 ------------------------------------------------------------------------------------- NOTICE: 1)compatible with g++, extern with c;