summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchenzizhan <[email protected]>2023-08-04 14:16:17 +0800
committerchenzizhan <[email protected]>2023-08-04 14:16:17 +0800
commitd74e3add12b3a53305e4b61854e58648232f37ae (patch)
tree4c640d8053617d7ea2ade71c8cf94ff1b56e0823
parent29a98afae0f3b2d983ef11bf8a91227f22272893 (diff)
mesa lib, rpm
-rw-r--r--CMakeLists.txt11
-rw-r--r--cmake/Package.cmake2
-rw-r--r--src/fieldstat.c1
-rw-r--r--test/CMakeLists.txt2
4 files changed, 12 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8c7c293..6797ddc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -24,6 +24,10 @@ set(CMAKE_MACOSX_RPATH 0)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -fPIC -Wall -lm -lz --std=gnu11")
set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} -Wall)
+set(C_INCLUDE_PATH ${C_INCLUDE_PATH} /opt/MESA/include)
+set(CPLUS_INCLUDE_PATH ${CPLUS_INCLUDE_PATH} /opt/MESA/include)
+set (LIBRARY_PATH ${LIBRARY_PATH} /opt/MESA/lib)
+
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX "/opt/MESA" CACHE PATH "default install path" FORCE)
endif()
@@ -128,5 +132,8 @@ endif()
add_library(${lib_name}_static STATIC ${SRC})
set_target_properties(${lib_name}_static PROPERTIES OUTPUT_NAME ${lib_name})
-install(TARGETS ${lib_name}_shared LIBRARY DESTINATION ${PROJECT_SOURCE_DIR}/lib COMPONENT LIBRARIES)
-install(TARGETS ${lib_name}_static LIBRARY ARCHIVE DESTINATION ${PROJECT_SOURCE_DIR}/lib COMPONENT LIBRARIES)
+install(TARGETS ${lib_name}_shared LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib COMPONENT LIBRARIES)
+install(TARGETS ${lib_name}_static LIBRARY ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib COMPONENT LIBRARIES)
+install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_PREFIX}/include COMPONENT HEADER)
+
+include(Package) \ No newline at end of file
diff --git a/cmake/Package.cmake b/cmake/Package.cmake
index 6187cb8..10b75fc 100644
--- a/cmake/Package.cmake
+++ b/cmake/Package.cmake
@@ -21,7 +21,7 @@ set(CPACK_RPM_FILE_NAME "RPM-DEFAULT")
set(CPACK_RPM_PACKAGE_VENDOR "MESA")
set(CPACK_RPM_PACKAGE_AUTOREQPROV "yes")
set(CPACK_RPM_PACKAGE_RELEASE_DIST "on")
-set(CPACK_RPM_DEBUGINFO_PACKAGE "on")
+# set(CPACK_RPM_DEBUGINFO_PACKAGE "on")
set(CPACK_RPM_COMPONENT_INSTALL ON)
set(CPACK_COMPONENTS_IGNORE_GROUPS 1)
diff --git a/src/fieldstat.c b/src/fieldstat.c
index 1b9eca2..f98fa91 100644
--- a/src/fieldstat.c
+++ b/src/fieldstat.c
@@ -10,6 +10,7 @@
#include "fieldstat.h"
#include "metrics/metric.h"
#include "tags/cell_manager.h"
+#include "MESA/MESA_handle_logger.h"
struct fs_cube {
enum sampling_mode sampling_mode;
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 9d72da0..baf87a7 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -42,7 +42,7 @@ SET(TEST_UTILS_SRC
function (add_unit_test file_name)
add_executable(${file_name} ${SRC} ${TEST_UTILS_SRC} ${file_name}.cpp)
- target_link_libraries(${file_name} gtest-static ${ZLIB_LIBRARIES} ${LFLAGS})
+ target_link_libraries(${file_name} gtest-static MESA_handle_logger ${ZLIB_LIBRARIES} ${LFLAGS})
set_property(TARGET ${file_name} PROPERTY CXX_STANDARD 17)
endfunction()