diff --git a/.github/workflows/Linux.yml b/.github/workflows/Linux.yml index 41ebb82..b0ff641 100644 --- a/.github/workflows/Linux.yml +++ b/.github/workflows/Linux.yml @@ -21,5 +21,5 @@ jobs: - name: upload artifact uses: actions/upload-artifact@v1 with: - name: ImCoolBar - path: bin/ImCoolBar + name: ImCoolBar_Unix + path: bin/ImCoolBar_Unix diff --git a/.github/workflows/Osx.yml b/.github/workflows/Osx.yml index 4dd8f77..772d0d9 100644 --- a/.github/workflows/Osx.yml +++ b/.github/workflows/Osx.yml @@ -21,5 +21,5 @@ jobs: - name: upload artifact uses: actions/upload-artifact@v1 with: - name: ImCoolBar.app - path: bin/ImCoolBar.app + name: ImCoolBar_Macos.app + path: bin/ImCoolBar_Macos.app diff --git a/.github/workflows/Win.yml b/.github/workflows/Win.yml index 4f8623b..898a469 100644 --- a/.github/workflows/Win.yml +++ b/.github/workflows/Win.yml @@ -19,5 +19,5 @@ jobs: - name: upload artifact uses: actions/upload-artifact@v1 with: - name: ImCoolBar_App_WIn32 - path: bin\ImCoolBarApp_WIn32.exe + name: ImCoolBarApp_Windows_x64 + path: bin\ImCoolBarApp_Windows_x64.exe diff --git a/CMakeLists.txt b/CMakeLists.txt index 970a46e..90ef653 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,10 +12,10 @@ include(cmake/3rdparty.cmake) if(MSVC) add_definitions(-DMSVC) else () - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic -Wdeprecated-declarations -Wunused-parameter") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wextra -Wpedantic -Wdeprecated-declarations -Wunused-parameter") endif () -set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) @@ -26,6 +26,25 @@ if (ENABLED_DEBUG) set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DENABLE_IMCOOLBAR_DEBUG") endif() +if ("${CMAKE_EXE_LINKER_FLAGS}" STREQUAL "/machine:x64") + set(ARCH x64) +else() + set(ARCH x32) +endif() + +if(NOT CMAKE_DEBUG_POSTFIX) + set(CMAKE_DEBUG_POSTFIX _debug) +endif() +if(NOT CMAKE_RELEASE_POSTFIX) + set(CMAKE_RELEASE_POSTFIX) ## to config in file +endif() +if(NOT CMAKE_MINSIZEREL_POSTFIX) + set(CMAKE_MINSIZEREL_POSTFIX _minsizerel) +endif() +if(NOT CMAKE_RELWITHDEBINFO_POSTFIX) + set(CMAKE_RELWITHDEBINFO_POSTFIX _reldeb) +endif() + set(FINAL_BIN_DIR ${CMAKE_SOURCE_DIR}/bin) set(CMAKE_PDB_OUTPUT_DIRECTORY_DEBUG "${FINAL_BIN_DIR}/debug") set(CMAKE_PDB_OUTPUT_DIRECTORY_RELEASE "${FINAL_BIN_DIR}/release") @@ -97,8 +116,7 @@ add_executable(${PROJECT} if (APPLE) set_target_properties(${PROJECT} PROPERTIES - OUTPUT_NAME "${PROJECT}_Macos" - MACOSX_BUNDLE_EXECUTABLE_NAME "${PROJECT}" + MACOSX_BUNDLE_EXECUTABLE_NAME "${PROJECT}_${CMAKE_SYSTEM_NAME}_${ARCH}" MACOSX_BUNDLE_BUNDLE_NAME "${PROJECT}" FOLDER "${PROJECT}" ##RESOURCE icon.icns @@ -106,10 +124,6 @@ if (APPLE) MACOSX_BUNDLE_LONG_VERSION_STRING "" ##MACOSX_BUNDLE_ICON_FILE icon.icns MACOSX_BUNDLE_INFO_PLIST "${CMAKE_SOURCE_DIR}/MacOSXBundleInfo.plist.in") -elseif(WIN32) - set_target_properties(${PROJECT} PROPERTIES OUTPUT_NAME "${PROJECT}_WIn32") -elseif(UNIX) - set_target_properties(${PROJECT} PROPERTIES OUTPUT_NAME "${PROJECT}_Unix") endif() set(CMAKE_CXX_STANDARD_REQUIRED ON) @@ -133,6 +147,8 @@ target_include_directories(ImCoolbar PRIVATE ${CMAKE_SOURCE_DIR} ) +set_target_properties(${PROJECT} PROPERTIES OUTPUT_NAME "${PROJECT}_${CMAKE_SYSTEM_NAME}_${ARCH}") + set_target_properties(${PROJECT} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG "${FINAL_BIN_DIR}") set_target_properties(${PROJECT} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE "${FINAL_BIN_DIR}") set_target_properties(${PROJECT} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL "${FINAL_BIN_DIR}")