Skip to content

Commit

Permalink
support building with vcpkg
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaodaxia committed Dec 27, 2024
1 parent 3cb1518 commit 0b4d825
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 11 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ build/
**.so
**.o
**.sconsign*
Inventor/**.h
Inventor/*.h
Inventor/**/**.h
VolumeViz/**.h
SoPyScript/swigpyrun.h
examples/SoPyScript/examin
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ Starting with version 0.6.6 pivy it's possible to build pivy with cmake:
$ cd pivy
$ mkdir build
$ cd build
$ cmake ..
$ make
$ cmake .. --toolchain $VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake -DCMAKE_BUILD_TYPE:STRING=Release -DPython_ROOT_DIR:PATH="path/to/python/root/dir" -DX_VCPKG_APPLOCAL_DEPS_INSTALL:BOOLEAN=ON
$ cmake --build .
$ cmake --install .
```

Alternative it's still possible to use [distutils][0]:
Expand Down
16 changes: 8 additions & 8 deletions interfaces/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ swig_add_library(coin

if (APPLE)
set_target_properties(coin PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
elseif (MSVC)
endif()

if (MSVC)
set_target_properties(coin PROPERTIES COMPILE_FLAGS "/bigobj")
elseif(WIN32)
target_link_libraries(coin PUBLIC ${Python_LIBRARIES})
endif ()

target_include_directories(coin
Expand All @@ -40,7 +40,7 @@ target_include_directories(coin
${CMAKE_SOURCE_DIR}/interfaces
)

target_link_libraries(coin PUBLIC Coin::Coin)
target_link_libraries(coin PUBLIC Coin::Coin Python::Module)
install(TARGETS coin DESTINATION ${PIVY_Python_SITEARCH}/pivy)


Expand All @@ -63,10 +63,10 @@ if (SoQt_FOUND)

if (APPLE)
set_target_properties(soqt PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
elseif (MSVC)
endif()

if (MSVC)
set_target_properties(coin PROPERTIES COMPILE_FLAGS "/bigobj")
elseif (WIN32)
target_link_libraries(soqt PUBLIC ${Python_LIBRARIES})
endif ()

if (PIVY_USE_QT6)
Expand All @@ -85,6 +85,6 @@ if (SoQt_FOUND)
${CMAKE_SOURCE_DIR}/interfaces
)

target_link_libraries(soqt PUBLIC SoQt::SoQt)
target_link_libraries(soqt PUBLIC SoQt::SoQt Python::Module)
install(TARGETS soqt DESTINATION ${PIVY_Python_SITEARCH}/pivy/gui)
endif()
14 changes: 14 additions & 0 deletions vcpkg-configuration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"default-registry": {
"kind": "git",
"baseline": "5e5d0e1cd7785623065e77eff011afdeec1a3574",
"repository": "https://github.com/microsoft/vcpkg"
},
"registries": [
{
"kind": "artifact",
"location": "https://github.com/microsoft/vcpkg-ce-catalog/archive/refs/heads/main.zip",
"name": "microsoft"
}
]
}
5 changes: 5 additions & 0 deletions vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"dependencies": [
"soqt"
]
}

0 comments on commit 0b4d825

Please sign in to comment.