Clean up CMakeLists, linking

This commit is contained in:
Adriaan de Groot 2017-09-13 18:29:56 +02:00
parent 90fc268cc4
commit 03d9dbe099
4 changed files with 10 additions and 20 deletions

View File

@ -192,10 +192,6 @@ set( THIRDPARTY_DIR "${CMAKE_SOURCE_DIR}/thirdparty" )
# make example-distro
#
find_program( mksquashfs_PROGRAM mksquashfs )
set_package_properties( mksquashfs PROPERTIES
DESCRIPTION "Create example distro"
URL "http://tldp.org/HOWTO/SquashFS-HOWTO/creatingandusing.html"
)
if( mksquashfs_PROGRAM )
set( mksquashfs_FOUND ON )
set( src_fs ${CMAKE_SOURCE_DIR}/data/example-root/ )

View File

@ -45,9 +45,6 @@ function(calamares_add_library)
add_library(${target} SHARED ${LIBRARY_SOURCES})
endif()
# HACK: add qt modules - every lib should define its own set of modules
qt5_use_modules(${target} Core Gui Widgets ${LIBRARY_QT5_MODULES})
# definitions - can this be moved into set_target_properties below?
add_definitions(${QT_DEFINITIONS})
set_target_properties(${target} PROPERTIES AUTOMOC TRUE)
@ -67,9 +64,15 @@ function(calamares_add_library)
endif()
# add link targets
target_link_libraries(${target} ${CALAMARES_LIBRARIES})
target_link_libraries(${target}
LINK_PUBLIC ${CALAMARES_LIBRARIES}
Qt5::Core
Qt5::Gui
Qt5::Widgets
${LIBRARY_QT5_MODULES}
)
if(LIBRARY_LINK_LIBRARIES)
target_link_libraries(${target} ${LIBRARY_LINK_LIBRARIES})
target_link_libraries(${target} LINK_PUBLIC ${LIBRARY_LINK_LIBRARIES})
endif()
if(LIBRARY_LINK_PRIVATE_LIBRARIES)
target_link_libraries(${target} LINK_PRIVATE ${LIBRARY_LINK_PRIVATE_LIBRARIES})

View File

@ -55,7 +55,6 @@ if( WITH_CRASHREPORTER )
list( APPEND LINK_LIBRARIES ${LINK_LIBRARIES} pthread crashreporter-handler )
endif()
qt5_use_modules( calamares_bin Core Widgets )
target_link_libraries( calamares_bin
PRIVATE
${CALAMARES_LIBRARIES}

View File

@ -81,17 +81,9 @@ set_target_properties( calamares
SOVERSION ${CALAMARES_VERSION_SHORT}
)
qt5_use_modules( calamares Core )
target_link_libraries( calamares
LINK_PRIVATE
# internal deps, if any
${OPTIONAL_PRIVATE_LIBRARIES}
LINK_PUBLIC
# External deps
Qt5::Core
LINK_PRIVATE ${OPTIONAL_PRIVATE_LIBRARIES}
LINK_PUBLIC Qt5::Core
)
install( TARGETS calamares