Skip to content

Commit 3e19dcc

Browse files
committed
remove boost from automated download, use last version of wxwidgets
1 parent c25904a commit 3e19dcc

File tree

6 files changed

+88
-95
lines changed

6 files changed

+88
-95
lines changed

Diff for: .github/workflows/cmake.yml

+11-4
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
sudo sed -i 's/azure\.//' /etc/apt/sources.list
2727
sudo apt-get update
2828
sudo apt-get install -y --no-install-recommends \
29+
build-essential \
2930
libgtk-3-dev \
3031
freeglut3-dev \
3132
libxmu-dev \
@@ -41,7 +42,11 @@ jobs:
4142
libgl1-mesa-dev \
4243
libglapi-mesa \
4344
byacc \
44-
gettext
45+
gettext \
46+
cmake \
47+
python3-dev \
48+
swig \
49+
libboost-all-dev
4550
- name: Cache CPM dependency packages
4651
uses: actions/cache@v3
4752
with:
@@ -56,16 +61,18 @@ jobs:
5661
cmake -DCPM_SOURCE_CACHE=${{ env.CPM_SOURCE_CACHE }} -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
5762
5863
- name: Build
64+
working-directory: ${{github.workspace}}/build
5965
# Compile i-simpa
60-
run: cd build && make
66+
run: make
6167

6268
- name: Install
69+
working-directory: ${{github.workspace}}/build
6370
# Copy stuff to bin subdirectory for "standalone" application
64-
run: cd build && make install
71+
run: make install
6572

6673
- name: Test
6774
working-directory: ${{github.workspace}}/build
6875
# Execute tests defined by the CMake configuration.
6976
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
70-
run: cd build && make test
77+
run: make test
7178

Diff for: CMakeLists.txt

-6
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,6 @@ cmake_policy(SET CMP0086 NEW)
7575
cmake_policy(SET CMP0078 NEW)
7676
cmake_policy(SET CMP0074 NEW)
7777

78-
# configure boost for inclusion in builds
79-
80-
set(BOOST_INCLUDE_LIBRARIES system python filesystem regex algorithm thread test random)
81-
set(BOOST_ENABLE_PYTHON ON)
82-
83-
8478
# Command to output information to the console
8579
# Useful for displaying errors, warnings, and debugging
8680
message (STATUS "cxx Flags: " ${CMAKE_CXX_FLAGS})

Diff for: src/isimpa/CMakeLists.txt

