Skip to content

Commit 8425825

Browse files
committed
0027355: Configuration, CMake: install path on Windows is incorrectly processed
Avoid resetting CMAKE_INSTALL_PREFIX if defined. Back slashes are converted to straight slashes in INSTALL_DIR and 3RDPARTY_DIR variables.
1 parent ada9ef4 commit 8425825

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,13 @@ set (INSTALL_SAMPLES OFF CACHE BOOL "${INSTALL_SAMPLES_DESCR}")
7070
# install dir of the project
7171
if (NOT DEFINED INSTALL_DIR)
7272
# set default install directory for Windows
73-
if (WIN32)
73+
if (WIN32 AND NOT DEFINED CMAKE_INSTALL_PREFIX)
7474
set (CMAKE_INSTALL_PREFIX "C:/opencascade-${OCC_VERSION_STRING_EXT}")
7575
endif()
7676
set (INSTALL_DIR "${CMAKE_INSTALL_PREFIX}" CACHE PATH "${INSTALL_DIR_DESCR}")
77+
else()
78+
file (TO_CMAKE_PATH ${INSTALL_DIR} INSTALL_DIR)
79+
set (INSTALL_DIR "${INSTALL_DIR}" CACHE PATH "${INSTALL_DIR_DESCR}" FORCE)
7780
endif()
7881

7982
# choose a variant of the layout of the install paths
@@ -377,6 +380,9 @@ endif()
377380
if (NOT DEFINED 3RDPARTY_DIR)
378381
set (3RDPARTY_DIR "" CACHE PATH ${3RDPARTY_DIR_DESCR})
379382
get_filename_component (3RDPARTY_DIR "${3RDPARTY_DIR}" ABSOLUTE)
383+
else()
384+
file (TO_CMAKE_PATH ${3RDPARTY_DIR} 3RDPARTY_DIR)
385+
set (3RDPARTY_DIR "${3RDPARTY_DIR}" CACHE PATH "${3RDPARTY_DIR_DESCR}" FORCE)
380386
endif()
381387

382388
# search for CSF_TclLibs variable in EXTERNLIB of each being used toolkit

0 commit comments

Comments
 (0)