Index: CMakeLists.txt =================================================================== --- CMakeLists.txt +++ CMakeLists.txt @@ -17,16 +17,9 @@ option(BUILD_SHARED_LIBS "Build a shared module" ON) option(DESKTOP_ENABLED "Build and install The Desktop style" ON) -option(STATIC_LIBRARY "Build as a static library (deprecated, use BUILD_SHARED_LIBS instead)" OFF) option(BUILD_EXAMPLES "Build and install examples" OFF) option(DISABLE_DBUS "Build without D-Bus support" OFF) -if(NOT BUILD_SHARED_LIBS) - set(STATIC_LIBRARY 1) -elseif(STATIC_LIBRARY) - set(BUILD_SHARED_LIBS 0) -endif() - # Make CPack available to easy generate binary packages include(CPack) include(FeatureSummary) @@ -40,11 +33,11 @@ set(AUTOMOC_MOC_OPTIONS -Muri=org.kde.kirigami) set(CMAKE_INCLUDE_CURRENT_DIR ON) -if(STATIC_LIBRARY) +if(NOT BUILD_SHARED_LIBS) add_definitions(-DKIRIGAMI_BUILD_TYPE_STATIC) add_definitions(-DQT_PLUGIN) add_definitions(-DQT_STATICPLUGIN=1) -endif(STATIC_LIBRARY) +endif() ################# set KDE specific information ################# @@ -120,11 +113,11 @@ add_subdirectory(templates) endif() -if (BUILD_EXAMPLES AND NOT STATIC_LIBRARY) +if (BUILD_EXAMPLES AND BUILD_SHARED_LIBS) add_subdirectory(examples) endif() -if (BUILD_TESTING AND NOT STATIC_LIBRARY) +if (BUILD_TESTING AND BUILD_SHARED_LIBS) add_subdirectory(autotests) endif() Index: src/CMakeLists.txt =================================================================== --- src/CMakeLists.txt +++ src/CMakeLists.txt @@ -1,6 +1,6 @@ project(kirigami) -if (NOT STATIC_LIBRARY) +if (BUILD_SHARED_LIBS) ecm_create_qm_loader(kirigami_QM_LOADER libkirigami2plugin_qt) else() set(KIRIGAMI_STATIC_FILES @@ -30,7 +30,7 @@ add_subdirectory(libkirigami) -if(STATIC_LIBRARY) +if(NOT BUILD_SHARED_LIBS) # `rcc` is a bit dumb and isn't designed to use auto generated files, to # avoid poluting the source directory, use absolute paths set(kirigami_QML_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../) @@ -52,12 +52,12 @@ if (UNIX AND NOT ANDROID AND NOT(APPLE) AND NOT(DISABLE_DBUS)) qt5_add_dbus_interface(kirigami_SRCS libkirigami/org.kde.KWin.TabletModeManager.xml tabletmodemanager_interface) endif() -endif(STATIC_LIBRARY) +endif() add_library(kirigamiplugin ${kirigami_SRCS} ${RESOURCES}) -if(STATIC_LIBRARY) +if(NOT BUILD_SHARED_LIBS) SET_TARGET_PROPERTIES(kirigamiplugin PROPERTIES AUTOMOC_MOC_OPTIONS -Muri=org.kde.kirigami) if (UNIX AND NOT ANDROID AND NOT(APPLE) AND NOT(DISABLE_DBUS)) @@ -65,9 +65,9 @@ else() set(Kirigami_EXTRA_LIBS "") endif() -else(STATIC_LIBRARY) +else() set(Kirigami_EXTRA_LIBS KF5::Kirigami2) -endif(STATIC_LIBRARY) +endif() target_link_libraries(kirigamiplugin @@ -77,7 +77,7 @@ ${Kirigami_EXTRA_LIBS} Qt5::Qml Qt5::Quick Qt5::QuickControls2 ) -if (NOT STATIC_LIBRARY) +if (BUILD_SHARED_LIBS) add_custom_target(copy_to_bin ALL COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/bin/org/kde/kirigami.2/ @@ -103,6 +103,6 @@ install(FILES ${PRI_FILENAME} DESTINATION ${ECM_MKSPECS_INSTALL_DIR}) -endif(NOT STATIC_LIBRARY) +endif() install(TARGETS kirigamiplugin DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/kirigami.2)