just fyi, this vid has highest vid quality of 360p. sometimes i dont notice when i upload. oh and hey, you are a life saver with these videos. Everything you are covering is necessary knowledge, except no one at university covers it, no online courses cover it, and the few youtubers who do don't do it well. So from the bottom of my heart, thank you.
Great tutorial. I follow from EP1 to here, but have the error: the main.cpp can not find the "#include " when building, although this file is in build folder after run configure. I have to manually add #include "build/OLASConfig.h". Am I missing sth ? Thanks.
Oh, so I found that using this line does not work for my case (Cmake 3.16.3), : target_link_directories(${PROJECT_NAME} PUBLIC ${PROJECT_BINARY_DIR}) Replace it with the following works now: include_directories(${CMAKE_CURRENT_BINARY_DIR}) Source: cmake.org/cmake/help/latest/command/configure_file.html
I am really binged on your videos for a couple of hours now, everything is great just the video quality seems to be pretty low in this one. hard to keep up with the things written in files.
Can't tell if they're there or not because of the video quality, but the macro should look like this *with quotes*: #define MYPROJECT_VERSION_MAJOR "@MyProject_VERSION_MAJOR@" #define MYPROJECT_VERSION_MINOR "@MyProject_VERSION_MINOR@"
project(test VERSION 1.0) //didn't work for me //working code NOTE: ORDER SHOULD BE SAME project(test) set(TEST_VERSION_MAJOR "1") set(TEST_VERSION_MINOR "0") configure_file(TESTConfig.h.in TESTConfig.h) // In TESTConfig.h.in #define TEST_VERSION_MAJOR "@TEST_VERSION_MAJOR@" #define TEST_VERSION_MINOR "@TEST_VERSION_MINOR@"
just fyi, this vid has highest vid quality of 360p. sometimes i dont notice when i upload.
oh and hey, you are a life saver with these videos. Everything you are covering is necessary knowledge, except no one at university covers it, no online courses cover it, and the few youtubers who do don't do it well. So from the bottom of my heart, thank you.
Your CMake tutorials are so good that I subbed and enabled notifications.
BTW one can also use the regular ${} syntax instead of @@. The second one is only needed if the file to be transformed already use the first one
Great tutorial. I follow from EP1 to here, but have the error: the main.cpp can not find the "#include " when building, although this file is in build folder after run configure.
I have to manually add #include "build/OLASConfig.h". Am I missing sth ?
Thanks.
Oh, so I found that using this line does not work for my case (Cmake 3.16.3), :
target_link_directories(${PROJECT_NAME} PUBLIC ${PROJECT_BINARY_DIR})
Replace it with the following works now:
include_directories(${CMAKE_CURRENT_BINARY_DIR})
Source: cmake.org/cmake/help/latest/command/configure_file.html
@@chuongnguyen4980 Worked for me. Thanks!
Going by the comments looks like some of the errors are due to including "*_Configh.h.in" instead of "*_Config.h" in main.cpp
I am really binged on your videos for a couple of hours now, everything is great just the video quality seems to be pretty low in this one. hard to keep up with the things written in files.
add_compile_definitions in cmake can simplify this right?
hello, it does not work for me. I get the error, that OLAFConfig.h cannot be opened. No such file or directory. Does anyone have an idea why?
Same here
I didn't get the point how the project can be built if we didn't create OLASConfig.h header (only OLASConfig.h.in has been created)?
I believe CMake auto-generates the OLASConfig.h file based on OLASConfig.h.in . The Make file then uses the auto-generated OLASConfig.h .
I'm finding that the best quality for this video is 360p. Maybe try re-uploading?
AHH I did not notice, not sure why that happened. Thanks for the heads up.
@@CodeTechandTutorials Is there an updated version now?
Why should we need two header files, which are h.in and .h ?
because the h.in have the reference if you want to view of the other perspective it have the name of the constant, and the .h have the value
Can't tell if they're there or not because of the video quality, but the macro should look like this *with quotes*:
#define MYPROJECT_VERSION_MAJOR "@MyProject_VERSION_MAJOR@"
#define MYPROJECT_VERSION_MINOR "@MyProject_VERSION_MINOR@"
^^^THIS^^^
thanks!!
U save my day
project(test VERSION 1.0) //didn't work for me
//working code NOTE: ORDER SHOULD BE SAME
project(test)
set(TEST_VERSION_MAJOR "1")
set(TEST_VERSION_MINOR "0")
configure_file(TESTConfig.h.in TESTConfig.h)
// In TESTConfig.h.in
#define TEST_VERSION_MAJOR "@TEST_VERSION_MAJOR@"
#define TEST_VERSION_MINOR "@TEST_VERSION_MINOR@"
test and TEST are not same change to make them same