-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update CMakeLists.txt to add a 'd' sulffix to the lib built for debug #63
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I already see
Why is this not working? |
Thanks for the reply.
To build the cmake project we use something like:
cmake .. -A x64 -DKDReports_QT6=ON -DKDReports_STATIC=ON
-DKDReports_EXAMPLES=OFF -DKDReports_TESTS=OFF
-DCMAKE_BUILD_TYPE=RelWithDebInfo
So, I think the problem is because we use the property
-DCMAKE_BUILD_TYPE=RelWithDebInfo
and then the code does not enter in the block:
#version libraries on Windows
if(WIN32)
set(postfix ${${PROJECT_NAME}_SOVERSION})
string(TOUPPER ${CMAKE_BUILD_TYPE} UPPER_BUILD_TYPE)
if(${UPPER_BUILD_TYPE} MATCHES "^DEBUG")
string(CONCAT postfix ${postfix} "d")
set_target_properties(kdreports PROPERTIES DEBUG_POSTFIX
${postfix})
else()
set_target_properties(kdreports PROPERTIES
${UPPER_BUILD_TYPE}_POSTFIX ${postfix})
endif()
endif()
In particular the "if(${UPPER_BUILD_TYPE} MATCHES "^DEBUG")" fails.
Em 2024-07-31 04:56, David Faure escreveu:
… I already see
KDReports/src/CMakeLists.txt: set_target_properties(kdreports
PROPERTIES DEBUG_POSTFIX ${postfix})
Why is this not working?
--
Reply to this email directly, view it on GitHub [1], or unsubscribe
[2].
You are receiving this because you authored the thread.Message ID:
***@***.***>
Links:
------
[1] #63 (comment)
[2]
https://github.com/notifications/unsubscribe-auth/APU6TYDN745LLG5X56KUEI3ZPCKC3AVCNFSM6AAAAABLXAPXSSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENJZHA4TQMRQGY
--
Fabio Paolini
Comm5
|
Maybe it is important to mention that I am building the project with
Visual C (Windows)
Em 2024-07-31 09:27, Fabio Paolini escreveu:
… Thanks for the reply.
To build the cmake project we use something like:
cmake .. -A x64 -DKDReports_QT6=ON -DKDReports_STATIC=ON
-DKDReports_EXAMPLES=OFF -DKDReports_TESTS=OFF
-DCMAKE_BUILD_TYPE=RelWithDebInfo
So, I think the problem is because we use the property
-DCMAKE_BUILD_TYPE=RelWithDebInfo
and then the code does not enter in the block:
#version libraries on Windows
if(WIN32)
set(postfix ${${PROJECT_NAME}_SOVERSION})
string(TOUPPER ${CMAKE_BUILD_TYPE} UPPER_BUILD_TYPE)
if(${UPPER_BUILD_TYPE} MATCHES "^DEBUG")
string(CONCAT postfix ${postfix} "d")
set_target_properties(kdreports PROPERTIES DEBUG_POSTFIX
${postfix})
else()
set_target_properties(kdreports PROPERTIES
${UPPER_BUILD_TYPE}_POSTFIX ${postfix})
endif()
endif()
In particular the "if(${UPPER_BUILD_TYPE} MATCHES "^DEBUG")" fails.
Em 2024-07-31 04:56, David Faure escreveu:
> I already see
>
> KDReports/src/CMakeLists.txt: set_target_properties(kdreports
> PROPERTIES DEBUG_POSTFIX ${postfix})
>
> Why is this not working?
>
> --
> Reply to this email directly, view it on GitHub [1], or unsubscribe
> [2].
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
> Links:
> ------
> [1] #63 (comment)
> [2]
> https://github.com/notifications/unsubscribe-auth/APU6TYDN745LLG5X56KUEI3ZPCKC3AVCNFSM6AAAAABLXAPXSSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENJZHA4TQMRQGY
--
Fabio Paolini
Comm5
|
This command was added to separate the debug and release version, otherise it was need the rename the lib when alternate the compilation between debug and release in the main application. I have noted that kdchart makes such a separation but I did not find how it is done there.
for more information, see https://pre-commit.ci
I asked my colleagues (who know more about Windows than me) whether RelWithDebInfo should get the 'd' suffix or not. Here's the reply: the 'd' is for MSVC debug runtime, not for debug symbols, so RelWithDebInfo shouldn't have the 'd'. |
I understand. The problem that I had was that I had to change the
kdreport lib (among release and debug) as I am building my application
as debug or as release.
Of course it is a bit confusing because alhough the cmake project was
built with RelWithDebInf on the other hand in building the lib it is
possible to choose between "cmake --build . --config Release" or "cmake
--build . --config Debug" and in fact 2 different libs are built.
Now I studied a bit more deeply my KDchart projetc since there the 'd'
suffix is added. I noted that there the command used to generate the
project has the parameter -DCMAKE_DEBUG_POSTFIX=d
(my complete command is "cmake .. -A x64 -DKDChart_QT6=ON
-DKDChart_STATIC=ON -DKDChart_EXAMPLES=OFF -DDISABLE_PYTHON_BINDINGS=ON
-DCMAKE_DEBUG_POSTFIX=d -DCMAKE_INSTALL_PREFIX=<MY_PATH>
-DCMAKE_BUILD_TYPE=RelWithDebInfo")
Thus I added the paramenter -DCMAKE_DEBUG_POSTFIX=d in generating the
KDreport project too, and it worked, solving my problem.
Then it is possible to discard this pull request.
Thanks
Em 2024-08-02 07:13, David Faure escreveu:
… I asked my colleagues (who know more about Windows than me) whether
RelWithDebInfo should get the 'd' suffix or not. Here's the reply: the
'd' is for MSVC debug runtime, not for debug symbols, so
RelWithDebInfo shouldn't have the 'd'.
--
Reply to this email directly, view it on GitHub [1], or unsubscribe
[2].
You are receiving this because you authored the thread.Message ID:
***@***.***>
Links:
------
[1] #63 (comment)
[2]
https://github.com/notifications/unsubscribe-auth/APU6TYDRONBGNLGNST2QTMTZPNLSZAVCNFSM6AAAAABLXAPXSSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENRVGA2DCOJSHA
--
Fabio Paolini
Comm5
|
Thanks for the explanations, closing. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This command was added to separate the debug and release version, otherise it was need the rename the lib when alternate the compilation between debug and release in the main application.
I have noted that kdchart makes such a separation but I did not find how it is done there.