Archived issue #0029266
Configuration - CMake install does not copy pdb files in Debug mode due to the changes in 0028287
Description
In the fix of 0028287 the search folder for pdb files was changed from "bind" to "bin", which is correct for the release configuration with debug info, but fails for debug configuration. Now install target fails to build debug configuration resulting in the error "CMake Error at src/TKernel/cmake_install.cmake:32 (file): file INSTALL cannot find "win32/vc10/bin/TKernel.pdb"."
Steps to reproduce
set CMAKE_BUILD_TYPE to Debug
configure and build
configure and build
Public activity
13 archived notes
Participants are labeled by their role within this record.
Branch [archived branch] has been created by Commenter 3.
[revision removed]
Detailed log of new commits:
Author: Commenter 3
Date: Wed Nov 29 15:46:54 2017 +0300
0029266: CMake install does not copy pdb files in Debug mode due to the changes in 0028287
Added definition of OCCT_INSTALL_BIN_LETTER in building with SINGLE_GENERATOR
[revision removed]
Detailed log of new commits:
Author: Commenter 3
Date: Wed Nov 29 15:46:54 2017 +0300
0029266: CMake install does not copy pdb files in Debug mode due to the changes in 0028287
Added definition of OCCT_INSTALL_BIN_LETTER in building with SINGLE_GENERATOR
Dear ski, could you please review CR29266.
Compilation was checked with SINGLE_GENERATOR (Release,Debug and RelWithDebInfo).
Compilation was checked with SINGLE_GENERATOR (Release,Debug and RelWithDebInfo).
Branch [archived branch] has been updated forcibly by Commenter 3.
[revision removed]
[revision removed]
Branch [archived branch] has been updated forcibly by Commenter 3.
[revision removed]
[revision removed]
Remove declaration of unused macros OCCT_INSERT_CODE_FOR_TARGET in main CMakeLists.txt.
Replace `if (NOT SINGLE_GENERATOR)` by `if (WIN32)` because OCCT_INSTALL_BIN_LETTER is used only on Windows (isn't depended on type of generator) due to the fact that bind/libd/bini/libi folders are not used on Linux (only bin and lib).
OCCT and PRODUCTS compilation and install procedures were checked in all configuration: Release, Debug, RelWithDebInfo (single-configuration too). Pdb files are successfully copied on Windows platform if CMAKE_BUILD_TYPE is set to Debug or RelWithDebInfo.
Dear ski, could you please review OCCT and Products branches CR29266.
Replace `if (NOT SINGLE_GENERATOR)` by `if (WIN32)` because OCCT_INSTALL_BIN_LETTER is used only on Windows (isn't depended on type of generator) due to the fact that bind/libd/bini/libi folders are not used on Linux (only bin and lib).
OCCT and PRODUCTS compilation and install procedures were checked in all configuration: Release, Debug, RelWithDebInfo (single-configuration too). Pdb files are successfully copied on Windows platform if CMAKE_BUILD_TYPE is set to Debug or RelWithDebInfo.
Dear ski, could you please review OCCT and Products branches CR29266.
Branch [archived branch] has been deleted by Commenter 5.
[revision removed]
[revision removed]
[revision removed] introduces an ugly behaviour when building OCCT with CMake using MSYS Makefiles and Mingw-w64/g++ as compiler. (It might be that this behaviour is not compiler/configuration-dependent.)
Since that commit the CMake entries/variables INSTALL_DIR_BIN (here "win64/gcc/bin") and INSTALL_DIR_LIB (here "win64/gcc/lib") are ignored an instead the binaries are here installed to "win64/gcc/bind" and the libraries are installed to "win64/gcc/libd". This is surprising. It is also dangerous, because if some debugging configuration refers to the "win64/gcc/bin"-path, but OCCT binaries are installed to another path, wrong (old?) libraries will be used for debugging. Exactly this has happened here and has cost many ours searching for the error.
Adding a debugging library postfix to the CMake variables INSTALL_DIR_BIN and INSTALL_DIR_LIB would be fine as long as I can overwrite them. But letting these variables exist and ignoring them seems to be no option.
Since that commit the CMake entries/variables INSTALL_DIR_BIN (here "win64/gcc/bin") and INSTALL_DIR_LIB (here "win64/gcc/lib") are ignored an instead the binaries are here installed to "win64/gcc/bind" and the libraries are installed to "win64/gcc/libd". This is surprising. It is also dangerous, because if some debugging configuration refers to the "win64/gcc/bin"-path, but OCCT binaries are installed to another path, wrong (old?) libraries will be used for debugging. Exactly this has happened here and has cost many ours searching for the error.
Adding a debugging library postfix to the CMake variables INSTALL_DIR_BIN and INSTALL_DIR_LIB would be fine as long as I can overwrite them. But letting these variables exist and ignoring them seems to be no option.
I've built current state of occt (included [revision removed]) using MSYS Makefiles CMake generator and Mingw-w64/g++ as compiler (CMAKE_CXX_COMPILER C:/mingw-w64/mingw64/bin/g++.exe, CMAKE_C_COMPILER C:/mingw-w64/mingw64/bin/gcc.exe).
During installation procedure all binaries and libraries were installed to install\win64\gcc\bin and install\win64\gcc\lib folders.
After building and installing in Debug mode (CMAKE_BUILD_TYPE Debug) binaries and libraries were installed respectively to install\win64\gcc\bind and install\win64\gcc\libd folders.
Also it's possible to define INSTALL_DIR_BIN and INSTALL_DIR_LIB manually. This option works correctly.
During installation procedure all binaries and libraries were installed to install\win64\gcc\bin and install\win64\gcc\lib folders.
After building and installing in Debug mode (CMAKE_BUILD_TYPE Debug) binaries and libraries were installed respectively to install\win64\gcc\bind and install\win64\gcc\libd folders.
Also it's possible to define INSTALL_DIR_BIN and INSTALL_DIR_LIB manually. This option works correctly.
Branch [archived branch] has been created by Commenter 3.
[revision removed]
Detailed log of new commits:
Author: Commenter 3
Date: Thu May 24 16:54:00 2018 +0300
0029266: Configuration - CMake install does not copy pdb files in Debug mode due to the changes in 0028287
Define variable "OCCT_INSTALL_BIN_LETTER" only if compiler is some version of Microsoft Visual C.
[revision removed]
Detailed log of new commits:
Author: Commenter 3
Date: Thu May 24 16:54:00 2018 +0300
0029266: Configuration - CMake install does not copy pdb files in Debug mode due to the changes in 0028287
Define variable "OCCT_INSTALL_BIN_LETTER" only if compiler is some version of Microsoft Visual C.
Macros OCCT_INSERT_CODE_FOR_TARGET (which defines variable OCCT_INSTALL_BIN_LETTER according to build type) was called on Windows only and for all cmake generators (including single generators). INSTALL_DIR_BIN is defined to "win64/gcc/bin", but in cmake install procedure defines as "install (TARGETS ${PROJECT_NAME} DESTINATION "${INSTALL_DIR_BIN}\${OCCT_INSTALL_BIN_LETTER}")". So ${OCCT_INSTALL_BIN_LETTER} was replaced by "d" and binaries were installed to "win64/gcc/bind".
In fix CR29266 macros OCCT_INSERT_CODE_FOR_TARGET is called only if compiler is some version of Microsoft Visual C. So "bind" and "libd" folders are used only when occt or products are compiled with Visual Studio. On Linux and for all single generators (e.g. msys or mingw) INSTALL_DIR_BIN is always defined to ${ARCH}/${COMPILER}/bin.
In fix CR29266 macros OCCT_INSERT_CODE_FOR_TARGET is called only if compiler is some version of Microsoft Visual C. So "bind" and "libd" folders are used only when occt or products are compiled with Visual Studio. On Linux and for all single generators (e.g. msys or mingw) INSTALL_DIR_BIN is always defined to ${ARCH}/${COMPILER}/bin.
Reviewed, added to branch CR0-OCCT730beta for integration
I have tested it. It works great now, thank you!
Branch [archived branch] has been deleted by Commenter 5.
[revision removed]
[revision removed]
Related records