diff --git a/CMakeLists.txt b/CMakeLists.txt index e262b83..2c1af46 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,7 +46,7 @@ endif() # generate header file to handle version configure_file( - "${PROJECT_SOURCE_DIR}/version.h.in" "${PROJECT_SOURCE_DIR}/version.h" + "${PROJECT_SOURCE_DIR}/common/version.h.in" "${PROJECT_BINARY_DIR}/version.h" ) # set build type @@ -77,10 +77,11 @@ else() endif() # set common source files -set(COMMON_SOURCES "tmux-mem-cpu-load.cc" "graph.cc") +set(COMMON_SOURCES "common/tmux-mem-cpu-load.cc" "common/graph.cc") # add binary tree so we find version.h include_directories("${PROJECT_BINARY_DIR}") +include_directories("${PROJECT_SOURCE_DIR}" "${PROJECT_SOURCE_DIR}/common") add_executable(tmux-mem-cpu-load ${COMMON_SOURCES} ${METER_SOURCES}) install(TARGETS tmux-mem-cpu-load RUNTIME DESTINATION bin) diff --git a/bsd/load.cc b/bsd/load.cc index 1ae14cc..3a8517e 100644 --- a/bsd/load.cc +++ b/bsd/load.cc @@ -28,7 +28,7 @@ #include "getsysctl.h" #include "load.h" -#include "../luts.h" +#include "luts.h" // Load Averages std::string load_string( bool use_colors = false ) diff --git a/bsd/memory_freebsd.cc b/bsd/memory_freebsd.cc index 23fe67f..aa3b076 100644 --- a/bsd/memory_freebsd.cc +++ b/bsd/memory_freebsd.cc @@ -25,8 +25,8 @@ #include "getsysctl.h" #include "memory.h" -#include "../luts.h" -#include "../conversions.h" +#include "luts.h" +#include "conversions.h" std::string mem_string( bool use_colors = false ) { diff --git a/bsd/memory_openbsd.cc b/bsd/memory_openbsd.cc index 69bdd03..a391cac 100644 --- a/bsd/memory_openbsd.cc +++ b/bsd/memory_openbsd.cc @@ -28,8 +28,8 @@ #include "getsysctl.h" #include "memory.h" -#include "../luts.h" -#include "../conversions.h" +#include "luts.h" +#include "conversions.h" std::string mem_string( bool use_colors = false ) { diff --git a/conversions.h b/common/conversions.h similarity index 100% rename from conversions.h rename to common/conversions.h diff --git a/generate-luts.py b/common/generate-luts.py similarity index 100% rename from generate-luts.py rename to common/generate-luts.py diff --git a/graph.cc b/common/graph.cc similarity index 100% rename from graph.cc rename to common/graph.cc diff --git a/graph.h b/common/graph.h similarity index 100% rename from graph.h rename to common/graph.h diff --git a/luts.h b/common/luts.h similarity index 100% rename from luts.h rename to common/luts.h diff --git a/tmux-mem-cpu-load.cc b/common/tmux-mem-cpu-load.cc similarity index 100% rename from tmux-mem-cpu-load.cc rename to common/tmux-mem-cpu-load.cc diff --git a/version.h.in b/common/version.h.in similarity index 100% rename from version.h.in rename to common/version.h.in diff --git a/linux/cpu.cc b/linux/cpu.cc index e55ccb2..c105bac 100644 --- a/linux/cpu.cc +++ b/linux/cpu.cc @@ -21,7 +21,7 @@ #include // usleep #include "cpu.h" -#include "../luts.h" +#include "luts.h" float cpu_percentage( unsigned cpu_usage_delay ) { diff --git a/linux/load.cc b/linux/load.cc index 917a20b..a93c1fa 100644 --- a/linux/load.cc +++ b/linux/load.cc @@ -23,7 +23,7 @@ #include // SI_LOAD_SHIFT #include "load.h" -#include "../luts.h" +#include "luts.h" std::string load_string( bool use_colors = false ) { diff --git a/linux/memory.cc b/linux/memory.cc index 9f96b0d..30a8eed 100644 --- a/linux/memory.cc +++ b/linux/memory.cc @@ -21,8 +21,8 @@ #include #include "memory.h" -#include "../luts.h" -#include "../conversions.h" +#include "luts.h" +#include "conversions.h" std::string mem_string( bool use_colors = false ) { diff --git a/osx/load.cc b/osx/load.cc index 029add2..cf4a816 100644 --- a/osx/load.cc +++ b/osx/load.cc @@ -25,7 +25,7 @@ #include // getloadavg() #include "load.h" -#include "../luts.h" +#include "luts.h" std::string load_string( bool use_colors = false ) { diff --git a/osx/memory.cc b/osx/memory.cc index bacad9d..b538523 100644 --- a/osx/memory.cc +++ b/osx/memory.cc @@ -22,8 +22,8 @@ #include // for sysctl #include "memory.h" -#include "../luts.h" -#include "../conversions.h" +#include "luts.h" +#include "conversions.h" std::string mem_string( bool use_colors ) {