From 7b1a6dc45291786b469fc3baeb8e00867f2f4afa Mon Sep 17 00:00:00 2001 From: Nat! Date: Tue, 30 Jan 2024 13:59:53 +0100 Subject: [PATCH] fix cmake for windows --- .mulle/share/env/environment-plugin.sh | 2 +- .mulle/share/env/environment.sh | 27 ++++++----- .mulle/share/env/tool-plugin | 1 - .mulle/share/env/version | 2 +- .mulle/share/sde/version/mulle-sde/cmake | 2 +- cmake/share/Environment.cmake | 53 +++++++++++---------- test/.mulle/share/env/environment-plugin.sh | 2 +- test/.mulle/share/env/environment.sh | 27 ++++++----- test/.mulle/share/env/tool-plugin | 1 - test/.mulle/share/env/version | 2 +- 10 files changed, 62 insertions(+), 57 deletions(-) diff --git a/.mulle/share/env/environment-plugin.sh b/.mulle/share/env/environment-plugin.sh index 89a692f..3d40352 100644 --- a/.mulle/share/env/environment-plugin.sh +++ b/.mulle/share/env/environment-plugin.sh @@ -22,6 +22,6 @@ export MULLE_SOURCETREE_SYMLINK='YES' # # # -export MULLE_SDE_INSTALLED_VERSION="3.0.0" +export MULLE_SDE_INSTALLED_VERSION="3.1.0" diff --git a/.mulle/share/env/environment.sh b/.mulle/share/env/environment.sh index c985991..a859bc2 100644 --- a/.mulle/share/env/environment.sh +++ b/.mulle/share/env/environment.sh @@ -41,7 +41,7 @@ case "${MULLE_SHELL_MODE}" in ;; *\\h*) - PS1="$(sed 's/\\h/\\h\['${envname}'\]/' <<< "${PS1}" )" + PS1="$( PATH=/bin:/usr/bin sed 's/\\h/\\h\['${envname}'\]/' <<< "${PS1}" )" ;; *) @@ -82,7 +82,7 @@ case "${MULLE_SHELL_MODE}" in unset FILENAME vardir="${MULLE_VIRTUAL_ROOT}/.mulle/var/${MULLE_HOSTNAME:-unknown-host}" - [ -d "${vardir}" ] || mkdir -p "${vardir}" + [ -d "${vardir}" ] || PATH=/bin:/usr/bin mkdir -p "${vardir}" HISTFILE="${vardir}/bash_history" export HISTFILE @@ -117,37 +117,38 @@ unset TRACE case "${MULLE_SHELL_MODE}" in *INTERACTIVE*) - if [ -z "" ] + if [ -z "${MULLE_SDE_NO_ALIAS}" ] then - alias craftorder="mulle-sde craftorder" alias clean="mulle-sde clean" alias craft="mulle-sde craft" + alias craftorder="mulle-sde craftorder" alias dependency="mulle-sde dependency" alias environment="mulle-sde environment" alias extension="mulle-sde extension" alias fetch="mulle-sde fetch" - alias show="mulle-sde show" - alias list="mulle-sde list" alias library="mulle-sde library" + alias list="mulle-sde list" alias log="mulle-sde log" alias match="mulle-sde match" alias monitor="mulle-sde monitor" - alias reflect="mulle-sde reflect" alias patternfile="mulle-sde patternfile" + alias reflect="mulle-sde reflect" + alias run="mulle-sde run" + alias show="mulle-sde show" alias subproject="mulle-sde subproject" fi - if [ -z "" ] + if [ -z "${MULLE_SDE_NO_QUICK_ALIAS}" ] then - alias c="mulle-sde craft" alias C="mulle-sde clean; mulle-sde craft" + alias c="mulle-sde craft" alias CC="mulle-sde clean all; mulle-sde craft" - alias t="mulle-sde test rerun --serial" - alias tt="mulle-sde test craft ; mulle-sde test rerun --serial" + alias l="mulle-sde list --files" + alias r="mulle-sde reflect" alias T="mulle-sde test craft ; mulle-sde test" + alias t="mulle-sde test rerun --serial" alias TT="mulle-sde test clean all; mulle-sde test" - alias r="mulle-sde reflect" - alias l="mulle-sde list --files" + alias tt="mulle-sde test craft ; mulle-sde test rerun --serial" fi ;; esac diff --git a/.mulle/share/env/tool-plugin b/.mulle/share/env/tool-plugin index da5adfe..7df5153 100644 --- a/.mulle/share/env/tool-plugin +++ b/.mulle/share/env/tool-plugin @@ -41,7 +41,6 @@ make mkdir;required mknod more -more;required mount mulle-column mv;required diff --git a/.mulle/share/env/version b/.mulle/share/env/version index 91ff572..26d99a2 100644 --- a/.mulle/share/env/version +++ b/.mulle/share/env/version @@ -1 +1 @@ -5.2.0 +5.2.1 diff --git a/.mulle/share/sde/version/mulle-sde/cmake b/.mulle/share/sde/version/mulle-sde/cmake index 1b58cc1..83b4730 100644 --- a/.mulle/share/sde/version/mulle-sde/cmake +++ b/.mulle/share/sde/version/mulle-sde/cmake @@ -1 +1 @@ -0.27.0 +0.27.1 diff --git a/cmake/share/Environment.cmake b/cmake/share/Environment.cmake index 6dc44f2..5edc7a7 100644 --- a/cmake/share/Environment.cmake +++ b/cmake/share/Environment.cmake @@ -30,6 +30,25 @@ if( NOT __ENVIRONMENT__CMAKE__) set( MULLE_VIRTUAL_ROOT "${PROJECT_SOURCE_DIR}") endif() endif() + file( TO_CMAKE_PATH ${MULLE_VIRTUAL_ROOT} MULLE_VIRTUAL_ROOT) + + macro( mulle_append_unique_existing_path list_name item) + set( item_index -1) # supposedly makes local + list( FIND ${list_name} "${item}" item_index) + if( ${item_index} EQUAL -1) + if( NOT EXISTS "${item}") + list( APPEND ${list_name} "${item}") + endif() + endif() + endmacro() + + macro( mulle_append_list list_name other_list) + set( item "") # supposedly makes local + foreach( item ${${other_list}}) + list( APPEND ${list_name} "${item}") + endforeach() + endmacro() + # # MULLE_SDK is dependency/addiction. Not sysroot! @@ -85,25 +104,8 @@ if( NOT __ENVIRONMENT__CMAKE__) endif() endif() - - macro( mulle_append_unique_existing_path list_name item) - set( item_index -1) # supposedly makes local - list( FIND ${list_name} "${item}" item_index) - if( ${item_index} EQUAL -1) - if( NOT EXISTS "${item}") - list( APPEND ${list_name} "${item}") - endif() - endif() - endmacro() - - macro( mulle_append_list list_name other_list) - set( item "") # supposedly makes local - foreach( item ${${other_list}}) - list( APPEND ${list_name} "${item}") - endforeach() - endmacro() - - message( STATUS "DEPENDENCY_DIR=\"${DEPENDENCY_DIR}\"") + # needed for windows + file( TO_CMAKE_PATH ${DEPENDENCY_DIR} DEPENDENCY_DIR) list( APPEND ADDITIONAL_BIN_PATH "${DEPENDENCY_DIR}/bin") if( NOT ADDICTION_DIR) @@ -128,6 +130,9 @@ if( NOT __ENVIRONMENT__CMAKE__) set( MULLE_SDK_PATH "${DEPENDENCY_DIR}" "${ADDICTION_DIR}") + + # needed for windows + file( TO_CMAKE_PATH ${ADDICTION_DIR} ADDICTION_DIR) list( APPEND ADDITIONAL_BIN_PATH "${ADDICTION_DIR}/bin") message( STATUS "ADDICTION_DIR=\"${ADDICTION_DIR}\"") else() @@ -137,6 +142,7 @@ if( NOT __ENVIRONMENT__CMAKE__) set( MULLE_SDK_PATH "${DEPENDENCY_DIR}") endif() + # where the output is installed by other dependencies set( MULLE_SDK_DEPENDENCY_DIR "${DEPENDENCY_DIR}/${MULLE_SDK_SUBDIR}") @@ -189,10 +195,10 @@ if( NOT __ENVIRONMENT__CMAKE__) list( APPEND TMP_CMAKE_LIBRARY_PATH "${TMP_MULLE_SDK_PATH}/lib") list( APPEND TMP_CMAKE_FRAMEWORK_PATH "${TMP_MULLE_SDK_PATH}/Frameworks") else() - mulle_append_unique_existing_path( APPEND TMP_CMAKE_INCLUDE_PATH "${TMP_MULLE_SDK_PATH}/include") - mulle_append_unique_existing_path( APPEND TMP_INCLUDE_DIRS "${TMP_MULLE_SDK_PATH}/include") - mulle_append_unique_existing_path( APPEND TMP_CMAKE_LIBRARY_PATH "${TMP_MULLE_SDK_PATH}/lib") - mulle_append_unique_existing_path( APPEND TMP_CMAKE_FRAMEWORK_PATH "${TMP_MULLE_SDK_PATH}/Frameworks") + mulle_append_unique_existing_path( TMP_CMAKE_INCLUDE_PATH "${TMP_MULLE_SDK_PATH}/include") + mulle_append_unique_existing_path( TMP_INCLUDE_DIRS "${TMP_MULLE_SDK_PATH}/include") + mulle_append_unique_existing_path( TMP_CMAKE_LIBRARY_PATH "${TMP_MULLE_SDK_PATH}/lib") + mulle_append_unique_existing_path( TMP_CMAKE_FRAMEWORK_PATH "${TMP_MULLE_SDK_PATH}/Frameworks") endif() # @@ -250,7 +256,6 @@ if( NOT __ENVIRONMENT__CMAKE__) unset( TMP_FRAMEWORK_PATH) endif() - # # add "d" to library names on windows MSVC for debugging libraries # diff --git a/test/.mulle/share/env/environment-plugin.sh b/test/.mulle/share/env/environment-plugin.sh index 89a692f..3d40352 100644 --- a/test/.mulle/share/env/environment-plugin.sh +++ b/test/.mulle/share/env/environment-plugin.sh @@ -22,6 +22,6 @@ export MULLE_SOURCETREE_SYMLINK='YES' # # # -export MULLE_SDE_INSTALLED_VERSION="3.0.0" +export MULLE_SDE_INSTALLED_VERSION="3.1.0" diff --git a/test/.mulle/share/env/environment.sh b/test/.mulle/share/env/environment.sh index c985991..a859bc2 100644 --- a/test/.mulle/share/env/environment.sh +++ b/test/.mulle/share/env/environment.sh @@ -41,7 +41,7 @@ case "${MULLE_SHELL_MODE}" in ;; *\\h*) - PS1="$(sed 's/\\h/\\h\['${envname}'\]/' <<< "${PS1}" )" + PS1="$( PATH=/bin:/usr/bin sed 's/\\h/\\h\['${envname}'\]/' <<< "${PS1}" )" ;; *) @@ -82,7 +82,7 @@ case "${MULLE_SHELL_MODE}" in unset FILENAME vardir="${MULLE_VIRTUAL_ROOT}/.mulle/var/${MULLE_HOSTNAME:-unknown-host}" - [ -d "${vardir}" ] || mkdir -p "${vardir}" + [ -d "${vardir}" ] || PATH=/bin:/usr/bin mkdir -p "${vardir}" HISTFILE="${vardir}/bash_history" export HISTFILE @@ -117,37 +117,38 @@ unset TRACE case "${MULLE_SHELL_MODE}" in *INTERACTIVE*) - if [ -z "" ] + if [ -z "${MULLE_SDE_NO_ALIAS}" ] then - alias craftorder="mulle-sde craftorder" alias clean="mulle-sde clean" alias craft="mulle-sde craft" + alias craftorder="mulle-sde craftorder" alias dependency="mulle-sde dependency" alias environment="mulle-sde environment" alias extension="mulle-sde extension" alias fetch="mulle-sde fetch" - alias show="mulle-sde show" - alias list="mulle-sde list" alias library="mulle-sde library" + alias list="mulle-sde list" alias log="mulle-sde log" alias match="mulle-sde match" alias monitor="mulle-sde monitor" - alias reflect="mulle-sde reflect" alias patternfile="mulle-sde patternfile" + alias reflect="mulle-sde reflect" + alias run="mulle-sde run" + alias show="mulle-sde show" alias subproject="mulle-sde subproject" fi - if [ -z "" ] + if [ -z "${MULLE_SDE_NO_QUICK_ALIAS}" ] then - alias c="mulle-sde craft" alias C="mulle-sde clean; mulle-sde craft" + alias c="mulle-sde craft" alias CC="mulle-sde clean all; mulle-sde craft" - alias t="mulle-sde test rerun --serial" - alias tt="mulle-sde test craft ; mulle-sde test rerun --serial" + alias l="mulle-sde list --files" + alias r="mulle-sde reflect" alias T="mulle-sde test craft ; mulle-sde test" + alias t="mulle-sde test rerun --serial" alias TT="mulle-sde test clean all; mulle-sde test" - alias r="mulle-sde reflect" - alias l="mulle-sde list --files" + alias tt="mulle-sde test craft ; mulle-sde test rerun --serial" fi ;; esac diff --git a/test/.mulle/share/env/tool-plugin b/test/.mulle/share/env/tool-plugin index da5adfe..7df5153 100644 --- a/test/.mulle/share/env/tool-plugin +++ b/test/.mulle/share/env/tool-plugin @@ -41,7 +41,6 @@ make mkdir;required mknod more -more;required mount mulle-column mv;required diff --git a/test/.mulle/share/env/version b/test/.mulle/share/env/version index 91ff572..26d99a2 100644 --- a/test/.mulle/share/env/version +++ b/test/.mulle/share/env/version @@ -1 +1 @@ -5.2.0 +5.2.1