CMakeLists.txt 457 B

123456789101112131415161718192021
  1. set(SUBDIRS "log")
  2. aux_source_directory(. DIR_SRCS)
  3. string(REGEX REPLACE ".*/(.*)" "\\1" LIB_NAME ${CMAKE_CURRENT_SOURCE_DIR})
  4. if (DIR_SRCS)
  5. foreach(libname ${LIBNAMES})
  6. if (${LIB_NAME} STREQUAL ${libname})
  7. add_library(${libname} ${CMAKE_LIB_TYPE} ${DIR_SRCS})
  8. endif()
  9. endforeach()
  10. else()
  11. message(WARNING "not find is src file!")
  12. endif()
  13. foreach(subdir ${SUBDIRS})
  14. add_subdirectory(${subdir})
  15. endforeach()