Skip to content

Commit

Permalink
[WIP] : try to fix compilations on many targets
Browse files Browse the repository at this point in the history
  • Loading branch information
aiekick committed Jun 3, 2024
1 parent faea5e3 commit f3e2749
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/Linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions .github/workflows/Osx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions .github/workflows/Win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
30 changes: 23 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ else ()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -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)

Expand All @@ -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")
Expand Down Expand Up @@ -97,19 +116,14 @@ 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
MACOSX_BUNDLE_SHORT_VERSION_STRING ""
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)
Expand All @@ -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}")
Expand Down

0 comments on commit f3e2749

Please sign in to comment.