Comments (9)
I was successful to build using FetchContent, but I have discovered another bug.
For now, remove
find_package
and disableTOM
.Something like this:
FetchContent_Declare(TinyOrm GIT_REPOSITORY https://github.com/silverqx/TinyORM.git GIT_TAG origin/main ) set(TOM OFF) FetchContent_MakeAvailable(TinyOrm) ... target_link_libraries(${PROJECT_NAME} PRIVATE Qt${QT_VERSION_MAJOR}::Core TinyOrm::TinyOrm )
That are good news though grin, that bug looks simply fixable, I look at it later.
This worked for me, thanks very much.
from tinyorm.
The problem obviously is with the FetchContent_Declare/MakeAvailable
, I'm setting properties on the alias TinyOrm::TinyOrm
inside the TinyOrmConfig.cmake:75
and it normally works when you try to build TinyOrm without these FetchContent_
CMake functions.
I have never used/tried these FetchContent_
functions. The CMake build will have to be fixed to make this work.
So I have played a little with it and the problem is that the TinyOrmTargets.cmake
file is not exported and I don't know why.
Anyway, you can't build with these FetchContent_
functions, it simply doesn't work and have to be fixed.
from tinyorm.
I think this can be related link or a very similar problem, or this. I don't understand how FetchContent works so I can't tell. It looks like you have to install the target that was FetchContent_MakeAvailable(TinyORM)
.
It looks like this doesn't work out of the box (maybe it works only for the header-only libraries and not for libraries that need to be compiled?):
FetchContent_Declare(TinyOrm
GIT_REPOSITORY https://github.com/silverqx/TinyORM.git
GIT_TAG origin/main
)
FetchContent_MakeAvailable(TinyOrm)
from tinyorm.
I was successful to build using FetchContent, but I have discovered another bug.
For now, remove find_package
and disable TOM
.
Something like this:
FetchContent_Declare(TinyOrm
GIT_REPOSITORY https://github.com/silverqx/TinyORM.git
GIT_TAG origin/main
)
set(TOM OFF)
FetchContent_MakeAvailable(TinyOrm)
...
target_link_libraries(${PROJECT_NAME}
PRIVATE
Qt${QT_VERSION_MAJOR}::Core
TinyOrm::TinyOrm
)
That are good news though π, that bug looks simply fixable, I look at it later.
from tinyorm.
I have already pushed fixes, currently are running CI pipelines, I'm going to make a release, I post an update here afterward.
from tinyorm.
Alright sounds good.
from tinyorm.
I have pushed a new release that contains a fix, you can look here what was the fix about.
from tinyorm.
A few words about the FetchContent
, the FetchContent_Declare()
it's like git clone inside the build folder and then add the cloned folder in a similar way like add_subdirectory(<cloned_folder>)
does and the FetchContent_MakeAvailable(<package>)
internally calls the find_package(<package>)
or if you define OVERRIDE_FIND_PACKAGE
then you don't have to call the the FetchContent_MakeAvailable()
and you must call the find_package(<package> x.y.z CONFIG REQUIRED)
manually.
An advantage of the OVERRIDE_FIND_PACKAGE
is that you can call it much later and you can insert configurations between.
So you can include the TinyORM
like this:
set(FETCHCONTENT_QUIET OFF)
include(FetchContent)
FetchContent_Declare(TinyOrm
GIT_REPOSITORY https://github.com/silverqx/TinyORM.git
GIT_TAG origin/main
)
# Here you can configure TinyORM CMake options
set(MYSQL_PING ON)
set(TOM_EXAMPLE ON)
FetchContent_MakeAvailable(TinyOrm)
...
target_link_libraries(${PROJECT_NAME}
PRIVATE
Qt${QT_VERSION_MAJOR}::Core
TinyOrm::TinyOrm
)
or like this:
set(FETCHCONTENT_QUIET OFF)
include(FetchContent)
FetchContent_Declare(TinyOrm
GIT_REPOSITORY https://github.com/silverqx/TinyORM.git
GIT_TAG origin/main
OVERRIDE_FIND_PACKAGE
)
# Here you can configure TinyORM CMake options
set(MYSQL_PING ON)
set(TOM_EXAMPLE ON)
...
find_package(TinyOrm 0.16.0 CONFIG REQUIRED)
target_link_libraries(${PROJECT_NAME}
PRIVATE
Qt${QT_VERSION_MAJOR}::Core
TinyOrm::TinyOrm
)
Maybe it helps someone in the future π
from tinyorm.
I have also added docs for the FetchContent method in HelloWorld docs example here.
I think it should be all πΊ
from tinyorm.
Related Issues (20)
- Aggressive "warnings" flags exported by the TinyOrm::TinyOrm target HOT 4
- Tom application referenced in TinyORM: Getting Started but not getting installed HOT 4
- Assertive TinyOrmConfig.cmake breaks static builds HOT 9
- Insufficiently escaped comment in tinytypes.hpp HOT 2
- VCPKG misplaces debug target export file HOT 2
- Support for Mac OS X, *BSD, and other libc++ environment HOT 3
- VCPKG upstream integration HOT 23
- VCPKG installs header files redundandly HOT 1
- [cmake] Installing mdx documentation HOT 8
- Tag the releases HOT 4
- GitHub Actions ubuntu compilation failure HOT 1
- redefinition of βbool __tls_guardβ in orm/tiny/concerns/hasattributes.hpp:412 HOT 1
- Add interface wrapper for CREATE IF NOT EXISTS HOT 2
- Classify Logs HOT 1
- DB::beginTransaction assert()-ing HOT 1
- Column and Table alias assigning HOT 4
- Many-to-many and wrong detach() overload? HOT 5
- Model implementing belongsToMany not compiling HOT 11
- Linker error when building with MinGW 11.2 HOT 10
- how are you?do you need any support? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tinyorm.