calamares/src/libcalamares/CMakeLists.txt

103 lines
3.0 KiB
CMake
Raw Normal View History

project( libcalamares )
2014-06-04 16:35:26 +02:00
add_definitions( ${QT_DEFINITIONS} )
add_definitions( -DQT_SHARED )
add_definitions( -DQT_SHAREDPOINTER_TRACK_POINTERS )
2014-06-18 18:42:01 +02:00
add_definitions( -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
GlobalStorage.cpp
2014-06-27 15:34:05 +02:00
Job.cpp
2014-06-04 16:35:26 +02:00
JobQueue.cpp
ProcessJob.cpp
kdsingleapplicationguard/kdsingleapplicationguard.cpp
kdsingleapplicationguard/kdsharedmemorylocker.cpp
kdsingleapplicationguard/kdtoolsglobal.cpp
kdsingleapplicationguard/kdlockedsharedmemorypointer.cpp
utils/CalamaresUtils.cpp
utils/CalamaresUtilsSystem.cpp
utils/Logger.cpp
2014-06-04 16:35:26 +02:00
)
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
${QT_INCLUDE_DIR}
)
if( WITH_PYTHON )
set( libSources
${libSources}
PythonHelper.cpp
PythonJob.cpp
PythonJobApi.cpp
)
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()
add_library( calamares SHARED ${libSources} )
set_target_properties( calamares
PROPERTIES
AUTOMOC TRUE
VERSION ${CALAMARES_VERSION_SHORT}
SOVERSION ${CALAMARES_VERSION_SHORT}
2014-06-04 16:35:26 +02:00
)
qt5_use_modules( calamares Core )
2014-06-04 16:35:26 +02:00
target_link_libraries( calamares
LINK_PRIVATE
2014-06-04 16:35:26 +02:00
# internal deps, if any
${OPTIONAL_PRIVATE_LIBRARIES}
2014-06-04 16:35:26 +02:00
LINK_PUBLIC
# External deps
2014-06-17 14:59:49 +02:00
Qt5::Core
2014-06-04 16:35:26 +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}
)
# Make symlink lib/calamares/libcalamares.so to lib/libcalamares.so so lib/calamares
# can be used as module path for the Python interpreter.
install( CODE "
file( MAKE_DIRECTORY \"\$ENV{DESTDIR}/${CMAKE_INSTALL_FULL_LIBDIR}/calamares\" )
execute_process( COMMAND \"${CMAKE_COMMAND}\" -E create_symlink ../libcalamares.so libcalamares.so WORKING_DIRECTORY \"\$ENV{DESTDIR}/${CMAKE_INSTALL_FULL_LIBDIR}/calamares\" )
")
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 )