Skip to content

Commit d1d8820

Browse files
committed
Align style of pybind CMakeLists.txt
1 parent 863e142 commit d1d8820

2 files changed

Lines changed: 16 additions & 9 deletions

File tree

libCacheSim-python/CMakeLists.txt

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,15 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
1212

1313
option(ENABLE_LRB "enable LRB" OFF)
1414
option(ENABLE_3L_CACHE "enable 3LCache" OFF)
15+
set(LOG_LEVEL DEBUG CACHE STRING "change the logging level")
16+
set_property(CACHE LOG_LEVEL PROPERTY STRINGS INFO WARN ERROR DEBUG VERBOSE VVERBOSE VVVERBOSE)
1517

16-
project(
17-
${SKBUILD_PROJECT_NAME}
18-
VERSION ${SKBUILD_PROJECT_VERSION}
19-
LANGUAGES C CXX)
18+
project(libCacheSimPython LANGUAGES C CXX)
2019

2120
# use customized cmake module
2221
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/../cmake/Modules/")
2322

2423
# set the logging level to DEBUG by default
25-
set(LOG_LEVEL DEBUG CACHE STRING "change the logging level")
26-
2724
string(TOLOWER "${LOG_LEVEL}" LOG_LEVEL_LOWER)
2825

2926
if(LOG_LEVEL_LOWER STREQUAL "vvverbose")
@@ -40,7 +37,6 @@ elseif(LOG_LEVEL_LOWER STREQUAL "warn")
4037
add_compile_definitions(LOGLEVEL=8)
4138
elseif(LOG_LEVEL_LOWER STREQUAL "error")
4239
add_compile_definitions(LOGLEVEL=9)
43-
4440
# default none is info
4541
elseif(LOG_LEVEL_LOWER STREQUAL "none")
4642
add_compile_definitions(LOGLEVEL=7)
@@ -58,11 +54,16 @@ find_package(PkgConfig REQUIRED)
5854
pkg_check_modules(GLIB2 REQUIRED glib-2.0)
5955

6056
# ------------------------------------------------------------
61-
include_directories(
57+
set(libCacheSim_include_dir
6258
${CMAKE_CURRENT_SOURCE_DIR}/../libCacheSim/include
63-
${GLIB2_INCLUDE_DIRS}
59+
${CMAKE_CURRENT_SOURCE_DIR}/../libCacheSim/dataStructure
60+
${CMAKE_CURRENT_SOURCE_DIR}/../libCacheSim/utils/include
61+
${CMAKE_CURRENT_SOURCE_DIR}/../libCacheSim
6462
)
6563

64+
include_directories(${libCacheSim_include_dir})
65+
include_directories(${GLIB2_INCLUDE_DIRS})
66+
6667
file(GLOB UTILS_SOURCES
6768
"${CMAKE_CURRENT_SOURCE_DIR}/../libCacheSim/utils/*.c"
6869
)

libCacheSim-python/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ pip install .
1414
pip install -e .
1515
```
1616

17+
Test
18+
19+
```
20+
python -m pytest .
21+
```
22+
1723
## Usage
1824

1925
```python

0 commit comments

Comments
 (0)