CMake: massage build of libcalamares
- Build also two OBJECT libraries, - Allow changing Clang warnings for third-party code.
This commit is contained in:
parent
eede92646d
commit
4930484931
@ -1,4 +1,4 @@
|
|||||||
project( libcalamares )
|
project( libcalamares CXX )
|
||||||
|
|
||||||
add_definitions(
|
add_definitions(
|
||||||
${QT_DEFINITIONS}
|
${QT_DEFINITIONS}
|
||||||
@ -19,24 +19,40 @@ set( libSources
|
|||||||
JobQueue.cpp
|
JobQueue.cpp
|
||||||
ProcessJob.cpp
|
ProcessJob.cpp
|
||||||
)
|
)
|
||||||
set( kdsagSources
|
|
||||||
kdsingleapplicationguard/kdsingleapplicationguard.cpp
|
include_directories(
|
||||||
kdsingleapplicationguard/kdsharedmemorylocker.cpp
|
${CMAKE_CURRENT_BINARY_DIR}
|
||||||
kdsingleapplicationguard/kdtoolsglobal.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
kdsingleapplicationguard/kdlockedsharedmemorypointer.cpp
|
|
||||||
)
|
)
|
||||||
set( utilSources
|
|
||||||
|
# Build subdirs as their own separate OBJECT libraries,
|
||||||
|
# to allow changing compiler warnings on their code.
|
||||||
|
set( utilsSources
|
||||||
utils/CalamaresUtils.cpp
|
utils/CalamaresUtils.cpp
|
||||||
utils/CalamaresUtilsSystem.cpp
|
utils/CalamaresUtilsSystem.cpp
|
||||||
utils/Logger.cpp
|
utils/Logger.cpp
|
||||||
utils/PluginFactory.cpp
|
utils/PluginFactory.cpp
|
||||||
utils/Retranslator.cpp
|
utils/Retranslator.cpp
|
||||||
)
|
)
|
||||||
|
add_library( utilsLib OBJECT ${utilsSources} )
|
||||||
include_directories(
|
target_compile_options( utilsLib PUBLIC -fPIC )
|
||||||
${CMAKE_CURRENT_BINARY_DIR}
|
target_include_directories( utilsLib PUBLIC
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}
|
$<TARGET_PROPERTY:Qt5::Core,INTERFACE_INCLUDE_DIRECTORIES>
|
||||||
)
|
)
|
||||||
|
set_target_properties( utilsLib PROPERTIES AUTOMOC TRUE )
|
||||||
|
|
||||||
|
set( kdsagSources
|
||||||
|
kdsingleapplicationguard/kdsingleapplicationguard.cpp
|
||||||
|
kdsingleapplicationguard/kdsharedmemorylocker.cpp
|
||||||
|
kdsingleapplicationguard/kdtoolsglobal.cpp
|
||||||
|
kdsingleapplicationguard/kdlockedsharedmemorypointer.cpp
|
||||||
|
)
|
||||||
|
add_library( kdsagLib OBJECT ${kdsagSources} )
|
||||||
|
target_compile_options( kdsagLib PUBLIC -fPIC )
|
||||||
|
target_include_directories( kdsagLib PUBLIC
|
||||||
|
$<TARGET_PROPERTY:Qt5::Core,INTERFACE_INCLUDE_DIRECTORIES>
|
||||||
|
)
|
||||||
|
set_target_properties( kdsagLib PROPERTIES AUTOMOC TRUE )
|
||||||
|
|
||||||
|
|
||||||
if( WITH_PYTHON )
|
if( WITH_PYTHON )
|
||||||
@ -75,7 +91,10 @@ if( WITH_PYTHONQT )
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
add_library( calamares SHARED ${libSources} ${kdsagSources} ${utilSources} )
|
add_library( calamares SHARED ${libSources}
|
||||||
|
$<TARGET_OBJECTS:kdsagLib>
|
||||||
|
$<TARGET_OBJECTS:utilsLib>
|
||||||
|
)
|
||||||
set_target_properties( calamares
|
set_target_properties( calamares
|
||||||
PROPERTIES
|
PROPERTIES
|
||||||
AUTOMOC TRUE
|
AUTOMOC TRUE
|
||||||
|
Loading…
Reference in New Issue
Block a user