Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed setup process #73

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added .vs/CMake Overview
Empty file.
3 changes: 3 additions & 0 deletions .vs/ProjectSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"CurrentProjectSetting": "x64-Debug"
}
14 changes: 14 additions & 0 deletions .vs/VSWorkspaceState.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"OutputFoldersPerTargetSystem": {
"Local Machine": [
"out\\build\\x64-Debug",
"out\\install\\x64-Debug"
]
},
"ExpandedNodes": [
"",
"\\oceanmesh",
"\\tests"
],
"PreviewInSolutionExplorer": false
}
Binary file added .vs/cmake.db
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1,016 changes: 1,016 additions & 0 deletions .vs/oceanmesh/config/applicationhost.config

Large diffs are not rendered by default.

Binary file added .vs/oceanmesh/v17/.wsuo
Binary file not shown.
Binary file added .vs/oceanmesh/v17/Browse.VC.db
Binary file not shown.
Binary file added .vs/slnx.sqlite
Binary file not shown.
18 changes: 18 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Oceanmesh",
"type": "debugpy",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"subProcess": true,
"justMyCode": false
}
],

}
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
cmake_minimum_required(VERSION 2.8.12)

project(oceanmesh)

##############################################################################

# Add custom CMake modules
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})


# Some screen output
message(STATUS "OS detected: ${CMAKE_SYSTEM_NAME}")
message(STATUS "CXX Compiler detected: ${CMAKE_CXX_COMPILER_ID}")
message(STATUS "CMake additional search path for libraries: ${CMAKE_LIBRARY_PATH}")

# CGAL and its components
set(CGAL_DISABLE_GMP ON)
find_package(CGAL)

# target_link_libraries(main PRIVATE CGAL::CGAL)
message(STATUS "CGAL version: ${CGAL_VERSION}")

if( CGAL_VERSION VERSION_LESS 5.0)
Expand Down
15 changes: 15 additions & 0 deletions CMakeSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"configurations": [
{
"name": "x64-Debug",
"generator": "Ninja",
"configurationType": "Debug",
"inheritEnvironments": [ "msvc_x64_x64" ],
"buildRoot": "${projectDir}\\out\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "",
"ctestCommandArgs": ""
}
]
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ If you have a different Python distribution, or if you do not want to use packag
1. Obtain binary wheels for your python distribution for the latest GDAL, Fiona, and Rasterio (https://www.lfd.uci.edu/~gohlke/pythonlibs).
2. Create a new virtual environment and activate it.
3. Execute: cmd.exe /C "for %f in (GDAL\*.whl Fiona\*.whl rasterio\*.whl) do pip install %f"
4. Execute: pip install geopandas rasterio scikit-fmm pybind11
4. Execute: pip install geopandas rasterio scikit-fmm pybind11 cython
5. Execute: python setup.py install

:warning:
Expand Down
11 changes: 4 additions & 7 deletions install_cgal.bat
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ REM
set INSTALL_DIR=%USERPROFILE%\OceanMesh
if not exist "%INSTALL_DIR%" mkdir "%INSTALL_DIR%"

set CGAL_PORT="%CD%\ports"

pushd "%INSTALL_DIR%"

set LOG=%INSTALL_DIR%\build.log
Expand All @@ -70,18 +72,13 @@ pushd "%INSTALL_DIR%"
vcpkg upgrade --no-dry-run
)
echo building cgal... this generally takes several minutes.
vcpkg install cgal:x64-windows > "%LOG%"
vcpkg install cgal:x64-windows --overlay-ports=%CGAL_PORT%
popd

popd

set BIN_DIR=%INSTALL_DIR%\vcpkg\installed\x64-windows\bin

if not exist "%BIN_DIR%\gmp.dll" (
echo build has failed or is incomplete... see "%LOG%".
goto FAIL
)

REM permanently set environment variable to location of DLLs
REM
echo build seems to have succeeded.
Expand Down
2 changes: 1 addition & 1 deletion install_oceanmesh.bat
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ call conda create --name %ENV%
call conda activate %ENV%

