Skip to content

Commit

Permalink
complete core program implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
radj307 committed Aug 15, 2022
1 parent 33347f2 commit ec765ea
Show file tree
Hide file tree
Showing 11 changed files with 1,394 additions and 1 deletion.
35 changes: 35 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,38 @@ install_manifest.txt
compile_commands.json
CTestTestfile.cmake
_deps

#Ignore thumbnails created by Windows
Thumbs.db
#Ignore files built by Visual Studio
*.obj
*.exe
*.pdb
*.user
*.aps
*.pch
*.vspscc
*_i.c
*_p.c
*.ncb
*.suo
*.tlb
*.tlh
*.bak
*.cache
*.ilk
*.log
[Bb]in
[Dd]ebug*/
*.lib
*.sbr
obj/
[Rr]elease*/
_ReSharper*/
[Tt]est[Rr]esult*
.vs/
#Nuget packages folder
packages/
ckconv/rc/version.h
ckconv/rc/ckconv.rc
out/
12 changes: 12 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# ckconv/
cmake_minimum_required (VERSION 3.20)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/307lib/307modules")

include(VersionTag)
set(ENV{ckconv_VERSION} "0.0.0")

project("ckconv" VERSION "${ckconv_VERSION}" LANGUAGES CXX)

add_subdirectory("307lib")
add_subdirectory("ckconv")
101 changes: 101 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
{
"version": 3,
"configurePresets": [
{
"name": "windows-base",
"hidden": true,
"generator": "Ninja",
"binaryDir": "${sourceDir}/out/build/${presetName}",
"installDir": "${sourceDir}/out/install/${presetName}",
"cacheVariables": {
"CMAKE_C_COMPILER": "cl.exe",
"CMAKE_CXX_COMPILER": "cl.exe"
},
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
}
},
{
"name": "x64-debug",
"displayName": "x64 Debug",
"inherits": "windows-base",
"architecture": {
"value": "x64",
"strategy": "external"
},
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
}
},
{
"name": "x64-release",
"displayName": "x64 Release",
"inherits": "x64-debug",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
}
},
{
"name": "x86-debug",
"displayName": "x86 Debug",
"inherits": "windows-base",
"architecture": {
"value": "x86",
"strategy": "external"
},
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
}
},
{
"name": "x86-release",
"displayName": "x86 Release",
"inherits": "x86-debug",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
}
},
{
"name": "linux-debug",
"displayName": "Linux Debug",
"generator": "Ninja",
"binaryDir": "${sourceDir}/out/build/${presetName}",
"installDir": "${sourceDir}/out/install/${presetName}",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
},
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Linux"
},
"vendor": {
"microsoft.com/VisualStudioRemoteSettings/CMake/1.0": {
"sourceDir": "$env{HOME}/.vs/$ms{projectDirName}"
}
}
},
{
"name": "macos-debug",
"displayName": "macOS Debug",
"generator": "Ninja",
"binaryDir": "${sourceDir}/out/build/${presetName}",
"installDir": "${sourceDir}/out/install/${presetName}",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
},
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Darwin"
},
"vendor": {
"microsoft.com/VisualStudioRemoteSettings/CMake/1.0": {
"sourceDir": "$env{HOME}/.vs/$ms{projectDirName}"
}
}
}
]
}
49 changes: 49 additions & 0 deletions ckconv/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# ckconv/ckconv
cmake_minimum_required (VERSION 3.20)

file(GLOB HEADERS
RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
CONFIGURE_DEPENDS
"*.h*"
)
file(GLOB SRCS
RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
CONFIGURE_DEPENDS
"*.c*"
)

file(MAKE_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/rc")

MAKE_VERSION_HEADER("${CMAKE_CURRENT_SOURCE_DIR}/rc/version.h" "ckconv" "${ckconv_VERSION}")

if (WIN32)
set(ckconv_rc "${CMAKE_CURRENT_SOURCE_DIR}/rc/ckconv.rc")
include(ResourceMaker)

MAKE_STRINGRC_ICON(ckconv_stringrc_icon "${CMAKE_CURRENT_SOURCE_DIR}/rc/ckconv.ico")
MAKE_STRINGRC_VERSIONINFO(ckconv_stringrc_versioninfo
"${ckconv_VERSION}"
"GNU General Public License v3 @ radj307"
"radj307"
"ckconv"
"Commandline unit converter for Bethesda games."
)

MAKE_RESOURCE("${ckconv_rc}" "${ckconv_stringrc_icon}" "${ckconv_stringrc_versioninfo}")
endif()

add_executable (ckconv "${SRCS}" "${ckconv_rc}" "rc/version.h")

set_property(TARGET ckconv PROPERTY CXX_STANDARD 20)
set_property(TARGET ckconv PROPERTY CXX_STANDARD_REQUIRED ON)

if (MSVC)
target_compile_options(ckconv PRIVATE "/Zc:__cplusplus" "/Zc:preprocessor")
endif()

target_sources(ckconv PRIVATE "${HEADERS}")

target_link_libraries(ckconv PRIVATE TermAPI optlib filelib)

include(PackageInstaller)
INSTALL_EXECUTABLE(ckconv "${CMAKE_INSTALL_PREFIX}")
Loading

0 comments on commit ec765ea

Please sign in to comment.