Skip to content

Commit

Permalink
fix cmake windows
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-f committed Oct 9, 2024
1 parent 9f07dd6 commit 2721aab
Show file tree
Hide file tree
Showing 10 changed files with 63 additions and 60 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/sub_buildWindows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,17 @@ jobs:
. $env:ccachebindir\ccache -s
. $env:ccachebindir\ccache -z
. $env:ccachebindir\ccache -p
- name: Install NuGet Packages
shell: powershell
run: |
nuget install swigwintools -OutputDirectory "${{ env.builddir }}/Tools" -Version 4.2.0
- name: Configuring CMake
run: >
cmake -B"${{ env.builddir }}" .
-DCPM_SOURCE_CACHE=${{ env.CPM_SOURCE_CACHE }}
-DCMAKE_VS_NO_COMPILE_BATCHING=ON
-DCMAKE_BUILD_TYPE=Release
-DSWIG_EXECUTABLE=${{ env.builddir }}/swigwintools.4.2.0/tools/swigwin-4.2.0/swig.exe
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Compiling sources
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,4 @@ files.txt
.vscode
.vs
.DS_Store
out/
27 changes: 27 additions & 0 deletions CMakeSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"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": ""
},
{
"name": "x64-Release",
"generator": "Ninja",
"configurationType": "RelWithDebInfo",
"buildRoot": "${projectDir}\\out\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "",
"ctestCommandArgs": "",
"inheritEnvironments": [ "msvc_x64_x64" ],
"variables": []
}
]
}
2 changes: 1 addition & 1 deletion cmake/SetupBoost.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ macro(SetupBoost)
VERSION 1.86.0
URL https://github.com/boostorg/boost/releases/download/boost-1.86.0/boost-1.86.0-cmake.tar.xz
URL_HASH SHA256=2c5ec5edcdff47ff55e27ed9560b0a0b94b07bd07ed9928b476150e16b0efc57
OPTIONS "BOOST_ENABLE_CMAKE ON" "BOOST_INCLUDE_LIBRARIES system\\\;algorithm\\\;random\\\;filesystem\\\;regex\\\;thread\\\;chrono\\\;test\\\;date_time\\\;python\\\;numeric" # Note the escapes!
OPTIONS "BOOST_ENABLE_CMAKE ON" "BOOST_INCLUDE_LIBRARIES system\\\;algorithm\\\;random\\\;filesystem\\\;regex\\\;thread\\\;chrono\\\;test\\\;date_time\\\;python\\\;numeric/conversion" # Note the escapes!
)
endif()
endmacro(SetupBoost)
27 changes: 27 additions & 0 deletions cmake/SetupSWIG.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

CPMAddPackage(
NAME SWIG
VERSION 4.2.1
URL https://github.com/swig/swig/archive/refs/tags/v4.2.1.tar.gz
URL_HASH SHA256=8895878b9215612e73611203dc8f5232c626e4d07ffc4532922f375518f067ca
OPTIONS "WITH_PCRE OFF"
"SWIG_BUILD_EXAMPLES OFF"
"SWIG_CSHARP OFF"
"SWIG_JAVA OFF"
"SWIG_JAVASCRIPT OFF"
"SWIG_LUA OFF"
"SWIG_OCTAVE OFF"
"SWIG_PERL OFF"
"SWIG_PHP OFF"
"SWIG_PYTHON ON"
"SWIG_R OFF"
"SWIG_RUBY OFF"
"SWIG_TCL OFF"
)

if(SWIG_ADDED)
message(STATUS "SWIG added successfully: ${SWIG_SOURCE_DIR}")
set(SWIG_EXECUTABLE ${SWIG_SOURCE_DIR}/swig)
else()
message(FATAL_ERROR "Failed to add SWIG")
endif()
12 changes: 0 additions & 12 deletions src/VolumetricMeshRepair/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,6 @@ target_link_libraries (vmr lib_interface)
# Adds logic to INSTALL.vcproj to copy vmr to destination directory
install (TARGETS vmr
RUNTIME DESTINATION meshing/vmr)

if(WIN32)
# Resolve symbolic link
LIB_TO_DLL(${Boost_FILESYSTEM_LIBRARY_RELEASE} Boost_FILESYSTEM_LIBRARY_RELEASE_REAL)
LIB_TO_DLL(${Boost_SYSTEM_LIBRARY_RELEASE} Boost_SYSTEM_LIBRARY_RELEASE_REAL)
LIB_TO_DLL(${Boost_REGEX_LIBRARY_RELEASE} Boost_REGEX_LIBRARY_RELEASE_REAL)
install (FILES
${Boost_FILESYSTEM_LIBRARY_RELEASE_REAL}
${Boost_SYSTEM_LIBRARY_RELEASE_REAL}
${Boost_REGEX_LIBRARY_RELEASE_REAL}
DESTINATION meshing/vmr)
endif()

if( CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS )
install( PROGRAMS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} DESTINATION meshing/vmr COMPONENT System )
Expand Down
12 changes: 0 additions & 12 deletions src/ctr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,6 @@ target_link_libraries(classicalTheory ${Boost_LIBRARIES})
install (TARGETS classicalTheory
RUNTIME DESTINATION core/classical_theory)