echo installing OceanMesh conda packages
call conda install -c conda-forge geopandas rasterio scikit-fmm pybind11
call conda install -c conda-forge geopandas rasterio scikit-fmm pybind11 cython

echo Installing OceanMesh package
python setup.py install
Expand Down
Binary file added oceanmesh/.vs/oceanmesh/v17/.wsuo
Binary file not shown.
Binary file added oceanmesh/.vs/slnx.sqlite
Binary file not shown.
35 changes: 35 additions & 0 deletions package.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@echo off
setlocal

REM run package command for vcpkg
REM
if "%~2" EQU "" goto USAGE

set OPT=--overlay-ports="%CD%\ports"
set VCP=%CD%\vcpkg

if "%1" EQU "remove" (
pushd "%VCP%"
vcpkg remove %~2:x64-windows %OPT% --recurse
popd
) else if "%1" EQU "install" (
pushd "%VCP%"
vcpkg install %~2:x64-windows %OPT% --binarysource=clear
popd
if not exist "%VCP%\installed\x64-windows\share\%~2" (
echo package install command likely failed for %~2
GOTO FAIL
)
) else (
goto USAGE
)


:SUCCESS
exit /b 0

:USAGE
echo Usage: package install^|remove packagename

:FAIL
exit /b 1
8 changes: 8 additions & 0 deletions ports/.vs/VSWorkspaceState.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"ExpandedNodes": [
"",
"\\cgal"
],
"SelectedNode": "\\cgal\\usage",
"PreviewInSolutionExplorer": false
}
Binary file not shown.
Binary file added ports/.vs/ports/v17/.wsuo
Binary file not shown.
Binary file added ports/.vs/slnx.sqlite
Binary file not shown.
67 changes: 67 additions & 0 deletions ports/cgal/_ss/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Header only
vcpkg_buildpath_length_warning(37)

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO CGAL/cgal
REF v5.6
SHA512 87817169f49c30d8dc4fa5e61ce9b28be5b1f0a9fcd3ebe0cb08b044631a2455de76c53d3cffaa1984f033f5fe21c9b55f54628fc431b7d3a34b3b3e18ad206d
HEAD_REF master
PATCHES
x86_windows.patch
# Upstream patch: https://github.com/CGAL/cgal/pull/7635
)

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
qt WITH_CGAL_Qt5
)

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DCGAL_HEADER_ONLY=ON
-DCGAL_INSTALL_CMAKE_DIR=share/cgal
-DBUILD_TESTING=OFF
-DBUILD_DOC=OFF
-DCGAL_BUILD_THREE_DOC=OFF
${FEATURE_OPTIONS}
MAYBE_UNUSED_VARIABLES
CGAL_BUILD_THREE_DOC
CGAL_HEADER_ONLY
WITH_CGAL_Qt5
)

vcpkg_cmake_install()

vcpkg_cmake_config_fixup()

vcpkg_copy_pdbs()

# Clean
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug")
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin")
else()
foreach(ROOT "${CURRENT_PACKAGES_DIR}/bin")
file(REMOVE
"${ROOT}/cgal_create_CMakeLists"
"${ROOT}/cgal_create_cmake_script"
"${ROOT}/cgal_make_macosx_app"
)
endforeach()
endif()

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/doc" "${CURRENT_PACKAGES_DIR}/share/man")

set(LICENSES
"${SOURCE_PATH}/Installation/LICENSE"
"${SOURCE_PATH}/Installation/LICENSE.BSL"
"${SOURCE_PATH}/Installation/LICENSE.RFL"
"${SOURCE_PATH}/Installation/LICENSE.GPL"
"${SOURCE_PATH}/Installation/LICENSE.LGPL"
)

vcpkg_install_copyright(FILE_LIST ${LICENSES})