+41-47
Original file line numberDiff line numberDiff line change
@@ -386,47 +386,9 @@ set_property(SOURCE data_manager/python_interface/py_ui_module/element_pywrap.cp
386386

387387
configure_file(data_manager/appconfig_version.cpp.in ${CMAKE_CURRENT_BINARY_DIR}/generated/appconfig_version.cpp )
388388

389-
CPMAddPackage(
390-
NAME Boost
391-
VERSION 1.81.0
392-
GITHUB_REPOSITORY "boostorg/boost"
393-
GIT_TAG "boost-1.81.0"
394-
)
395-
396-
# add wxWidgets as dependency
397-
398-
find_package(wxWidgets)
399-
400-
if(wxWidgets_FOUND)
401-
402-
if(CMAKE_BUILD_TYPE STREQUAL Debug)
403-
if(NOT ${wxWidgets_CONFIGURATION} MATCHES .*d$ )
404-
set(wxWidgets_CONFIGURATION ${wxWidgets_CONFIGURATION}d)
405-
endif()
406-
else()
407-
if(${wxWidgets_CONFIGURATION} MATCHES .*d$ )
408-
string(LENGTH ${wxWidgets_CONFIGURATION} BUILD_STR_SIZE)
409-
MATH(EXPR BUILD_STR_SIZE "${BUILD_STR_SIZE}-1")
410-
string(SUBSTRING ${wxWidgets_CONFIGURATION} 0 ${BUILD_STR_SIZE} wxWidgets_CONFIGURATION)
411-
endif()
412-
endif()
413-
414-
find_package(wxWidgets COMPONENTS core base xml gl aui adv html REQUIRED)
415-
416-
include(${wxWidgets_USE_FILE})
417-
else(NOT wxWidgets_FOUND)
418-
set(USING_CPM true)
419-
set(BUILD_SHARED_LIBS OFF)
420-
set(CPM_DOWNLOAD_VERSION 0.34.0)
421-
422-
include(${CPM_DOWNLOAD_LOCATION})
423-
424-
CPMAddPackage(
425-
NAME wxWidgets
426-
GIT_REPOSITORY https://github.com/wxWidgets/wxWidgets
427-
GIT_TAG v3.1.6
428-
)
429-
endif()
389+
set(Boost_USE_STATIC_LIBS OFF)
390+
find_package(Boost REQUIRED COMPONENTS system python filesystem regex random)
391+
link_directories( ${Boost_LIBRARY_DIRS} )
430392

431393
# Set Properties->General->Configuration Type to Application
432394
# Creates isimpa with the listed sources
@@ -477,6 +439,8 @@ IF(GETTEXT_FOUND )
477439
add_dependencies(isimpa pofiles)
478440
ENDIF()
479441

442+
SET(wxUSE_GLCANVAS_EGL OFF)
443+
480444
IF(CMAKE_BUILD_TYPE STREQUAL "Debug")
481445
SET(wxWidgets_USE_DEBUG ON)
482446
SET(wxWidgets_USE_STATIC OFF)
@@ -490,19 +454,49 @@ ENDIF()
490454
SET(CMAKE_EXE_LINKER_FLAGS
491455
"${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath -Wl,/usr/local/lib")
492456

493-
#find_package(wxWidgets COMPONENTS core base xml gl aui adv html REQUIRED)
494-
# include(${wxWidgets_USE_FILE})
457+
# add wxWidgets as dependency
458+
459+
find_package(wxWidgets)
460+
461+
if(wxWidgets_FOUND)
462+
463+
if(CMAKE_BUILD_TYPE STREQUAL Debug)
464+
if(NOT ${wxWidgets_CONFIGURATION} MATCHES .*d$ )
465+
set(wxWidgets_CONFIGURATION ${wxWidgets_CONFIGURATION}d)
466+
endif()
467+
else()
468+
if(${wxWidgets_CONFIGURATION} MATCHES .*d$ )
469+
string(LENGTH ${wxWidgets_CONFIGURATION} BUILD_STR_SIZE)
470+
MATH(EXPR BUILD_STR_SIZE "${BUILD_STR_SIZE}-1")
471+
string(SUBSTRING ${wxWidgets_CONFIGURATION} 0 ${BUILD_STR_SIZE} wxWidgets_CONFIGURATION)
472+
endif()
473+
endif()
474+
475+
find_package(wxWidgets COMPONENTS core base xml gl aui adv html REQUIRED)
476+
477+
include(${wxWidgets_USE_FILE})
478+
else(NOT wxWidgets_FOUND)
479+
set(USING_CPM true)
480+
set(BUILD_SHARED_LIBS OFF)
481+
set(CPM_DOWNLOAD_VERSION 0.34.0)
482+
483+
include(${CPM_DOWNLOAD_LOCATION})
484+
485+
CPMAddPackage(
486+
NAME wxWidgets
487+
GIT_REPOSITORY https://github.com/wxWidgets/wxWidgets
488+
GIT_TAG v3.2.1
489+
)
490+
endif()
495491

496492
# Find package for buildingfind_package(Python3 COMPONENTS Interpreter Development)
497493
FIND_PACKAGE(PythonLibs "${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}" REQUIRED)
498494
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import sys; import sysconfig; print(list(sysconfig.get_paths().values()))"
499495
OUTPUT_VARIABLE PYTHON_SITE_PACKAGES OUTPUT_STRIP_TRAILING_WHITESPACE)
500496

501-
find_package(OpenGL REQUIRED)
497+
FIND_PACKAGE(OpenGL REQUIRED COMPONENTS OpenGL EGL)
502498
include_directories(${OPENGL_INCLUDE_DIRS})
503499
include_directories(${wxWidgets_SOURCE_DIR})
504-
link_directories( ${Boost_LIBRARY_DIRS} )
505-
include_directories(${Boost_INCLUDE_DIRS} )
506500
include_directories(${PYTHON_INCLUDE_PATH})
507501

