Skip to content

Commit

Permalink
prepared vcpkg based build
Browse files Browse the repository at this point in the history
  • Loading branch information
miho committed Aug 24, 2021
1 parent db9a981 commit dbb9200
Show file tree
Hide file tree
Showing 9 changed files with 78 additions and 54 deletions.
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ find_package(OpenCASCADE COMPONENTS Visualization REQUIRED)
include_directories(${OpenCASCADE_INCLUDE_DIR})
MESSAGE("OCC-Include-Dir: ${OpenCASCADE_INCLUDE_DIR}")
link_directories(${OpenCASCADE_LIBRARY_DIR})
MESSAGE("OCC-Lib-Dir-Dir: ${OpenCASCADE_LIBRARY_DIR}")
MESSAGE("OCC-Lib-Dir: ${OpenCASCADE_LIBRARY_DIR}")
MESSAGE("OCC-Libs: ${OpenCASCADE_LIBRARIES}")


INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
Expand Down Expand Up @@ -45,7 +46,7 @@ IF(UNIX AND NOT APPLE)
# link_directories(${FREETYPE_LIBRARY_DIR})
ENDIF()

set(CMAKE_CXX_STANDARD 11) # C++11...
set(CMAKE_CXX_STANDARD 20) # C++11...
set(CMAKE_CXX_STANDARD_REQUIRED ON) #...is required...
set(CMAKE_CXX_EXTENSIONS OFF) #...without compiler extensions like gnu++11

Expand Down
3 changes: 3 additions & 0 deletions build.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# build configured project

cmake --build build --config Release -j 8
2 changes: 0 additions & 2 deletions cmake/CreateExecutable.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)

function(CreateExecutable EXECUTABLESOURCE)

get_filename_component(EXECUTABLEBINARY ${EXECUTABLESOURCE} NAME_WE)
Expand Down
2 changes: 0 additions & 2 deletions cmake/CreateLibrary.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)

macro(CreateLibrary)

FILE(GLOB HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/inc/*.hpp")
Expand Down
8 changes: 8 additions & 0 deletions configure.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

# configure VCPKG location
$env:VCPKG_ROOT="\dev\vcpkg\"

# configure triplet
$env:VCPKG_TRIPLET="x64-windows-static"

cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE="${env:VCPKG_ROOT}\scripts\buildsystems\vcpkg.cmake" -DVCPKG_TARGET_TRIPLET="${env:VCPKG_TRIPLET}"
90 changes: 46 additions & 44 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,54 +6,56 @@ CreateExecutable(occ-csg.cpp

#${OpenCASCADE_LIBRARIES}

TKSTL # stl file support
# TKSTL # stl file support

# order of the library might matter for static linking
# remember to put base libs such as kernel and math at the end

TKXDESTEP
TKBinXCAF
TKXmlXCAF
TKXDEIGES
TKXCAF
TKIGES
TKSTEP
TKSTEP209
TKSTEPAttr
TKSTEPBase
TKXSBase
TKStd
TKStdL
TKXml
TKBin
TKXmlL
TKBinL
TKCAF
TKXCAF
TKLCAF
TKCDF
TKMeshVS
TKOpenGl
TKV3d
TKService
TKXMesh
TKMesh
TKOffset
TKFeat
TKFillet
TKHLR
TKBool
TKBO
TKShHealing
TKPrim
TKTopAlgo
TKGeomAlgo
TKBRep
TKGeomBase
TKG3d
TKG2d
TKMath
TKernel
# TKXDESTEP
# TKBinXCAF
# TKXmlXCAF
# TKXDEIGES
# TKXCAF
# TKIGES
# TKSTEP
# TKSTEP209
# TKSTEPAttr
# TKSTEPBase
# TKXSBase
# TKStd
# TKStdL
# TKXml
# TKBin
# TKXmlL
# TKBinL
# TKCAF
# TKXCAF
# TKLCAF
# TKCDF
# TKMeshVS
# TKOpenGl
# TKV3d
# TKService
# TKXMesh
# TKMesh
# TKOffset
# TKFeat
# TKFillet
# TKHLR
# TKBool
# TKBO
# TKShHealing
# TKPrim
# TKTopAlgo
# TKGeomAlgo
# TKBRep
# TKGeomBase
# TKG3d
# TKG2d
# TKMath
# TKernel

${OpenCASCADE_LIBRARIES}

freetype

Expand Down
4 changes: 2 additions & 2 deletions src/occ-csg.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2018-2019 Michael Hoffer <[email protected]>. All rights reserved.
* Copyright 2018-2021 Michael Hoffer <[email protected]>. All rights reserved.
*
* This file is part of OCC-CSG.
*
Expand Down Expand Up @@ -132,7 +132,7 @@


// version
#define VERSION "0.9.9.2"
#define VERSION "0.9.9.3"

// minimal API for primitive objects
TopoDS_Shape createBox(double x1, double y1, double z1, double x2, double y2, double z2);
Expand Down
4 changes: 2 additions & 2 deletions test-suite/Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class Test {

public static void main(String[] args) throws Exception {

checkVersion("0.9.9.2");
checkVersion("0.9.9.3");
volumeObjTest("box", "-1,-1,-1,1,1,1", 0.1, 8.0, 1e-6);
volumeObjTest("sphere", "0,0,0,1.0", 0.001, 4.189, 1e-2);

Expand Down Expand Up @@ -118,7 +118,7 @@ static Result execute(BiFunction<String, String, Boolean> eval, String... args)
String cmdName = "../build/bin/occ-csg";

if (System.getProperty("os.name").toLowerCase().contains("win")) {
cmdName = "../build/bin/occ-csg.exe";
cmdName = "../build/bin/Release/occ-csg.exe";
}

String[] cmd = Stream.concat(Arrays.stream(new String[] { cmdName }), Arrays.stream(args))
Expand Down
14 changes: 14 additions & 0 deletions vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "occ-csg",
"version-string": "0.9.9.3",
"dependencies": [
{
"name": "opencascade",
"default-features": false,
"features": [
"freeimage",
"tbb"
]
}
]
}

0 comments on commit dbb9200

Please sign in to comment.