summaryrefslogtreecommitdiff
path: root/hangul
diff options
context:
space:
mode:
authorChoe Hwanjin <choe.hwanjin@gmail.com>2021-10-12 16:15:14 +0900
committerChoe Hwanjin <choe.hwanjin@gmail.com>2021-10-12 16:15:14 +0900
commit49cd5a2694ee70fcaac95fec8d4ad592047f9c07 (patch)
tree1e567bd36d82e25982cc2f52824a050c9907b710 /hangul
parentdab127b85d1b4c88a1a729b1cd6f9000ab25eb77 (diff)
downloadlibhangul-49cd5a2694ee70fcaac95fec8d4ad592047f9c07.tar.gz
cmake: Add BUILD_SHARED_LIBS option
사용자가 Shared와 Static 빌드를 선택할 수 있게 BUILD_SHARED_LIBS 옵션을 추가한다. ENABLE_EXTERNAL_KEYBOARDS 옵션이 ON 일때에만 expat을 찾아도 되므로 조건 처리한다. 추가로 find_package()를 사용한다. 패키지를 찾을 때에는 include()보다 나을 것 같다.
Diffstat (limited to 'hangul')
-rw-r--r--hangul/CMakeLists.txt13
1 files changed, 5 insertions, 8 deletions
diff --git a/hangul/CMakeLists.txt b/hangul/CMakeLists.txt
index aa6e27e..93f7fb4 100644
--- a/hangul/CMakeLists.txt
+++ b/hangul/CMakeLists.txt
@@ -17,14 +17,11 @@
cmake_minimum_required(VERSION 3.0)
-include(FindPkgConfig)
-include(FindEXPAT)
include(GNUInstallDirs)
-option(ENABLE_EXTERNAL_KEYBOARDS
- "enable external keyboard xml file loading feature"
- ON
-)
+if(ENABLE_EXTERNAL_KEYBOARDS)
+ find_package(EXPAT)
+endif()
set(hangul_PUBLIC_HEADERS
hangul.h
@@ -37,7 +34,7 @@ set(hangul_PRIVATE_HEADERS
hanjacompatible.h
)
-add_library(hangul SHARED
+add_library(hangul
${hangul_PUBLIC_HEADERS}
${hangul_PRIVATE_HEADERS}
hangulctype.c
@@ -53,7 +50,7 @@ target_compile_definitions(hangul
PRIVATE -DTOP_SRCDIR=\"${CMAKE_SOURCE_DIR}\"
)
-if (ENABLE_EXTERNAL_KEYBOARDS)
+if(ENABLE_EXTERNAL_KEYBOARDS)
target_compile_definitions(hangul
PRIVATE -DENABLE_EXTERNAL_KEYBOARDS=1
)