2017-09-18 14:59:53 +02:00
|
|
|
project( libcalamares CXX )
|
2014-06-04 16:35:26 +02:00
|
|
|
|
2017-09-17 12:48:07 +02:00
|
|
|
add_definitions(
|
|
|
|
${QT_DEFINITIONS}
|
|
|
|
-DQT_SHARED
|
|
|
|
-DQT_SHAREDPOINTER_TRACK_POINTERS
|
|
|
|
-DDLLEXPORT_PRO
|
|
|
|
)
|
2014-06-04 16:35:26 +02:00
|
|
|
|
2014-06-26 14:18:32 +02:00
|
|
|
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/CalamaresConfig.h.in
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/CalamaresConfig.h )
|
2014-06-04 18:19:05 +02:00
|
|
|
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
|
2016-09-25 03:20:50 +02:00
|
|
|
CppJob.cpp
|
2014-07-21 17:08:06 +02:00
|
|
|
GlobalStorage.cpp
|
2014-06-27 15:34:05 +02:00
|
|
|
Job.cpp
|
2014-06-04 16:35:26 +02:00
|
|
|
JobQueue.cpp
|
2014-07-10 12:08:43 +02:00
|
|
|
ProcessJob.cpp
|
2017-09-17 12:48:07 +02:00
|
|
|
)
|
2017-09-18 14:59:53 +02:00
|
|
|
set( utilsSources
|
2014-06-06 16:00:42 +02:00
|
|
|
utils/CalamaresUtils.cpp
|
2014-07-29 20:18:02 +02:00
|
|
|
utils/CalamaresUtilsSystem.cpp
|
2014-06-18 18:05:04 +02:00
|
|
|
utils/Logger.cpp
|
2016-09-25 03:20:50 +02:00
|
|
|
utils/PluginFactory.cpp
|
2014-11-11 12:42:37 +01:00
|
|
|
utils/Retranslator.cpp
|
2014-06-04 16:35:26 +02:00
|
|
|
)
|
2017-09-18 14:59:53 +02:00
|
|
|
set( kdsagSources
|
|
|
|
kdsingleapplicationguard/kdsingleapplicationguard.cpp
|
|
|
|
kdsingleapplicationguard/kdsharedmemorylocker.cpp
|
|
|
|
kdsingleapplicationguard/kdtoolsglobal.cpp
|
|
|
|
kdsingleapplicationguard/kdlockedsharedmemorypointer.cpp
|
2014-06-04 16:35:26 +02:00
|
|
|
)
|
2017-09-21 10:53:09 +02:00
|
|
|
mark_thirdparty_code( ${kdsagSources} )
|
2014-06-04 16:35:26 +02:00
|
|
|
|
2017-09-19 16:46:55 +02:00
|
|
|
include_directories(
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
)
|
2014-07-16 16:07:32 +02:00
|
|
|
|
|
|
|
if( WITH_PYTHON )
|
|
|
|
set( libSources
|
|
|
|
${libSources}
|
2014-07-18 14:27:59 +02:00
|
|
|
PythonHelper.cpp
|
2014-07-16 16:07:32 +02:00
|
|
|
PythonJob.cpp
|
2014-07-17 17:52:02 +02:00
|
|
|
PythonJobApi.cpp
|
2014-07-16 16:07:32 +02:00
|
|
|
)
|
2017-09-25 16:33:48 +02:00
|
|
|
set_source_files_properties( PythonJob.cpp
|
|
|
|
PROPERTIES COMPILE_FLAGS ${SUPPRESS_BOOST_WARNINGS}
|
|
|
|
)
|
2014-07-16 16:07:32 +02:00
|
|
|
|
|
|
|
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()
|
|
|
|
|
2016-10-02 19:14:56 +02:00
|
|
|
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()
|
|
|
|
|
2014-07-16 16:07:32 +02:00
|
|
|
|
2017-09-19 16:46:55 +02:00
|
|
|
add_library( calamares SHARED ${libSources} ${kdsagSources} ${utilsSources} )
|
2014-07-17 17:52:02 +02:00
|
|
|
set_target_properties( calamares
|
2014-06-04 18:19:05 +02:00
|
|
|
PROPERTIES
|
|
|
|
AUTOMOC TRUE
|
|
|
|
VERSION ${CALAMARES_VERSION_SHORT}
|
|
|
|
SOVERSION ${CALAMARES_VERSION_SHORT}
|
2014-06-04 16:35:26 +02:00
|
|
|
)
|
|
|
|
|
2014-07-17 17:52:02 +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
|
|
|
)
|
|
|
|
|
2014-07-17 17:52:02 +02:00
|
|
|
install( TARGETS calamares
|
2014-06-04 16:35:26 +02:00
|
|
|
EXPORT CalamaresLibraryDepends
|
|
|
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
|
|
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
|
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
|
|
)
|
|
|
|
|
2014-11-14 12:30:56 +01:00
|
|
|
# Make symlink lib/calamares/libcalamares.so to lib/libcalamares.so.VERSION so
|
|
|
|
# lib/calamares can be used as module path for the Python interpreter.
|
2014-07-17 19:41:08 +02:00
|
|
|
install( CODE "
|
|
|
|
file( MAKE_DIRECTORY \"\$ENV{DESTDIR}/${CMAKE_INSTALL_FULL_LIBDIR}/calamares\" )
|
2014-11-14 12:30:56 +01:00
|
|
|
execute_process( COMMAND \"${CMAKE_COMMAND}\" -E create_symlink ../libcalamares.so.${CALAMARES_VERSION_SHORT} libcalamares.so WORKING_DIRECTORY \"\$ENV{DESTDIR}/${CMAKE_INSTALL_FULL_LIBDIR}/calamares\" )
|
2014-07-17 19:41:08 +02:00
|
|
|
")
|
|
|
|
|
2014-06-04 16:35:26 +02:00
|
|
|
# Install header files
|
|
|
|
file( GLOB rootHeaders "*.h" )
|
2014-06-04 18:19:05 +02:00
|
|
|
file( GLOB kdsingleapplicationguardHeaders "kdsingleapplicationguard/*.h" )
|
2014-06-06 16:00:42 +02:00
|
|
|
file( GLOB utilsHeaders "utils/*.h" )
|
2014-06-04 16:35:26 +02:00
|
|
|
|
2014-06-26 14:18:32 +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 )
|
2014-06-04 18:19:05 +02:00
|
|
|
install( FILES ${kdsingleapplicationguardHeaders} DESTINATION include/libcalamares/kdsingleapplicationguard )
|
2014-06-06 16:00:42 +02:00
|
|
|
install( FILES ${utilsHeaders} DESTINATION include/libcalamares/utils )
|