Skip to content

Commit 68124f7

Browse files
committed
Fix CMake compatibility issues with Visual Studio 2019
1 parent 82c2ca2 commit 68124f7

3 files changed

Lines changed: 12 additions & 13 deletions

File tree

CMakeLists.txt

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,17 @@ IF(MSVC OR ${CMAKE_GENERATOR} MATCHES "Xcode")
3030
ENDIF()
3131

3232
MESSAGE(STATUS "Configuring PLUS toolkit version ${PLUSLIB_VERSION}.")
33-
3433
IF(MSVC OR ${CMAKE_GENERATOR} MATCHES "Xcode")
35-
IF( ${CMAKE_GENERATOR} MATCHES "Win64")
36-
SET(PLUSLIB_PLATFORM "Win64" CACHE STRING "Name of the platform this instance of PlusLib is built on")
37-
ELSE()
38-
SET(PLUSLIB_PLATFORM "Win32" CACHE STRING "Name of the platform this instance of PlusLib is built on")
34+
IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
35+
SET(PLUSLIB_PLATFORM "Win64" CACHE STRING "Name of the platform this instance of PlusLib is built on" FORCE)
36+
ELSEIF(CMAKE_SIZEOF_VOID_P EQUAL 4)
37+
SET(PLUSLIB_PLATFORM "Win32" CACHE STRING "Name of the platform this instance of PlusLib is built on" FORCE)
3938
ENDIF()
4039
ELSE()
4140
IF(APPLE)
42-
SET(PLUSLIB_PLATFORM "OSX" CACHE STRING "Name of the platform this instance of PlusLib is built on")
41+
SET(PLUSLIB_PLATFORM "OSX" CACHE STRING "Name of the platform this instance of PlusLib is built on" FORCE)
4342
ELSE()
44-
SET(PLUSLIB_PLATFORM "Linux" CACHE STRING "Name of the platform this instance of PlusLib is built on")
43+
SET(PLUSLIB_PLATFORM "Linux" CACHE STRING "Name of the platform this instance of PlusLib is built on" FORCE)
4544
ENDIF()
4645
ENDIF()
4746

@@ -165,7 +164,7 @@ ENDIF()
165164

166165
SET(PHIDGET_SPATIAL_BASE_DIR ${PLUSLIB_TOOLS_DIR}/Phidget/Phidget22)
167166
SET(PHIDGET_SPATIAL_INCLUDE_DIR ${PHIDGET_SPATIAL_BASE_DIR} CACHE PATH "Path to the Phidget Spatial include folder" FORCE )
168-
IF(MSVC AND ${CMAKE_GENERATOR} MATCHES "Win64")
167+
IF(MSVC AND ${PLUSLIB_PLATFORM} MATCHES "Win64")
169168
SET(PHIDGET_SPATIAL_LIB_DIR ${PHIDGET_SPATIAL_BASE_DIR}/x64 CACHE PATH "Path to the Phidget Spatial 64-bit lib folder" FORCE )
170169
SET(PHIDGET_SPATIAL_BINARY_DIR ${PHIDGET_SPATIAL_BASE_DIR}/x64 CACHE PATH "Path to the Phidget Spatial 64-bit dll folder" FORCE )
171170
ELSE()
@@ -183,7 +182,7 @@ ENDIF()
183182

184183
SET(EPIPHAN_SDK_BASE_DIR ${PLUSLIB_TOOLS_DIR}/Epiphan)
185184
SET(EPIPHAN_INCLUDE_DIR ${EPIPHAN_SDK_BASE_DIR} CACHE PATH "Path to the Epiphan SDK include directory." FORCE )
186-
IF(MSVC AND ${CMAKE_GENERATOR} MATCHES "Win64")
185+
IF(MSVC AND ${PLUSLIB_PLATFORM} MATCHES "Win64")
187186
SET(EPIPHAN_BINARY_DIR ${EPIPHAN_SDK_BASE_DIR}/x64 CACHE PATH "Directory containing Epiphan shared library file." FORCE)
188187
SET(EPIPHAN_LIB_DIR ${EPIPHAN_SDK_BASE_DIR}/x64 CACHE PATH "Directory containing Epiphan static library file." FORCE)
189188
ELSE()
@@ -215,7 +214,7 @@ ENDIF()
215214
IF(WIN32)
216215
SET(NVIDIA_DVP_BASE_DIR ${PLUSLIB_TOOLS_DIR}/NVidia/dvp170)
217216
SET(NVIDIA_DVP_INCLUDE_DIR ${NVIDIA_DVP_BASE_DIR}/include CACHE PATH "Path to the NVidia DVP include directory." FORCE )
218-
IF(MSVC AND ${CMAKE_GENERATOR} MATCHES "Win64")
217+
IF(MSVC AND ${PLUSLIB_PLATFORM} MATCHES "Win64")
219218
SET(NVIDIA_DVP_BINARY_DIR ${NVIDIA_DVP_BASE_DIR}/bin/x64 CACHE PATH "Directory containing NVidia DVP shared library file." FORCE)
220219
SET(NVIDIA_DVP_LIB_DIR ${NVIDIA_DVP_BASE_DIR}/lib/x64 CACHE PATH "Directory containing NVidia DVP static library file." FORCE)
221220
ELSE()

src/PlusDataCollection/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,7 @@ IF( PLUS_USE_Ascension3DG )
864864
)
865865

866866
ADD_LIBRARY(Ascension3DG SHARED IMPORTED)
867-
IF( (MSVC AND ${CMAKE_GENERATOR} MATCHES "Win64") OR MINGW )
867+
IF( (MSVC AND ${PLUSLIB_PLATFORM} MATCHES "Win64") OR MINGW )
868868
SET(Ascension3DG_LIB_FILE ${ATC_TRAKSTAR_LIB_DIR}/ATC3DG64${CMAKE_STATIC_LIBRARY_SUFFIX} CACHE FILEPATH "Lib file for Ascension3DG.")
869869
SET(Ascension3DG_SHARED_LIB_FILE ${ATC_TRAKSTAR_BINARY_DIR}/ATC3DG64${CMAKE_SHARED_LIBRARY_SUFFIX} CACHE FILEPATH "DLL file for Ascension3DG.")
870870
ELSE()
@@ -1585,7 +1585,7 @@ IF(PLUS_USE_INTERSON_VIDEO)
15851585
${CMAKE_CURRENT_SOURCE_DIR}/Interson
15861586
)
15871587

1588-
IF(${CMAKE_GENERATOR} MATCHES Win64)
1588+
IF(${PLUSLIB_PLATFORM} MATCHES "Win64")
15891589
LIST(APPEND External_Libraries_Install
15901590
${INTERSON_WIN64_BINARY_DIR}/USBprobe${CMAKE_SHARED_LIBRARY_SUFFIX}
15911591
${INTERSON_BINARY_DIR}/BmodeUSB${CMAKE_SHARED_LIBRARY_SUFFIX}

src/PlusImageProcessing/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ SET(${PROJECT_NAME}_LIBS
6969
)
7070

7171
IF(PLUS_USE_INTEL_MKL)
72-
IF(${CMAKE_GENERATOR} MATCHES Win64)
72+
IF(${PLUSLIB_PLATFORM} MATCHES "Win64")
7373
SET(MKL_LIBS
7474
"${IntelComposerXEdir}/mkl/lib/intel64/mkl_intel_lp64_dll.lib"
7575
"${IntelComposerXEdir}/mkl/lib/intel64/mkl_intel_thread_dll.lib"

0 commit comments

Comments
 (0)