Skip to content

Commit 23e1ac3

Browse files
committed
Init
0 parents  commit 23e1ac3

File tree

6 files changed

+721
-0
lines changed

6 files changed

+721
-0
lines changed

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/fltk-1.4.4
2+
fltk-1.4.4-source.tar.gz
3+
build_fltk.bat
4+
/.vscode
5+
note.md
6+
/build
7+
/out
8+
icon.png
9+
*.bat

CMakeLists.txt

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
cmake_minimum_required(VERSION 3.20)
2+
project(CozyOverlay LANGUAGES CXX RC)
3+
set(CMAKE_CXX_STANDARD 17)
4+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
5+
set(CMAKE_CXX_EXTENSIONS OFF)
6+
7+
if(MSVC)
8+
add_compile_options(/utf-8 /EHsc /W3)
9+
endif()
10+
11+
set(FLTK_ROOT "" CACHE PATH "Path to your FLTK install prefix")
12+
13+
if(NOT FLTK_ROOT)
14+
message(FATAL_ERROR "Please set -DFLTK_ROOT to your FLTK install prefix")
15+
endif()
16+
17+
find_path(FLTK_INCLUDE_DIR
18+
NAMES FL/Fl.H
19+
HINTS "${FLTK_ROOT}/include"
20+
PATH_SUFFIXES include
21+
NO_DEFAULT_PATH
22+
)
23+
24+
find_library(FLTK_LIBRARY_RELEASE
25+
NAMES fltk
26+
HINTS "${FLTK_ROOT}/lib"
27+
NO_DEFAULT_PATH
28+
)
29+
find_library(FLTK_LIBRARY_DEBUG
30+
NAMES fltkd
31+
HINTS "${FLTK_ROOT}/lib"
32+
NO_DEFAULT_PATH
33+
)
34+
35+
if(NOT FLTK_INCLUDE_DIR OR (NOT FLTK_LIBRARY_RELEASE AND NOT FLTK_LIBRARY_DEBUG))
36+
message(FATAL_ERROR "Could not find FLTK in ${FLTK_ROOT}. "
37+
"Check that include/ and lib/ are present.")
38+
endif()
39+
40+
add_executable(CozyOverlay WIN32
41+
src/overlay.cpp
42+
res/appicon.rc
43+
)
44+
target_include_directories(CozyOverlay PRIVATE
45+
"${CMAKE_SOURCE_DIR}"
46+
"${FLTK_INCLUDE_DIR}"
47+
)
48+
49+
target_compile_definitions(CozyOverlay PRIVATE UNICODE _UNICODE NOMINMAX)
50+
51+
if(FLTK_LIBRARY_DEBUG AND FLTK_LIBRARY_RELEASE)
52+
target_link_libraries(CozyOverlay PRIVATE
53+
debug "${FLTK_LIBRARY_DEBUG}"
54+
optimized "${FLTK_LIBRARY_RELEASE}"
55+
)
56+
elseif(FLTK_LIBRARY_RELEASE)
57+
target_link_libraries(CozyOverlay PRIVATE "${FLTK_LIBRARY_RELEASE}")
58+
else()
59+
target_link_libraries(CozyOverlay PRIVATE "${FLTK_LIBRARY_DEBUG}")
60+
endif()
61+
62+
target_link_libraries(CozyOverlay PRIVATE
63+
dcomp d3d11 dxgi d2d1 dwrite
64+
shell32 user32 gdi32 ole32 dwmapi
65+
comctl32 comdlg32 uxtheme gdiplus ws2_32
66+
)
67+
68+
include(GNUInstallDirs)
69+
install(TARGETS CozyOverlay RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})

res/appicon.rc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#include "resource.h"
2+
IDI_APP ICON "icon.ico"

res/icon.ico

107 KB
Binary file not shown.

res/resource.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#pragma once
2+
#define IDI_APP 101

0 commit comments

Comments
 (0)