Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
CMAKE_MINIMUM_REQUIRED (VERSION 3.10)
PROJECT(CPPJIEBA)

INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/deps/limonp/include
find_package(limonp)
Copy link

Copilot AI Jul 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider specifying QUIET to suppress warnings when the package is not found, since you have a fallback mechanism: find_package(limonp QUIET)

Suggested change
find_package(limonp)
find_package(limonp QUIET)

Copilot uses AI. Check for mistakes.
if(limonp_FOUND)
get_target_property(LIMONP_INCLUDE_DIR limonp::limonp INTERFACE_INCLUDE_DIRECTORIES)
else()
set(LIMONP_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/deps/limonp/include")
endif()
INCLUDE_DIRECTORIES("${LIMONP_INCLUDE_DIR}"
${PROJECT_SOURCE_DIR}/include)
Comment on lines +4 to 11
Copy link

Copilot AI Jul 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The get_target_property call may fail if the target doesn't have INTERFACE_INCLUDE_DIRECTORIES set, which would set LIMONP_INCLUDE_DIR to 'NOTFOUND'. Consider checking the result or using target_link_libraries instead of manually extracting include directories.

Suggested change
find_package(limonp)
if(limonp_FOUND)
get_target_property(LIMONP_INCLUDE_DIR limonp::limonp INTERFACE_INCLUDE_DIRECTORIES)
else()
set(LIMONP_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/deps/limonp/include")
endif()
INCLUDE_DIRECTORIES("${LIMONP_INCLUDE_DIR}"
${PROJECT_SOURCE_DIR}/include)
find_package(limonp REQUIRED)
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/include)
if(NOT TARGET cppjieba)
add_library(cppjieba INTERFACE)
target_include_directories(cppjieba INTERFACE
${PROJECT_SOURCE_DIR}/include
)
target_link_libraries(cppjieba INTERFACE limonp::limonp)
endif()

Copilot uses AI. Check for mistakes.

if(NOT DEFINED CMAKE_CXX_STANDARD)
Expand Down
Loading