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 4a26d7e
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 19 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
38 changes: 27 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

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 @@ -83,7 +102,7 @@ if(USE_TEST)
add_subdirectory(${CMAKE_SOURCE_DIR}/tests)
endif()

add_subdirectory(${CMAKE_SOURCE_DIR}/ImCoolbar)
add_subdirectory(${CMAKE_SOURCE_DIR}/ImCoolBar)

add_executable(${PROJECT}
MACOSX_BUNDLE
Expand All @@ -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 @@ -127,12 +141,14 @@ target_link_libraries(${PROJECT} PRIVATE
${IMCOOLBAR_LIBRARIES}
)

set_target_properties(ImCoolbar PROPERTIES FOLDER Lib)
set_target_properties(ImCoolBar PROPERTIES FOLDER Lib)

target_include_directories(ImCoolbar PRIVATE
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
2 changes: 1 addition & 1 deletion ImCoolBar
2 changes: 1 addition & 1 deletion main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

#include "3rdparty/imgui/backends/imgui_impl_opengl3.h"
#include "3rdparty/imgui/backends/imgui_impl_glfw.h"
#include <ImCoolbar/ImCoolbar.h>
#include <ImCoolBar/ImCoolBar.h>
#include "CustomFont.cpp"
#include <stdio.h>
#include <sstream>
Expand Down

0 comments on commit 4a26d7e

Please sign in to comment.