@@ -3,6 +3,8 @@ project(libCacheSim)
33set (DESCRIPTION "a high performance cache simulation library" )
44set (PROJECT_WEB "http://cachesim.com" )
55
6+ find_package (PkgConfig REQUIRED )
7+
68set (${PROJECT_NAME} _VERSION_MAJOR 0)
79set (${PROJECT_NAME} _VERSION_MINOR 1)
810set (${PROJECT_NAME} _VERSION_PATCH 0)
@@ -39,7 +41,6 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
3941 add_definitions (-DOS_DARWIN )
4042 set (CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "/opt/homebrew/include/" )
4143 set (CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} "/opt/homebrew/" )
42-
4344elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux" )
4445 add_definitions (-DOS_LINUX )
4546else ()
@@ -142,7 +143,7 @@ set(LIBS ${LIBS} ${ARGP_LIBRARY})
142143
143144if (OPT_SUPPORT_ZSTD_TRACE)
144145 add_compile_definitions (SUPPORT_ZSTD_TRACE=1 )
145- find_package (ZSTD )
146+ pkg_check_modules (ZSTD REQUIRED libzstd )
146147
147148 # https://stackoverflow.com/questions/61377055/cannot-find-gflags-gflags-h-while-building-library-osx/61379123#61379123
148149 include_directories (${ZSTD_INCLUDE_DIR} )
@@ -151,6 +152,7 @@ if(OPT_SUPPORT_ZSTD_TRACE)
151152 message (FATAL_ERROR "zstd not found" )
152153 endif ()
153154
155+ link_directories (${ZSTD_LIBRARY_DIRS} )
154156 link_libraries (${ZSTD_LIBRARIES} )
155157 message (STATUS "ZSTD_INCLUDE_DIR ${ZSTD_INCLUDE_DIR} , ZSTD_LIBRARIES ${ZSTD_LIBRARIES} " )
156158else ()
0 commit comments