Common: Relocated reusable object to 'common' dir

This commit is contained in:
Paul Beckingham 2015-12-20 09:46:34 -05:00
parent 735b0ce793
commit a4b3f0c84a
12 changed files with 27 additions and 8 deletions

View file

@ -101,6 +101,7 @@ configure_file (
${CMAKE_SOURCE_DIR}/cmake.h)
add_subdirectory (src)
add_subdirectory (src/common)
if (EXISTS ${CMAKE_SOURCE_DIR}/test)
add_subdirectory (test EXCLUDE_FROM_ALL)
endif (EXISTS ${CMAKE_SOURCE_DIR}/test)
@ -116,6 +117,7 @@ set (CPACK_SOURCE_GENERATOR "TGZ")
set (CPACK_SOURCE_PACKAGE_FILE_NAME ${PACKAGE_NAME}-${PACKAGE_VERSION})
set (CPACK_SOURCE_IGNORE_FILES "CMakeCache" "CMakeFiles" "CPackConfig" "CPackSourceConfig"
"_CPack_Packages" "cmake_install" "install_manifest" "Makefile$"
"test" "package-config" "misc/*" "src/timew$" "src/calc$" "performance"
"src/libtimew.a" "/\\\\.gitignore" "/\\\\.git/" "swp$" "src/lex$")
"test" "package-config" "misc/*" "src/timew$" "src/common/libcommon.a"
"performance" "src/libtimew.a" "/\\\\.gitignore" "/\\\\.git/" "swp$"
"src/lex$")
include (CPack)

View file

@ -1,17 +1,15 @@
cmake_minimum_required (VERSION 2.8)
include_directories (${CMAKE_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/src
${CMAKE_SOURCE_DIR}/common
${TIMEW_INCLUDE_DIRS})
set (timew_SRCS Color.h Color.cpp
text.h text.cpp
utf8.h utf8.cpp
wcwidth6.cpp)
set (timew_SRCS LR0.cpp LR0.h)
add_library (timew STATIC ${timew_SRCS})
add_executable (timew_executable main.cpp)
target_link_libraries (timew_executable timew ${TIMEW_LIBRARIES})
target_link_libraries (timew_executable common timew ${TIMEW_LIBRARIES})
set_property (TARGET timew_executable PROPERTY OUTPUT_NAME "timew")

1
src/common/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
libcommon.a

17
src/common/CMakeLists.txt Normal file
View file

@ -0,0 +1,17 @@
cmake_minimum_required (VERSION 2.8)
include_directories (${CMAKE_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/src
${CMAKE_SOURCE_DIR}/src/common
${TIMEW_INCLUDE_DIRS})
set (common_SRCS Color.cpp Color.h
text.cpp text.h
utf8.cpp utf8.h
wcwidth6.cpp)
add_library (common STATIC ${common_SRCS})
#SET(CMAKE_BUILD_TYPE gcov)
#SET(CMAKE_CXX_FLAGS_GCOV "--coverage")
#SET(CMAKE_C_FLAGS_GCOV "--coverage")
#SET(CMAKE_EXE_LINKER_FLAGS_GCOV "--coverage")

View file

@ -5,6 +5,7 @@ endif()
include_directories (${CMAKE_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/src
${CMAKE_SOURCE_DIR}/common
${CMAKE_SOURCE_DIR}/test
${TIMEW_INCLUDE_DIRS})
@ -19,7 +20,7 @@ add_custom_target (build_tests DEPENDS ${test_SRCS}
foreach (src_FILE ${test_SRCS})
add_executable (${src_FILE} "${src_FILE}.cpp" test.cpp)
target_link_libraries (${src_FILE} timew ${TIMEW_LIBRARIES})
target_link_libraries (${src_FILE} timew common ${TIMEW_LIBRARIES})
endforeach (src_FILE)
configure_file(run_all run_all COPYONLY)