refactor: reformat build configs
This commit is contained in:
parent
8cd4441a44
commit
6bde62db4a
@ -30,14 +30,17 @@ set(CMAKE_USER_MAKE_RULES_OVERRIDE "${CMAKE_SOURCE_DIR}/cmake/FlagsOverrides.cma
|
|||||||
|
|
||||||
# define project
|
# define project
|
||||||
project(GpgFrontendModules
|
project(GpgFrontendModules
|
||||||
VERSION 2.1.3
|
VERSION 2.1.3
|
||||||
DESCRIPTION "Modules of GpgFrontend"
|
DESCRIPTION "Modules of GpgFrontend"
|
||||||
HOMEPAGE_URL "https://gpgfrontend.bktus.com"
|
HOMEPAGE_URL "https://gpgfrontend.bktus.com"
|
||||||
LANGUAGES CXX)
|
LANGUAGES CXX)
|
||||||
|
|
||||||
# includes
|
# includes
|
||||||
include(GenerateExportHeader)
|
include(GenerateExportHeader)
|
||||||
|
|
||||||
|
# function or mode options
|
||||||
|
option(GPGFRONTEND_QT5_BUILD "Swith to Qt5 building mode" OFF)
|
||||||
|
|
||||||
# Using Standard C++-17 (Consider compatibility)
|
# Using Standard C++-17 (Consider compatibility)
|
||||||
set(CMAKE_CXX_STANDARD 17)
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
@ -61,24 +64,24 @@ set(SDK_LIB_PATH "${SDK_PATH}/lib")
|
|||||||
message(STATUS "SDK Path: ${SDK_PATH}")
|
message(STATUS "SDK Path: ${SDK_PATH}")
|
||||||
|
|
||||||
include_directories(
|
include_directories(
|
||||||
${CMAKE_SOURCE_DIR}/include
|
${CMAKE_SOURCE_DIR}/include
|
||||||
${SDK_INCLUDE_PATH}
|
${SDK_INCLUDE_PATH}
|
||||||
)
|
)
|
||||||
|
|
||||||
link_directories(
|
link_directories(
|
||||||
${SDK_LIB_PATH}
|
${SDK_LIB_PATH}
|
||||||
)
|
)
|
||||||
|
|
||||||
# Introduce Qt
|
# Introduce Qt
|
||||||
# Support Qt version: 6.x
|
# Support Qt version: 6.x
|
||||||
if(GPGFRONTEND_QT5_BUILD)
|
if(GPGFRONTEND_QT5_BUILD)
|
||||||
# Introduce Qt
|
# Introduce Qt
|
||||||
# Support Qt version: 5.15.x
|
# Support Qt version: 5.15.x
|
||||||
find_package(Qt5 5.15 COMPONENTS Core Widgets Network LinguistTools REQUIRED)
|
find_package(Qt5 5.15 COMPONENTS Core Widgets Network LinguistTools REQUIRED)
|
||||||
else()
|
else()
|
||||||
# Introduce Qt
|
# Introduce Qt
|
||||||
# Support Qt version: 6.x
|
# Support Qt version: 6.x
|
||||||
find_package(Qt6 6 COMPONENTS Core Widgets Network LinguistTools REQUIRED)
|
find_package(Qt6 6 COMPONENTS Core Widgets Network LinguistTools REQUIRED)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Qt configuration
|
# Qt configuration
|
||||||
@ -89,24 +92,24 @@ set(CMAKE_AUTORCC_OPTIONS "--compress;9")
|
|||||||
|
|
||||||
# rpath config
|
# rpath config
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
message(STATUS "Configuring for Windows without rpath")
|
message(STATUS "Configuring for Windows without rpath")
|
||||||
elseif(APPLE)
|
elseif(APPLE)
|
||||||
set(CMAKE_MACOSX_RPATH 1)
|
set(CMAKE_MACOSX_RPATH 1)
|
||||||
set(CMAKE_INSTALL_RPATH "@loader_path/../lib")
|
set(CMAKE_INSTALL_RPATH "@loader_path/../lib")
|
||||||
|
|
||||||
include_directories(
|
include_directories(
|
||||||
/usr/local/include
|
/usr/local/include
|
||||||
/opt/homebrew/include
|
/opt/homebrew/include
|
||||||
)
|
)
|
||||||
|
|
||||||
link_directories(
|
link_directories(
|
||||||
/usr/local/lib
|
/usr/local/lib
|
||||||
/opt/homebrew/lib
|
/opt/homebrew/lib
|
||||||
)
|
)
|
||||||
else()
|
else()
|
||||||
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||||
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
|
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
|
||||||
set(CMAKE_INSTALL_RPATH "$ORIGIN:$ORIGIN/../lib")
|
set(CMAKE_INSTALL_RPATH "$ORIGIN:$ORIGIN/../lib")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# third_party
|
# third_party
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
# modules
|
# modules
|
||||||
|
|
||||||
add_subdirectory(m_ver_check)
|
add_subdirectory(m_ver_check)
|
||||||
add_subdirectory(m_gpg_info)
|
add_subdirectory(m_gpg_info)
|
||||||
add_subdirectory(m_pinentry)
|
add_subdirectory(m_pinentry)
|
||||||
|
@ -31,7 +31,7 @@ aux_source_directory(. INTEGRATED_MODULE_SOURCE)
|
|||||||
add_library(mod_paper_key SHARED ${INTEGRATED_MODULE_SOURCE})
|
add_library(mod_paper_key SHARED ${INTEGRATED_MODULE_SOURCE})
|
||||||
|
|
||||||
# install dir
|
# install dir
|
||||||
install(TARGETS mod_paper_key
|
install(TARGETS mod_paper_key
|
||||||
LIBRARY DESTINATION "${CMAKE_INSTALL_PREFIX}/modules")
|
LIBRARY DESTINATION "${CMAKE_INSTALL_PREFIX}/modules")
|
||||||
|
|
||||||
# link sdk
|
# link sdk
|
||||||
|
@ -27,7 +27,8 @@ aux_source_directory(. INTEGRATED_MODULE_SOURCE)
|
|||||||
|
|
||||||
# capslock
|
# capslock
|
||||||
list(APPEND INTEGRATED_MODULE_SOURCE "capslock/capslock.cpp")
|
list(APPEND INTEGRATED_MODULE_SOURCE "capslock/capslock.cpp")
|
||||||
if (MINGW)
|
|
||||||
|
if(MINGW)
|
||||||
list(APPEND INTEGRATED_MODULE_SOURCE "capslock/capslock_win.cpp")
|
list(APPEND INTEGRATED_MODULE_SOURCE "capslock/capslock_win.cpp")
|
||||||
else()
|
else()
|
||||||
list(APPEND INTEGRATED_MODULE_SOURCE "capslock/capslock_unix.cpp")
|
list(APPEND INTEGRATED_MODULE_SOURCE "capslock/capslock_unix.cpp")
|
||||||
@ -39,10 +40,9 @@ list(APPEND INTEGRATED_MODULE_SOURCE "pinentry.qrc")
|
|||||||
add_library(mod_pinentry SHARED ${INTEGRATED_MODULE_SOURCE})
|
add_library(mod_pinentry SHARED ${INTEGRATED_MODULE_SOURCE})
|
||||||
|
|
||||||
# install dir
|
# install dir
|
||||||
install(TARGETS mod_pinentry
|
install(TARGETS mod_pinentry
|
||||||
LIBRARY DESTINATION "${CMAKE_INSTALL_PREFIX}/modules")
|
LIBRARY DESTINATION "${CMAKE_INSTALL_PREFIX}/modules")
|
||||||
|
|
||||||
|
|
||||||
# link options
|
# link options
|
||||||
|
|
||||||
# link sdk
|
# link sdk
|
||||||
@ -57,7 +57,5 @@ else()
|
|||||||
target_link_libraries(mod_pinentry PUBLIC Qt6::Widgets)
|
target_link_libraries(mod_pinentry PUBLIC Qt6::Widgets)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
# using std c++ 17
|
# using std c++ 17
|
||||||
target_compile_features(mod_pinentry PUBLIC cxx_std_17)
|
target_compile_features(mod_pinentry PUBLIC cxx_std_17)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user