Skip to content

Commit

Permalink
- revamp project
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkarnez committed Jan 4, 2022
1 parent 67d0b36 commit 2d778a4
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 7 deletions.
16 changes: 9 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
cmake_minimum_required(VERSION 3.14)

# uncomment these 2 lines if using clang
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -target x86_64-w64-mingw32")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -target x86_64-w64-mingw32")

project(ColorPicker)

set(BUILD_SHARED_LIBS FALSE)
set(SFML_BUILD_AUDIO FALSE)
set(SFML_BUILD_DOC FALSE)
Expand All @@ -17,15 +14,20 @@ set(SFML_INSTALL_PKGCONFIG_FILES FALSE)
set(SFML_OPENGL_ES FALSE)
set(SFML_USE_STATIC_STD_LIBS FALSE)
set(SFML_USE_SYSTEM_DEPS TRUE)
set(SFML_STATIC_LIBRARIES TRUE)

add_subdirectory("SFML")
find_package(SFML 2.5.1 COMPONENTS system window graphics REQUIRED PATHS
"P:\\Downloads\\cpp-libraries\\SFML\\build\\sfml\\lib\\cmake\\SFML"
)

# uncomment this line if using msvc
# SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /subsystem:windows /ENTRY:mainCRTStartup")

# uncomment this line if using clang
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static -Wl,--subsystem,windows")

add_executable(ColorPicker main.cpp)
add_executable(ColorPicker
"src/main.cpp"
)

target_link_libraries(ColorPicker sfml-graphics)
target_link_libraries(ColorPicker sfml-graphics)
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
ColorPicker
===========
### Notes
- DOES NOT use Clang

### Reference
- https://github.com/SFML/SFML/blob/master/examples/win32/Win32.cpp
13 changes: 13 additions & 0 deletions local-build.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
REM run as Administrator
@echo off
cd /d %~dp0
set DOWNLOAD_DIR=%USERPROFILE%\Downloads
set DOWNLOAD_DIR_LINUX=%DOWNLOAD_DIR:\=/%
SET PATH=%DOWNLOAD_DIR%\PortableGit\bin;%DOWNLOAD_DIR%\mingw64;%DOWNLOAD_DIR%\mingw64\bin;%DOWNLOAD_DIR%\cmake-3.22.0-rc1-windows-x86_64\bin;%PATH%
cmake.exe -G"MinGW Makefiles" -B./build
cd build

:rebuild_and_startapp
mingw32-make.exe
pause
REM GOTO rebuild_and_startapp
File renamed without changes.

0 comments on commit 2d778a4

Please sign in to comment.