508502
# Properties->Linker->Input->Additional Dependencies
@@ -513,7 +507,7 @@ if(WIN32 AND MSVC)
513507
endif()
514508

515509
if(USING_CPM)
516-
target_link_libraries(isimpa wx::core wx::base wx::aui)
510+
target_link_libraries(isimpa wx::core wx::base wx::aui wx::adv wx::xml wx::html wx::gl)
517511
else()
518512
target_link_libraries(isimpa ${wxWidgets_LIBRARIES})
519513
endif()

Diff for: src/lib_interface/CMakeLists.txt

+15-13
Original file line numberDiff line numberDiff line change
@@ -113,15 +113,10 @@ source_group( "tools" FILES ${TOOLS_SOURCES} )
113113
# DEPENDENCY & EXECUTABLE (OR LIB)
114114
#---------------------------------------#
115115

116-
# set(Boost_USE_STATIC_LIBS OFF)
117-
# find_package(Boost COMPONENTS REQUIRED system filesystem regex)
118-
119-
CPMAddPackage(
120-
NAME Boost
121-
VERSION 1.81.0
122-
GITHUB_REPOSITORY "boostorg/boost"
123-
GIT_TAG "boost-1.81.0"
124-
)
116+
set(Boost_USE_STATIC_LIBS OFF)
117+
find_package(Boost COMPONENTS REQUIRED system filesystem regex)
118+
link_directories( ${Boost_LIBRARY_DIRS} )
119+
include_directories( ${Boost_INCLUDE_DIRS} )
125120

