diff --git a/cpacscreator/bld.bat b/cpacscreator/bld.bat index fc5dd23..e213230 100644 --- a/cpacscreator/bld.bat +++ b/cpacscreator/bld.bat @@ -1,11 +1,6 @@ -copy %RECIPE_DIR%\boost-patch\* thirdparty\ - mkdir build cd build -REM Remove dot from PY_VER for use in library name -set MY_PY_VER=%PY_VER:.=% - REM We need own flags as conda turns on program size optimization REM which ends up in huge static library sizes set CFLAGS= @@ -18,20 +13,30 @@ cmake -G "Ninja" -DCMAKE_INSTALL_PREFIX="%LIBRARY_PREFIX%" ^ -DTIGL_VIEWER=ON ^ -DTIGL_BINDINGS_PYTHON_INTERNAL=ON ^ -DPythonOCC_SOURCE_DIR="%LIBRARY_PREFIX%"\src\pythonocc-core ^ - -DPYTHON_EXECUTABLE:FILEPATH="%PYTHON%" ^ - -DPYTHON_INCLUDE_DIR:PATH="%PREFIX%"/include ^ -DTIGL_CONCAT_GENERATED_FILES=OFF ^ - -DPYTHON_LIBRARY:FILEPATH="%PREFIX%"/libs/python%MY_PY_VER%.lib ^ + -DPython3_FIND_STRATEGY=LOCATION ^ + -DPython3_FIND_REGISTRY=NEVER ^ .. if errorlevel 1 exit 1 REM Build step -cmake --build . +cmake --build . --config Release if errorlevel 1 exit 1 REM Install step -cmake --build . --target install +cmake --build . --target install --config Release if errorlevel 1 exit 1 REM install python packages move %LIBRARY_PREFIX%\share\tigl3\python\tigl3 %SP_DIR% + +REM The egg-info file is necessary because some packages, +REM might require cpacscreator in their setup.py. +REM See https://setuptools.readthedocs.io/en/latest/pkg_resources.html#workingset-objects + +set egg_info=%SP_DIR%\cpacscreator-%PKG_VERSION%.egg-info +echo>%egg_info% Metadata-Version: 2.1 +echo>>%egg_info% Name: cpacscreator +echo>>%egg_info% Version: %PKG_VERSION% +echo>>%egg_info% Summary: The TiGL Geometry Library to process aircraft geometries in pre-design +echo>>%egg_info% Platform: UNKNOWN \ No newline at end of file diff --git a/cpacscreator/boost-patch/CMakeLists.txt b/cpacscreator/boost-patch/CMakeLists.txt deleted file mode 100644 index 747f16e..0000000 --- a/cpacscreator/boost-patch/CMakeLists.txt +++ /dev/null @@ -1,152 +0,0 @@ -project(thirdparty-libs) - -# -------------- BOOST ----------------- # -option(TIGL_USE_INTERNAL_BOOST "Use boost library that comes with tigl" ON) -if (TIGL_USE_INTERNAL_BOOST) - -# boost -set (BOOST_DIR ${PROJECT_BINARY_DIR}/boost_1_72_0) -set (BOOST_ARCHIVE ${PROJECT_SOURCE_DIR}/boost_1_72_0.tar.gz) -set (Boost_VERSION "1.72.0") - -if (NOT EXISTS ${BOOST_DIR}) - message(STATUS "Extracting boost ${Boost_VERSION}") - execute_process ( - COMMAND ${CMAKE_COMMAND} -E tar xzf ${BOOST_ARCHIVE} - WORKING_DIRECTORY ${PROJECT_BINARY_DIR} - ) -endif() - -add_library(tigl_boost INTERFACE) -add_library(Boost::boost ALIAS tigl_boost) -target_include_directories(tigl_boost INTERFACE - $ - $ -) - -add_library(tigl_boost_disable_autolink INTERFACE) -target_compile_definitions(tigl_boost_disable_autolink INTERFACE BOOST_ALL_NO_LIB) -add_library(Boost::disable_autolinking ALIAS tigl_boost_disable_autolink) - -add_library(tigl_boost_atomic STATIC - ${BOOST_DIR}/libs/atomic/src/lockpool.cpp -) -add_library(Boost::atomic ALIAS tigl_boost_atomic) -set_property(TARGET tigl_boost_atomic PROPERTY POSITION_INDEPENDENT_CODE ON) -target_link_libraries(tigl_boost_atomic PUBLIC tigl_boost_disable_autolink tigl_boost) - -add_library(tigl_boost_chrono STATIC - ${BOOST_DIR}/libs/chrono/src/chrono.cpp - ${BOOST_DIR}/libs/chrono/src/process_cpu_clocks.cpp - ${BOOST_DIR}/libs/chrono/src/thread_clock.cpp -) - -add_library(Boost::chrono ALIAS tigl_boost_chrono) -set_property(TARGET tigl_boost_chrono PROPERTY POSITION_INDEPENDENT_CODE ON) -target_link_libraries(tigl_boost_chrono PUBLIC tigl_boost_disable_autolink tigl_boost) - -add_library(tigl_boost_date_time STATIC - ${BOOST_DIR}/libs/date_time/src/gregorian/date_generators.cpp - ${BOOST_DIR}/libs/date_time/src/gregorian/gregorian_types.cpp - ${BOOST_DIR}/libs/date_time/src/gregorian/greg_month.cpp - ${BOOST_DIR}/libs/date_time/src/gregorian/greg_weekday.cpp - ${BOOST_DIR}/libs/date_time/src/posix_time/posix_time_types.cpp -) - -add_library(Boost::date_time ALIAS tigl_boost_date_time) -set_property(TARGET tigl_boost_date_time PROPERTY POSITION_INDEPENDENT_CODE ON) -target_link_libraries(tigl_boost_date_time PUBLIC tigl_boost_disable_autolink tigl_boost) - -add_library(tigl_boost_exception STATIC - ${BOOST_DIR}/libs/exception/src/clone_current_exception_non_intrusive.cpp -) - -add_library(Boost::exception ALIAS tigl_boost_exception) -set_property(TARGET tigl_boost_exception PROPERTY POSITION_INDEPENDENT_CODE ON) -target_link_libraries(tigl_boost_exception PUBLIC tigl_boost_disable_autolink tigl_boost) - -add_library(tigl_boost_filesystem STATIC - ${BOOST_DIR}/libs/filesystem/src/codecvt_error_category.cpp - ${BOOST_DIR}/libs/filesystem/src/directory.cpp - ${BOOST_DIR}/libs/filesystem/src/exception.cpp - ${BOOST_DIR}/libs/filesystem/src/operations.cpp - ${BOOST_DIR}/libs/filesystem/src/path.cpp - ${BOOST_DIR}/libs/filesystem/src/path_traits.cpp - ${BOOST_DIR}/libs/filesystem/src/portability.cpp - ${BOOST_DIR}/libs/filesystem/src/unique_path.cpp - ${BOOST_DIR}/libs/filesystem/src/utf8_codecvt_facet.cpp - ${BOOST_DIR}/libs/filesystem/src/windows_file_codecvt.cpp -) - -target_link_libraries(tigl_boost_filesystem PUBLIC tigl_boost_disable_autolink tigl_boost) -set_property(TARGET tigl_boost_filesystem PROPERTY POSITION_INDEPENDENT_CODE ON) -add_library(Boost::filesystem ALIAS tigl_boost_filesystem) - -add_library(tigl_boost_system STATIC - ${BOOST_DIR}/libs/system/src/error_code.cpp -) - -add_library(Boost::system ALIAS tigl_boost_system) -set_property(TARGET tigl_boost_system PROPERTY POSITION_INDEPENDENT_CODE ON) -target_link_libraries(tigl_boost_system PUBLIC tigl_boost_disable_autolink tigl_boost) - -set (BOOST_THREAD_SRC - ${BOOST_DIR}/libs/thread/src/future.cpp -) - -if(WIN32) - set (BOOST_THREAD_SRC ${BOOST_THREAD_SRC} - ${BOOST_DIR}/libs/thread/src/win32/thread.cpp - ${BOOST_DIR}/libs/thread/src/win32/thread_primitives.cpp - ${BOOST_DIR}/libs/thread/src/win32/tss_dll.cpp - ${BOOST_DIR}/libs/thread/src/win32/tss_pe.cpp - ) -else() - set (BOOST_THREAD_SRC ${BOOST_THREAD_SRC} - ${BOOST_DIR}/libs/thread/src/pthread/once.cpp - ${BOOST_DIR}/libs/thread/src/pthread/thread.cpp - ) -endif() - -add_library(tigl_boost_thread STATIC ${BOOST_THREAD_SRC}) -target_link_libraries(tigl_boost_thread PUBLIC tigl_boost_disable_autolink tigl_boost) -target_compile_definitions(tigl_boost_thread PRIVATE BOOST_THREAD_BUILD_LIB) -add_library(Boost::thread ALIAS tigl_boost_thread) -set_property(TARGET tigl_boost_thread PROPERTY POSITION_INDEPENDENT_CODE ON) - - -if(WIN32) - target_compile_definitions(tigl_boost_thread PRIVATE -DBOOST_THREAD_WIN32) -else() - target_compile_definitions(tigl_boost_thread PRIVATE -DBOOST_THREAD_POSIX) -endif() - -set(Boost_LIBRARIES Boost::boost Boost::filesystem Boost::thread Boost::system Boost::atomic Boost::chrono Boost::date_time) - -if (TIGL_BINDINGS_INSTALL_CPP) - install (TARGETS - tigl_boost - tigl_boost_disable_autolink - tigl_boost_date_time - tigl_boost_filesystem - tigl_boost_chrono - tigl_boost_atomic - tigl_boost_system - tigl_boost_thread - - EXPORT tigl3_cpp-targets - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/tigl3 - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/tigl3 - COMPONENT cpp_bindings - ) - - install(DIRECTORY ${BOOST_DIR}/boost - DESTINATION include/tigl3/internal - COMPONENT cpp_bindings - PATTERN "*.h" - PATTERN "*.hpp" - ) -endif (TIGL_BINDINGS_INSTALL_CPP) - -endif(TIGL_USE_INTERNAL_BOOST) diff --git a/cpacscreator/boost-patch/boost_1_72_0.tar.gz b/cpacscreator/boost-patch/boost_1_72_0.tar.gz deleted file mode 100644 index bfd1025..0000000 Binary files a/cpacscreator/boost-patch/boost_1_72_0.tar.gz and /dev/null differ diff --git a/cpacscreator/build.sh b/cpacscreator/build.sh index a72cfae..8bc69c2 100644 --- a/cpacscreator/build.sh +++ b/cpacscreator/build.sh @@ -4,7 +4,6 @@ if [[ ${HOST} =~ .*linux.* ]]; then CMAKE_PLATFORM_FLAGS+=(-DCMAKE_TOOLCHAIN_FILE="${RECIPE_DIR}/cross-linux.cmake") fi -cp $RECIPE_DIR/boost-patch/* thirdparty/ mkdir -p build cd build @@ -17,6 +16,8 @@ cmake -G "Ninja" -DCMAKE_INSTALL_PREFIX=$PREFIX \ -DTIGL_VIEWER=ON \ -DTIGL_CONCAT_GENERATED_FILES=OFF \ -DTIGL_BINDINGS_PYTHON_INTERNAL=ON \ + -DPython3_FIND_STRATEGY=LOCATION \ + -DPython3_FIND_FRAMEWORK=NEVER \ -DPythonOCC_SOURCE_DIR=$PREFIX/src/pythonocc-core \ -DBUNDLE_APPLE=OFF \ .. @@ -32,3 +33,16 @@ ninja install mkdir -p $SP_DIR/tigl3 mv $PREFIX/share/tigl3/python/tigl3/* $SP_DIR/tigl3/ python $RECIPE_DIR/fixosxload.py $SP_DIR/tigl3/tigl3wrapper.py libtigl3 + + +# The egg-info file is necessary because some packages +# might require tigl3 in their setup.py. +# See https://setuptools.readthedocs.io/en/latest/pkg_resources.html#workingset-objects + +cat > $SP_DIR/cpacscreator-$PKG_VERSION.egg-info <