Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 3.10)

project(QtOrm LANGUAGES CXX)

set(API_VERSION 1)

# https://stackoverflow.com/questions/25199677/how-to-detect-if-current-scope-has-a-parent-in-cmake
get_directory_property(hasParent PARENT_DIRECTORY)

Expand Down
13 changes: 12 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,19 @@ set(QTORM_SOURCES

set(BUILD_SHARED_LIBS ${QTORM_BUILD_SHARED_LIBS})

add_library(qtorm
add_library(qtorm SHARED
${QTORM_PUBLIC_HEADERS}
${QTORM_PRIVATE_HEADERS}
${QTORM_SOURCES}
${QTORM_GENERATED_HEADERS}
)

set_target_properties(
qtorm PROPERTIES
VERSION ${API_VERSION}.0.0
SOVERSION ${API_VERSION}
)

target_link_libraries(qtorm PUBLIC Qt${QTORM_QT_VERSION_MAJOR}::Core PRIVATE Qt${QTORM_QT_VERSION_MAJOR}::Sql)

target_compile_definitions(qtorm PRIVATE QT_BUILD_ORM_LIB)
Expand All @@ -98,3 +104,8 @@ target_compile_features(qtorm PUBLIC cxx_std_17)
if (MSVC)
target_compile_definitions(qtorm PRIVATE __PRETTY_FUNCTION__=__FUNCTION__)
endif()

install(
TARGETS qtorm
LIBRARY DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}
)
Loading