calamares/src/libcalamares/CMakeLists.txt

108 lines
2.9 KiB
CMake
Raw Normal View History

project( libcalamares CXX )
2014-06-04 16:35:26 +02:00
add_definitions(
${QT_DEFINITIONS}
-DQT_SHARED
-DQT_SHAREDPOINTER_TRACK_POINTERS
-DDLLEXPORT_PRO
)
2014-06-04 16:35:26 +02:00
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/CalamaresConfig.h.in
${CMAKE_CURRENT_BINARY_DIR}/CalamaresConfig.h )
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/../calamares/CalamaresVersion.h.in
${CMAKE_CURRENT_BINARY_DIR}/CalamaresVersion.h )
2014-06-04 16:35:26 +02:00
set( libSources
CppJob.cpp
GlobalStorage.cpp
2014-06-27 15:34:05 +02:00
Job.cpp
2014-06-04 16:35:26 +02:00
JobQueue.cpp
ProcessJob.cpp
)
set( utilsSources
utils/CalamaresUtils.cpp
utils/CalamaresUtilsSystem.cpp
utils/CommandList.cpp
utils/Logger.cpp
utils/PluginFactory.cpp
utils/Retranslator.cpp
2014-06-04 16:35:26 +02:00
)
set( kdsagSources
kdsingleapplicationguard/kdsingleapplicationguard.cpp
kdsingleapplicationguard/kdsharedmemorylocker.cpp
kdsingleapplicationguard/kdtoolsglobal.cpp
kdsingleapplicationguard/kdlockedsharedmemorypointer.cpp
2014-06-04 16:35:26 +02:00
)
mark_thirdparty_code( ${kdsagSources} )
2014-06-04 16:35:26 +02:00
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
)
if( WITH_PYTHON )
set( libSources
${libSources}
PythonHelper.cpp
PythonJob.cpp
PythonJobApi.cpp
)
set_source_files_properties( PythonJob.cpp
PROPERTIES COMPILE_FLAGS "${SUPPRESS_BOOST_WARNINGS}"
)
include_directories(${PYTHON_INCLUDE_DIRS})
link_directories(${PYTHON_LIBRARIES})
include_directories(${Boost_INCLUDE_DIRS})
link_directories(${Boost_LIBRARY_DIRS})
set( OPTIONAL_PRIVATE_LIBRARIES
${OPTIONAL_PRIVATE_LIBRARIES}
${PYTHON_LIBRARIES}
${Boost_LIBRARIES}
)
endif()
if( WITH_PYTHONQT )
include_directories(${PYTHON_INCLUDE_DIRS})
link_directories(${PYTHON_LIBRARIES})
include_directories(${PYTHONQT_INCLUDE_DIR})
link_directories(${PYTHONQT_LIBRARY})
set( OPTIONAL_PRIVATE_LIBRARIES
${OPTIONAL_PRIVATE_LIBRARIES}
${PYTHON_LIBRARIES}
${PYTHONQT_LIBRARY}
)
endif()
add_library( calamares SHARED ${libSources} ${kdsagSources} ${utilsSources} )
set_target_properties( calamares
PROPERTIES
AUTOMOC TRUE
2014-06-04 16:35:26 +02:00
)
target_link_libraries( calamares
2017-09-13 18:29:56 +02:00
LINK_PRIVATE ${OPTIONAL_PRIVATE_LIBRARIES}
LINK_PUBLIC Qt5::Core
2014-06-04 16:35:26 +02:00
)
install( TARGETS calamares
2014-06-04 16:35:26 +02:00
EXPORT CalamaresLibraryDepends
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
2014-06-04 16:35:26 +02:00
)
# Install header files
file( GLOB rootHeaders "*.h" )
file( GLOB kdsingleapplicationguardHeaders "kdsingleapplicationguard/*.h" )
file( GLOB utilsHeaders "utils/*.h" )
2014-06-04 16:35:26 +02:00
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/CalamaresConfig.h DESTINATION include/libcalamares )
2014-06-04 16:35:26 +02:00
install( FILES ${rootHeaders} DESTINATION include/libcalamares )
install( FILES ${kdsingleapplicationguardHeaders} DESTINATION include/libcalamares/kdsingleapplicationguard )
install( FILES ${utilsHeaders} DESTINATION include/libcalamares/utils )