diff options
author | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2021-06-06 13:00:48 +0800 |
---|---|---|
committer | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2021-06-06 13:00:48 +0800 |
commit | 982495a8ee6932f4a1586faf0c853ebaf951000f (patch) | |
tree | c943e67fb684f4d0de3599df75990ecfa8821e5c /CMakeLists.txt | |
parent | 582049b456871926ef4576c3ba5e1aa67da9a3a4 (diff) |
Add support for Emscripten
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 123a895..852c035 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,17 +1,19 @@ cmake_minimum_required(VERSION 3.5) - project(qicclient) - set(CMAKE_AUTOMOC ON) - find_package(Qt5Core) -add_library(${PROJECT_NAME} SHARED +set(HDRS + ${PROJECT_NAME}/product.hxx ${PROJECT_NAME}/catalog.hxx ${PROJECT_NAME}/ord.hxx ${PROJECT_NAME}/member.hxx ${PROJECT_NAME}/admin.hxx ${PROJECT_NAME}/client.hxx + ) + +set(SRCS + ${HDRS} catalog.cxx ord.cxx member.cxx @@ -19,20 +21,17 @@ add_library(${PROJECT_NAME} SHARED client.cxx ) +if (EMSCRIPTEN OR IOS) + add_library(${PROJECT_NAME} STATIC ${SRCS}) +else() + add_library(${PROJECT_NAME} SHARED ${SRCS}) +endif() + target_link_libraries(${PROJECT_NAME} Qt5::Core icclient ) target_compile_definitions(${PROJECT_NAME} PRIVATE QICCLIENT) - install(TARGETS ${PROJECT_NAME} DESTINATION lib) -install(FILES - ${PROJECT_NAME}/product.hxx - ${PROJECT_NAME}/catalog.hxx - ${PROJECT_NAME}/ord.hxx - ${PROJECT_NAME}/member.hxx - ${PROJECT_NAME}/admin.hxx - ${PROJECT_NAME}/client.hxx - DESTINATION include/${PROJECT_NAME} - ) +install(FILES ${HDRS} DESTINATION include/${PROJECT_NAME}) |