Skip to content
Snippets Groups Projects
Commit 927a23d8 authored by Emmanuel Lepage Vallee's avatar Emmanuel Lepage Vallee
Browse files

build: Create targets for both dynamic and static libraries

Refs #69008
parent c8648dd4
No related branches found
No related tags found
No related merge requests found
......@@ -484,13 +484,13 @@ IF(NOT ${ENABLE_STATIC} MATCHES false)
ADD_LIBRARY( ringclient_static STATIC ${libringclient_LIB_SRCS} ${LIB_HEADER_MOC} )
QT5_USE_MODULES(ringclient_static Core)
TARGET_LINK_LIBRARIES( ringclient_static
-lpthread
${QT_QTDBUS_LIBRARY}
${QT_QTCORE_LIBRARY}
)
-lpthread
${QT_QTDBUS_LIBRARY}
${QT_QTCORE_LIBRARY}
)
SET_TARGET_PROPERTIES( ringclient_static
PROPERTIES VERSION ${GENERIC_LIB_VERSION}
)
PROPERTIES VERSION ${GENERIC_LIB_VERSION}
)
ENDIF()
QT5_USE_MODULES(ringclient Core)
......@@ -498,7 +498,7 @@ QT5_USE_MODULES(ringclient Core)
IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
QT5_USE_MODULES(ringclient DBus)
IF(NOT ${ENABLE_STATIC} MATCHES false)
QT5_USE_MODULES(ringclient_static DBus)
QT5_USE_MODULES(ringclient_static DBus)
ENDIF()
ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
......@@ -513,9 +513,9 @@ IF(${ENABLE_LIBWRAP} MATCHES true)
TARGET_LINK_LIBRARIES( ringclient
qtwrapper
${ring_BIN}
)
)
IF(NOT ${ENABLE_STATIC} MATCHES false)
TARGET_LINK_LIBRARIES( ringclient_static
TARGET_LINK_LIBRARIES( ringclient_static
qtwrapper
${ring_BIN})
ENDIF()
......@@ -525,7 +525,7 @@ IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
TARGET_LINK_LIBRARIES( ringclient
-lrt)
IF(NOT ${ENABLE_STATIC} MATCHES false)
TARGET_LINK_LIBRARIES( ringclient_static
TARGET_LINK_LIBRARIES( ringclient_static
-lrt)
ENDIF()
ENDIF()
......@@ -573,13 +573,16 @@ INSTALL( TARGETS ringclient
)
IF(NOT ${ENABLE_STATIC} MATCHES false)
INSTALL( TARGETS ringclient_static
ARCHIVE DESTINATION ${SANE_LIBRARY_PATH}
LIBRARY DESTINATION ${SANE_LIBRARY_PATH}
DESTINATION ${SANE_LIBRARY_PATH}
)
INSTALL( TARGETS ringclient_static
ARCHIVE DESTINATION ${SANE_LIBRARY_PATH}
LIBRARY DESTINATION ${SANE_LIBRARY_PATH}
DESTINATION ${SANE_LIBRARY_PATH}
)
ENDIF()
SET(LIB_INSTALL_DIR ${SANE_LIBRARY_PATH})
# Create a CMake config file
# TARGET_INCLUDE_DIRECTORIES(ringclient PUBLIC
......
......@@ -6,12 +6,28 @@ SET(LIB_RING_CLIENT_INCLUDE_DIR @INCLUDE_INSTALL_DIR@/libringclient)
STRING(REPLACE "${CMAKE_LIBRARY_ARCHITECTURE}" "" SANE_LIBRARY_PATH "${CMAKE_INSTALL_FULL_LIBDIR}" )
IF(DEFINED ${ENABLE_STATIC})
# First, always set the dynamic path
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".dylib;.so;.dll")
SET(LIB_RING_CLIENT_LIBRARY_NAME "ringclient")
FIND_LIBRARY(LIB_RING_CLIENT_LIBRARY_DYNAMIC NAMES ringclient
PATHS ${RING_BUILD_DIR}/.libs
PATHS @LIB_INSTALL_DIR@
PATHS ${CMAKE_INSTALL_PREFIX}/libexec )
#if ENABLE_STATIC is set, default to the static version
IF(DEFINED ${ENABLE_STATIC} OR ${ENABLE_STATIC} MATCHES true)
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".a;.la;.lib")
ELSE()
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".dylib;.so;.dll")
SET(LIB_RING_CLIENT_LIBRARY_NAME "ringclient_static")
FIND_LIBRARY(LIB_RING_CLIENT_LIBRARY_STATIC NAMES ringclient_static
PATHS ${RING_BUILD_DIR}/.libs
PATHS @LIB_INSTALL_DIR@
PATHS ${CMAKE_INSTALL_PREFIX}/libexec )
ENDIF()
FIND_LIBRARY(LIB_RING_CLIENT_LIBRARY NAMES ringclient
FIND_LIBRARY(LIB_RING_CLIENT_LIBRARY NAMES ${LIB_RING_CLIENT_LIBRARY_NAME}
PATHS ${RING_BUILD_DIR}/.libs
PATHS @LIB_INSTALL_DIR@
PATHS ${CMAKE_INSTALL_PREFIX}/libexec )
......@@ -630,8 +630,6 @@ void AccountModel::remove(Account* account)
d_ptr->m_lDeletedAccounts << account->id();
endRemoveRows();
emit accountRemoved(account);
emit dataChanged(index(aindex,0), index(d_ptr->m_lAccounts.size()-1,0));
emit layoutChanged();
//delete account;
d_ptr->m_pRemovedAccounts << account;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment