Skip to content

Commit

Permalink
Some desperate CMake fixes (see also tm_v8.2)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasmatena committed Sep 20, 2024
1 parent 6c044e6 commit 84f95ae
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 9 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ if(POLICY CMP0091)
cmake_policy(SET CMP0091 NEW)
endif()


find_package(Threads REQUIRED)

###### Version

set(OpenVDB_MAJOR_VERSION 11)
Expand Down
6 changes: 5 additions & 1 deletion cmake/FindBlosc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,11 @@ set(Blosc_LIB_COMPONENTS "")
list(APPEND BLOSC_BUILD_TYPES DEBUG RELEASE)

foreach(BUILD_TYPE ${BLOSC_BUILD_TYPES})
set(_BLOSC_LIB_NAME blosc)
if(WIN32)
set(_BLOSC_LIB_NAME libblosc)
else()
set(_BLOSC_LIB_NAME blosc)
endif()

set(_BLOSC_CMAKE_IGNORE_PATH ${CMAKE_IGNORE_PATH})
if(VCPKG_TOOLCHAIN)
Expand Down
18 changes: 10 additions & 8 deletions openvdb/openvdb/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ endif()

# Collect and configure lib dependencies

find_package(Threads REQUIRED)

if(OPENVDB_USE_DELAYED_LOADING)
find_package(Boost ${MINIMUM_BOOST_VERSION} REQUIRED COMPONENTS iostreams)
else()
Expand Down Expand Up @@ -670,14 +672,14 @@ if(OPENVDB_CORE_STATIC)
PROPERTIES OUTPUT_NAME ${OPENVDB_STATIC_LIBRARY_NAME})

if(MSVC)
if(NOT CMAKE_MSVC_RUNTIME_LIBRARY)
# NOTE: MSVC_RUNTIME_LIBRARY does not propagate to targets, so
# also add it explicitly as a compile option
set_target_properties(openvdb_static PROPERTIES
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
target_compile_options(openvdb_static PUBLIC
"$<$<COMPILE_LANG_AND_ID:CXX,MSVC>:/MT$<$<CONFIG:Debug>:d>>")
endif()
#if(NOT CMAKE_MSVC_RUNTIME_LIBRARY)
# # NOTE: MSVC_RUNTIME_LIBRARY does not propagate to targets, so
# # also add it explicitly as a compile option
# set_target_properties(openvdb_static PROPERTIES
# MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
# target_compile_options(openvdb_static PUBLIC
# "$<$<COMPILE_LANG_AND_ID:CXX,MSVC>:/MT$<$<CONFIG:Debug>:d>>")
#endif()
set_target_properties(openvdb_static PROPERTIES PREFIX "lib")
endif()
endif()
Expand Down
1 change: 1 addition & 0 deletions openvdb_cmd/vdb_print/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ project(VDBPrint LANGUAGES CXX)
include(GNUInstallDirs)

set(SOURCE_FILES main.cc)
find_package(Threads REQUIRED)
add_executable(vdb_print ${SOURCE_FILES})
target_link_libraries(vdb_print ${OPENVDB_BINARIES_DEPENDENT_LIBS})

Expand Down

0 comments on commit 84f95ae

Please sign in to comment.