file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
81 changes: 81 additions & 0 deletions ports/cgal/_ss/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
{
"name": "cgal",
"version": "5.6",
"port-version": 1,
"description": "The Computational Geometry Algorithms Library (CGAL) is a C++ library that aims to provide easy access to efficient and reliable algorithms in computational geometry.",
"homepage": "https://github.com/CGAL/cgal",
"license": "GPL-3.0-or-later AND LGPL-3.0-or-later AND BSL-1.0",
"supports": "!xbox",
"dependencies": [
"boost-accumulators",
"boost-algorithm",
"boost-bimap",
"boost-callable-traits",
"boost-concept-check",
"boost-container",
"boost-core",
"boost-detail",
"boost-filesystem",
"boost-functional",
"boost-fusion",
"boost-geometry",
"boost-graph",
"boost-heap",
"boost-intrusive",
"boost-iostreams",
"boost-iterator",
"boost-lambda",
"boost-logic",
"boost-math",
"boost-mpl",
"boost-multi-array",
"boost-multi-index",
"boost-multiprecision",
"boost-numeric-conversion",
"boost-optional",
"boost-parameter",
"boost-pool",
"boost-preprocessor",
"boost-property-map",
"boost-property-tree",
"boost-ptr-container",
"boost-random",
"boost-range",
"boost-serialization",
"boost-spirit",
"boost-thread",
"boost-tuple",
"boost-type-traits",
"boost-units",
"boost-utility",
"boost-variant",
"gmp",
"mpfr",
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
},
"zlib"
],
"features": {
"qt": {
"description": "Qt GUI support for CGAL",
"dependencies": [
"boost-format",
"eigen3",
"qt5-3d",
{
"name": "qt5-base",
"default-features": false
},
"qt5-script",
"qt5-svg",
"qt5-xmlpatterns"
]
}
}
}
63 changes: 63 additions & 0 deletions ports/cgal/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Header only
vcpkg_buildpath_length_warning(37)

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO CGAL/cgal
REF v5.6
SHA512 87817169f49c30d8dc4fa5e61ce9b28be5b1f0a9fcd3ebe0cb08b044631a2455de76c53d3cffaa1984f033f5fe21c9b55f54628fc431b7d3a34b3b3e18ad206d
HEAD_REF master
PATCHES
x86_windows.patch
# Upstream patch: https://github.com/CGAL/cgal/pull/7635
)

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DCGAL_DISABLE_GMP=ON
-DCGAL_HEADER_ONLY=ON
-DCGAL_INSTALL_CMAKE_DIR=share/cgal
-DBUILD_TESTING=OFF
-DBUILD_DOC=OFF
-DCGAL_BUILD_THREE_DOC=OFF
-DWITH_CGAL_Qt5=OFF
MAYBE_UNUSED_VARIABLES
CGAL_BUILD_THREE_DOC
CGAL_HEADER_ONLY
WITH_CGAL_Qt5
)

vcpkg_cmake_install()

vcpkg_cmake_config_fixup()

vcpkg_copy_pdbs()

# Clean
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug")
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin")
else()
foreach(ROOT "${CURRENT_PACKAGES_DIR}/bin")
file(REMOVE
"${ROOT}/cgal_create_CMakeLists"
"${ROOT}/cgal_create_cmake_script"
"${ROOT}/cgal_make_macosx_app"
)
endforeach()
endif()

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/doc" "${CURRENT_PACKAGES_DIR}/share/man")

set(LICENSES
"${SOURCE_PATH}/Installation/LICENSE"
"${SOURCE_PATH}/Installation/LICENSE.BSL"
"${SOURCE_PATH}/Installation/LICENSE.RFL"
"${SOURCE_PATH}/Installation/LICENSE.GPL"
"${SOURCE_PATH}/Installation/LICENSE.LGPL"
)

vcpkg_install_copyright(FILE_LIST ${LICENSES})

file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
5 changes: 5 additions & 0 deletions ports/cgal/usage
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
The package cgal provides CMake targets:

find_package(CGAL CONFIG REQUIRED)
target_link_libraries(main PRIVATE CGAL::CGAL)

Loading
Loading