Skip to content

Commit

Permalink
build: slightly plolish some cmake scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
WhiredPlanck committed Oct 27, 2023
1 parent 3f75a2c commit 948f541
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
10 changes: 3 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ option(ENABLE_TIMESTAMP "Embed timestamp to schema artifacts" ON)
set(RIME_DATA_DIR "${CMAKE_INSTALL_FULL_DATADIR}/rime-data" CACHE STRING "Target directory for Rime data")
set(RIME_PLUGINS_DIR "${CMAKE_INSTALL_FULL_LIBDIR}/rime-plugins" CACHE STRING "Target directory for externally built Rime plugins")

if(WIN32)
set(ext ".exe")
endif(WIN32)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake")
set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} "${PROJECT_SOURCE_DIR}")

Expand Down Expand Up @@ -230,11 +226,11 @@ endif()
add_subdirectory(plugins)
message(STATUS "rime_plugins_libs: ${rime_plugins_deps}")
message(STATUS "rime_plugins_modules: ${rime_plugins_modules}")
set(list "")
foreach(mod ${rime_plugins_modules})
set(list "${list},Q(${mod})")
list(APPEND qmods "Q(${mod})")
endforeach()
add_definitions(-DRIME_EXTRA_MODULES=${list})
list(JOIN qmods "," extra_mods)
add_definitions(-DRIME_EXTRA_MODULES=${extra_mods})
if(BUILD_SHARED_LIBS AND BUILD_SEPARATE_LIBS AND rime_plugins_objs)
set(rime_plugins_library rime-plugins)
endif()
Expand Down
7 changes: 3 additions & 4 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,11 @@ else()
${rime_plugins_objs})
endif()

set(rime_optional_deps "")
if(Gflags_FOUND)
set(rime_optional_deps ${rime_optional_deps} ${Gflags_LIBRARY})
list(APPEND rime_optional_deps ${Gflags_LIBRARY})
endif()
if(ENABLE_EXTERNAL_PLUGINS)
set(rime_optional_deps ${rime_optional_deps} dl)
list(APPEND rime_optional_deps dl)
endif()

set(rime_core_deps
Expand All @@ -57,7 +56,7 @@ set(rime_levers_deps "")
if(MINGW)
# fix: bcrypt for boost uuid issue
# https://github.com/boostorg/uuid/issues/68
set(rime_core_deps ${rime_core_deps} wsock32 ws2_32 bcrypt)
list(APPEND rime_core_deps wsock32 ws2_32 bcrypt)
endif()

if(BUILD_SEPARATE_LIBS)
Expand Down
3 changes: 1 addition & 2 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,4 @@ endif(BUILD_SHARED_LIBS)
file(GLOB test_data_files ${PROJECT_SOURCE_DIR}/data/test/*.yaml)
file(COPY ${test_data_files} DESTINATION ${EXECUTABLE_OUTPUT_PATH})

set(rime_test_executable ${EXECUTABLE_OUTPUT_PATH}/rime_test${ext})
add_test(rime_test ${rime_test_executable})
add_test(rime_test rime_test)

0 comments on commit 948f541

Please sign in to comment.