126121
add_library(lib_interface
127122
${LIBINTERFACE_SOURCES}
@@ -140,7 +135,9 @@ add_library(lib_interface
140135
set_property(TARGET lib_interface PROPERTY FOLDER "libraries")
141136

142137
target_link_libraries (lib_interface
143-
Boost::system Boost::filesystem Boost::regex Boost::thread Boost::algorithm)
138+
${Boost_FILESYSTEM_LIBRARY}
139+
${Boost_SYSTEM_LIBRARY}
140+
${Boost_REGEX_LIBRARY})
144141

145142
#------------#
146143
# TEST 1
@@ -155,10 +152,14 @@ file(COPY tests/speaker-test1.txt tests/speaker-test2.txt
155152
set(LIBINTERFACE_TESTS
156153
tests/balloon_test.cpp)
157154

155+
set(Boost_USE_STATIC_LIBS ON)
156+
find_package(Boost COMPONENTS regex unit_test_framework timer chrono filesystem REQUIRED)
157+
158158
add_executable(TEST_lib_interface ${LIBINTERFACE_TESTS})
159159

160160
target_link_libraries (TEST_lib_interface
161-
lib_interface Boost::system Boost::filesystem Boost::regex Boost::thread Boost::algorithm Boost::unit_test_framework)
161+
lib_interface
162+
${Boost_LIBRARIES})
162163

163164
set_property(TARGET TEST_lib_interface PROPERTY FOLDER "tests")
164165

@@ -184,8 +185,9 @@ file(COPY tests/cube.cbin tests/cube_mesh.mbin tests/test_import1.poly
184185
add_executable(TEST_io_lib_interface tests/io_test.cpp )
185186

186187

187-
target_link_libraries (TEST_io_lib_interface lib_interface
188-
lib_interface Boost::system Boost::filesystem Boost::regex Boost::thread Boost::algorithm Boost::unit_test_framework)
188+
target_link_libraries (TEST_io_lib_interface
189+
lib_interface
190+
${Boost_LIBRARIES})
189191

190192

191193
set_property(TARGET TEST_io_lib_interface PROPERTY FOLDER "tests")

Diff for: src/python_bindings/CMakeLists.txt

+6-15
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ FIND_PACKAGE(SWIG REQUIRED)
1313
INCLUDE(${SWIG_USE_FILE})
1414

1515
# Find package for building
16-
FIND_PACKAGE(PythonLibs 3.10 EXACT REQUIRED)
16+
FIND_PACKAGE(PythonLibs REQUIRED)
1717
# Find package for testing
18-
FIND_PACKAGE(PythonInterp 3.10 EXACT REQUIRED)
18+
FIND_PACKAGE(PythonInterp REQUIRED)
1919

2020
INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
2121

@@ -27,18 +27,9 @@ SET(CMAKE_SWIG_FLAGS "")
2727

2828
SET_SOURCE_FILES_PROPERTIES(libsimpa.i PROPERTIES CPLUSPLUS ON)
2929

30-
#set(Boost_USE_STATIC_LIBS OFF)
31-
#find_package(Boost COMPONENTS system filesystem regex REQUIRED)
32-
#link_directories( ${Boost_LIBRARY_DIRS})
33-
34-
CPMAddPackage(
35-
NAME Boost
36-
VERSION 1.81.0
37-
GITHUB_REPOSITORY "boostorg/boost"
38-
GIT_TAG "boost-1.81.0"
39-
FIND_PACKAGE_ARGUMENTS "COMPONENTS program_options"
40-
)
41-
30+
set(Boost_USE_STATIC_LIBS OFF)
31+
find_package(Boost COMPONENTS system filesystem regex REQUIRED)
32+
link_directories( ${Boost_LIBRARY_DIRS})
4233

4334
IF (${CMAKE_VERSION} VERSION_LESS "3.8.0")
4435
SWIG_ADD_MODULE(libsimpa python libsimpa.i)
@@ -138,4 +129,4 @@ add_test(NAME check_retrocompat_recsurf
138129

139130
set_property(TEST test_modelio check_retrocompat check_retrocompat_mesh check_retrocompat_gabe test_math check_retrocompat_recsurf
140131
PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_INSTALL_PREFIX}"
141-
)
132+
)

Diff for: src/spps/CMakeLists.txt

+15-10
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,17 @@ source_group("" FILES ${SPPS_SOURCES} $(SPPS_MAIN_SOURCES))
5454
# DEPENDENCY & EXECUTABLE (OR LIB)
5555
#---------------------------------------#
5656

57-
CPMAddPackage(
58-
NAME Boost
59-
VERSION 1.81.0
60-
GITHUB_REPOSITORY "boostorg/boost"
61-
GIT_TAG "boost-1.81.0"
62-
)
57+
set(Boost_USE_STATIC_LIBS OFF)
58+
59+
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
60+
find_package(Boost REQUIRED COMPONENTS system random filesystem regex)
61+
else()
62+
find_package (Threads)
63+
find_package(Boost REQUIRED COMPONENTS system random filesystem regex thread chrono date_time)
64+
endif()
65+
66+
link_directories( ${Boost_LIBRARY_DIRS} )
67+
include_directories( ${Boost_INCLUDE_DIRS} )
6368

6469
# Check for clock_gettime function
6570
if (UNIX)
@@ -87,10 +92,7 @@ set_property(TARGET spps PROPERTY FOLDER "executables")
8792

8893

8994
# Properties->Linker->Input->Additional Dependencies
90-
target_link_libraries (spps lib_interface)
91-
92-
target_link_libraries (spps
93-
Boost::system Boost::filesystem Boost::regex Boost::thread Boost::algorithm Boost::thread Boost::chrono Boost::date_time)
95+
target_link_libraries (spps lib_interface ${Boost_LIBRARIES})
9496

9597

9698
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
@@ -154,6 +156,9 @@ file(COPY
154156
set(SPPS_TESTS
155157
tests/spps_core_test.cpp)
156158

159+
set(Boost_USE_STATIC_LIBS ON)
160+
find_package(Boost COMPONENTS filesystem regex unit_test_framework timer chrono REQUIRED)
161+
157162
add_executable(TEST_spps ${SPPS_TESTS}
158163
${DATA_MANAGER_SOURCES}
159164
${IO_SOURCES}

0 commit comments

Comments
 (0)