if (WIN32)
# Resolve symbolic link
LIB_TO_DLL(${Boost_FILESYSTEM_LIBRARY_RELEASE} Boost_FILESYSTEM_LIBRARY_RELEASE_REAL)
LIB_TO_DLL(${Boost_SYSTEM_LIBRARY_RELEASE} Boost_SYSTEM_LIBRARY_RELEASE_REAL)
LIB_TO_DLL(${Boost_REGEX_LIBRARY_RELEASE} Boost_REGEX_LIBRARY_RELEASE_REAL)
install (FILES
${Boost_FILESYSTEM_LIBRARY_RELEASE_REAL}
${Boost_SYSTEM_LIBRARY_RELEASE_REAL}
${Boost_REGEX_LIBRARY_RELEASE_REAL}
DESTINATION core/classical_theory)
endif ()

if( CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS )
install( PROGRAMS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} DESTINATION core/classical_theory COMPONENT System )
endif( CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS )
4 changes: 2 additions & 2 deletions src/isimpa/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ IF(CMAKE_BUILD_TYPE STREQUAL "Debug")
ELSE()
SET(wxWidgets_USE_DEBUG OFF)
SET(wxWidgets_USE_STATIC OFF)
MESSAGE(STATUS "Using dynamic wxWidgets library lib:${wxWidgets_LIB_DIR} include:${wxWidgets_ROOT_DIR}")
#MESSAGE(STATUS "Using dynamic wxWidgets library lib:${wxWidgets_LIB_DIR} include:${wxWidgets_ROOT_DIR}")
ENDIF()

SET(CMAKE_EXE_LINKER_FLAGS
Expand Down Expand Up @@ -552,7 +552,7 @@ if(WIN32) # Check if we are on Windows
set(PYTHON_LIB_FOLDER ${PYTHON_ROOT_FOLDER}/Lib)

#Fetch required Dll's for GUI
string(REPLACE "\\" "/" wxWidgets_LIB_DIR_SLASH ${wxWidgets_LIB_DIR})
#string(REPLACE "\\" "/" wxWidgets_LIB_DIR_SLASH ${wxWidgets_LIB_DIR})
set(DIRS ${Boost_LIBRARY_DIR_DEBUG}
${Boost_LIBRARY_DIR_RELEASE}
${wxWidgets_LIB_DIR_SLASH}
Expand Down
12 changes: 0 additions & 12 deletions src/preprocess/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,6 @@ target_link_libraries (preprocess lib_interface)
# Adds logic to INSTALL.vcproj to copy preprocess to destination directory
install (TARGETS preprocess
RUNTIME DESTINATION meshing/tetgen)
if(WIN32)
# Resolve symbolic link
LIB_TO_DLL(${Boost_FILESYSTEM_LIBRARY_RELEASE} Boost_FILESYSTEM_LIBRARY_RELEASE_REAL)
LIB_TO_DLL(${Boost_SYSTEM_LIBRARY_RELEASE} Boost_SYSTEM_LIBRARY_RELEASE_REAL)
LIB_TO_DLL(${Boost_REGEX_LIBRARY_RELEASE} Boost_REGEX_LIBRARY_RELEASE_REAL)

install (FILES
${Boost_FILESYSTEM_LIBRARY_RELEASE_REAL}
${Boost_SYSTEM_LIBRARY_RELEASE_REAL}
${Boost_REGEX_LIBRARY_RELEASE_REAL}
DESTINATION meshing/tetgen)
endif()

if( CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS )
install( PROGRAMS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} DESTINATION meshing/tetgen COMPONENT System )
Expand Down
21 changes: 0 additions & 21 deletions src/spps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,27 +102,6 @@ endif()
install (TARGETS spps
RUNTIME DESTINATION core/spps)


if(WIN32)
# Resolve symbolic link
LIB_TO_DLL(${Boost_FILESYSTEM_LIBRARY_RELEASE} Boost_FILESYSTEM_LIBRARY_RELEASE_REAL)
LIB_TO_DLL(${Boost_SYSTEM_LIBRARY_RELEASE} Boost_SYSTEM_LIBRARY_RELEASE_REAL)
LIB_TO_DLL(${Boost_RANDOM_LIBRARY_RELEASE} Boost_RANDOM_LIBRARY_RELEASE_REAL)
LIB_TO_DLL(${Boost_REGEX_LIBRARY_RELEASE} Boost_REGEX_LIBRARY_RELEASE_REAL)
LIB_TO_DLL(${Boost_THREAD_LIBRARY_RELEASE} Boost_THREAD_LIBRARY_RELEASE_REAL)
LIB_TO_DLL(${Boost_CHRONO_LIBRARY_RELEASE} Boost_CHRONO_LIBRARY_RELEASE_REAL)
LIB_TO_DLL(${Boost_DATE_TIME_LIBRARY_RELEASE} Boost_DATE_TIME_LIBRARY_RELEASE_REAL)
install (FILES
${Boost_FILESYSTEM_LIBRARY_RELEASE_REAL}
${Boost_SYSTEM_LIBRARY_RELEASE_REAL}
${Boost_REGEX_LIBRARY_RELEASE_REAL}
${Boost_RANDOM_LIBRARY_RELEASE_REAL}
${Boost_THREAD_LIBRARY_RELEASE_REAL}
${Boost_CHRONO_LIBRARY_RELEASE_REAL}
${Boost_DATE_TIME_LIBRARY_RELEASE_REAL}
DESTINATION core/spps)
endif()

if( CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS )
install( PROGRAMS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} DESTINATION core/spps COMPONENT System )
endif( CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS )
Expand Down

0 comments on commit 2721aab

Please sign in to comment.