feat(*): initial commit
This commit is contained in:
5
.gitignore
vendored
Normal file
5
.gitignore
vendored
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# Visual Studio cache directory
|
||||||
|
.vs/
|
||||||
|
|
||||||
|
# CMake generated files
|
||||||
|
out/
|
66
CMakeLists.txt
Normal file
66
CMakeLists.txt
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
cmake_minimum_required (VERSION 3.8)
|
||||||
|
|
||||||
|
# Main project
|
||||||
|
string (REGEX REPLACE ".*/(.*)" "\\1" CURRENT_FOLDER ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
|
project (${CURRENT_FOLDER})
|
||||||
|
message (STATUS "Configuring project: " ${CURRENT_FOLDER})
|
||||||
|
|
||||||
|
# Reset the binary file directory
|
||||||
|
set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/Build")
|
||||||
|
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/Build")
|
||||||
|
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/Binaries")
|
||||||
|
|
||||||
|
# Configure compile options
|
||||||
|
set (BUILD_SHARED_LIBS true)
|
||||||
|
set (CMAKE_CXX_STANDARD 20)
|
||||||
|
|
||||||
|
# Define platform macros
|
||||||
|
add_compile_definitions ("PLATFORM_NAME=${CMAKE_SYSTEM_NAME}")
|
||||||
|
if (CMAKE_SYSTEM_NAME MATCHES "Windows")
|
||||||
|
add_compile_definitions ("PLATFORM_WINDOWS=1")
|
||||||
|
elseif (CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||||
|
add_compile_definitions ("PLATFORM_LINUX=1")
|
||||||
|
else ()
|
||||||
|
add_compile_definitions ("PLATFORM_UNKNOWN=1")
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
# Define configuration type macros
|
||||||
|
if (CMAKE_BUILD_TYPE MATCHES "Debug")
|
||||||
|
add_compile_definitions ("BUILD_DEBUG=1")
|
||||||
|
add_compile_definitions ("BUILD_TYPE=Debug")
|
||||||
|
elseif (CMAKE_BUILD_TYPE MATCHES "RelWithDebInfo")
|
||||||
|
add_compile_definitions ("BUILD_DEVELOPMENT=1")
|
||||||
|
add_compile_definitions ("BUILD_TYPE=Development")
|
||||||
|
elseif (CMAKE_BUILD_TYPE MATCHES "Release")
|
||||||
|
add_compile_definitions ("BUILD_RELEASE=1")
|
||||||
|
add_compile_definitions ("BUILD_TYPE=Release")
|
||||||
|
else ()
|
||||||
|
add_compile_definitions ("BUILD_UNKNOWN=1")
|
||||||
|
add_compile_definitions ("BUILD_TYPE=${CMAKE_BUILD_TYPE}")
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
# Define compiler macros
|
||||||
|
if (CMAKE_C_COMPILER_ID MATCHES "MSVC" AND CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
|
||||||
|
add_compile_definitions ("PLATFORM_COMPILER_MSVC=1")
|
||||||
|
add_compile_definitions ("PLATFORM_COMPILER_NAME=MSVC")
|
||||||
|
elseif (CMAKE_C_COMPILER_ID MATCHES "GNU" AND CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
||||||
|
add_compile_definitions ("PLATFORM_COMPILER_GCC=1")
|
||||||
|
add_compile_definitions ("PLATFORM_COMPILER_NAME=GCC")
|
||||||
|
elseif (CMAKE_C_COMPILER_ID MATCHES "Clang" AND CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||||
|
add_compile_definitions ("PLATFORM_COMPILER_CLANG=1")
|
||||||
|
add_compile_definitions ("PLATFORM_COMPILER_NAME=Clang")
|
||||||
|
else ()
|
||||||
|
add_compile_definitions ("PLATFORM_COMPILER_UNKNOWN=1")
|
||||||
|
add_compile_definitions ("PLATFORM_COMPILER_NAME=${CMAKE_C_COMPILER_ID}/${CMAKE_CXX_COMPILER_ID}")
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
# Add subproject
|
||||||
|
file (GLOB PROJECT_FOLDERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/*")
|
||||||
|
foreach (PROJECT_SUBDIRECTORY ${PROJECT_FOLDERS})
|
||||||
|
if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_SUBDIRECTORY}")
|
||||||
|
file (GLOB PROJECT_CMAKELISTS "${PROJECT_SUBDIRECTORY}/CMakeLists.txt")
|
||||||
|
if (NOT "${PROJECT_CMAKELISTS}" STREQUAL "")
|
||||||
|
add_subdirectory (${PROJECT_SUBDIRECTORY})
|
||||||
|
endif ()
|
||||||
|
endif ()
|
||||||
|
endforeach ()
|
37
CMakeSettings.json
Normal file
37
CMakeSettings.json
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
{
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"name": "x64-Debug",
|
||||||
|
"generator": "Ninja",
|
||||||
|
"configurationType": "Debug",
|
||||||
|
"buildRoot": "${projectDir}\\out\\build\\${name}",
|
||||||
|
"installRoot": "${projectDir}\\out\\install\\${name}",
|
||||||
|
"cmakeCommandArgs": "",
|
||||||
|
"buildCommandArgs": "",
|
||||||
|
"ctestCommandArgs": "",
|
||||||
|
"inheritEnvironments": [ "msvc_x64_x64" ]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "x64-Development",
|
||||||
|
"generator": "Ninja",
|
||||||
|
"configurationType": "RelWithDebInfo",
|
||||||
|
"buildRoot": "${projectDir}\\out\\build\\${name}",
|
||||||
|
"installRoot": "${projectDir}\\out\\install\\${name}",
|
||||||
|
"cmakeCommandArgs": "",
|
||||||
|
"buildCommandArgs": "",
|
||||||
|
"ctestCommandArgs": "",
|
||||||
|
"inheritEnvironments": [ "msvc_x64_x64" ]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "x64-Release",
|
||||||
|
"generator": "Ninja",
|
||||||
|
"configurationType": "Release",
|
||||||
|
"buildRoot": "${projectDir}\\out\\build\\${name}",
|
||||||
|
"installRoot": "${projectDir}\\out\\install\\${name}",
|
||||||
|
"cmakeCommandArgs": "",
|
||||||
|
"buildCommandArgs": "",
|
||||||
|
"ctestCommandArgs": "",
|
||||||
|
"inheritEnvironments": [ "msvc_x64_x64" ]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
21
LICENSE
Normal file
21
LICENSE
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2025 _Redstone_c_
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
24
Redcraft.FocusIME/CMakeLists.txt
Normal file
24
Redcraft.FocusIME/CMakeLists.txt
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
cmake_minimum_required (VERSION 3.8)
|
||||||
|
|
||||||
|
# Set module name
|
||||||
|
string (REGEX REPLACE ".*/(.*)" "\\1" MODULE_NAME ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
|
message (STATUS "Configuring module: " ${MODULE_NAME})
|
||||||
|
|
||||||
|
# Add target
|
||||||
|
file (GLOB_RECURSE MODULE_SOURCE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/Source/*")
|
||||||
|
add_executable (${MODULE_NAME} WIN32 ${MODULE_SOURCE_FILES})
|
||||||
|
target_compile_definitions (${MODULE_NAME} PRIVATE "MODULE_NAME=${MODULE_NAME}")
|
||||||
|
|
||||||
|
# Add include directories
|
||||||
|
target_include_directories (${MODULE_NAME} PUBLIC "Source/Public")
|
||||||
|
target_include_directories (${MODULE_NAME} PRIVATE "Source/Private")
|
||||||
|
|
||||||
|
# Define API macro
|
||||||
|
string (TOUPPER ${MODULE_NAME} MODULE_API)
|
||||||
|
string (REGEX REPLACE "[^A-Z ^0-1]" "" MODULE_API ${MODULE_API})
|
||||||
|
set (MODULE_API "${MODULE_API}_API")
|
||||||
|
target_compile_definitions (${MODULE_NAME} PRIVATE "${MODULE_API}=DLLEXPORT")
|
||||||
|
target_compile_definitions (${MODULE_NAME} INTERFACE "${MODULE_API}=DLLIMPORT")
|
||||||
|
|
||||||
|
# Add project dependencies
|
||||||
|
#target_link_libraries (${MODULE_NAME} PRIVATE Redcraft.Utility)
|
31
Redcraft.FocusIME/Source/Private/Main.cpp
Normal file
31
Redcraft.FocusIME/Source/Private/Main.cpp
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
#include <windows.h>
|
||||||
|
#include <iostream>
|
||||||
|
#include <thread>
|
||||||
|
#include <chrono>
|
||||||
|
|
||||||
|
#pragma warning(disable: 4996)
|
||||||
|
|
||||||
|
// ReSharper disable CppDeprecatedEntity
|
||||||
|
// ReSharper disable CppClangTidyCertErr33C
|
||||||
|
|
||||||
|
int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
|
||||||
|
{
|
||||||
|
using namespace std::chrono_literals;
|
||||||
|
|
||||||
|
AllocConsole();
|
||||||
|
|
||||||
|
freopen("CONOUT$", "w", stdout);
|
||||||
|
|
||||||
|
SetConsoleTitle("FocusIME");
|
||||||
|
|
||||||
|
std::cout << "Hello, FocusIME!" << std::endl;
|
||||||
|
|
||||||
|
std::this_thread::sleep_for(3s);
|
||||||
|
|
||||||
|
FreeConsole();
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ReSharper restore CppDeprecatedEntity
|
||||||
|
// ReSharper restore CppClangTidyCertErr33C
|
Reference in New Issue
Block a user