calamares/src/libcalamares/CMakeLists.txt
2014-07-16 16:07:32 +02:00

94 lines
2.5 KiB
CMake

project( calamareslib )
add_definitions( ${QT_DEFINITIONS} )
add_definitions( -DQT_SHARED )
add_definitions( -DQT_SHAREDPOINTER_TRACK_POINTERS )
add_definitions( -DDLLEXPORT_PRO )
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 )
set( libSources
Job.cpp
JobQueue.cpp
ProcessJob.cpp
kdsingleapplicationguard/kdsingleapplicationguard.cpp
kdsingleapplicationguard/kdsharedmemorylocker.cpp
kdsingleapplicationguard/kdtoolsglobal.cpp
kdsingleapplicationguard/kdlockedsharedmemorypointer.cpp
utils/CalamaresUtils.cpp
utils/Logger.cpp
)
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
${QT_INCLUDE_DIR}
)
if( WITH_PYTHON )
set( libSources
${libSources}
PythonJob.cpp
PythonJobHelper.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( calamareslib SHARED ${libSources} )
set_target_properties( calamareslib
PROPERTIES
AUTOMOC TRUE
VERSION ${CALAMARES_VERSION_SHORT}
SOVERSION ${CALAMARES_VERSION_SHORT}
OUTPUT_NAME "calamares"
)
qt5_use_modules( calamareslib Core )
target_link_libraries( calamareslib
LINK_PRIVATE
# internal deps, if any
${OPTIONAL_PRIVATE_LIBRARIES}
LINK_PUBLIC
# External deps
Qt5::Core
)
install( TARGETS calamareslib
EXPORT CalamaresLibraryDepends
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
# Install header files
file( GLOB rootHeaders "*.h" )
file( GLOB kdsingleapplicationguardHeaders "kdsingleapplicationguard/*.h" )
file( GLOB utilsHeaders "utils/*.h" )
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/CalamaresConfig.h DESTINATION include/libcalamares )
install( FILES ${rootHeaders} DESTINATION include/libcalamares )
install( FILES ${kdsingleapplicationguardHeaders} DESTINATION include/libcalamares/kdsingleapplicationguard )
install( FILES ${utilsHeaders} DESTINATION include/libcalamares/utils )