Skip to content

Commit

Permalink
Add GlucoAndTrack Project Files without Git-History
Browse files Browse the repository at this point in the history
  • Loading branch information
zottelsheep committed Mar 17, 2021
1 parent 50d49aa commit cbec23f
Show file tree
Hide file tree
Showing 62 changed files with 252,355 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@

# Eclipse
.autotools
.cproject
.project
.settings/
Debug/
Release/

# PPA Build (ubuntu)
ppa-build

# CMake
build/
desktop/desktop_install.sh

# NetBeans
nbproject/

# Visual Studio Code
.vscode/
*/.vscode/

# CLion
.idea
cmake-build-*

# API Documentation
doc/html
doc/latex

src/view/.DS_Store
src/view/background/.DS_Store

# Flatpak
repo/
flatpak-build/
.flatpak-builder/
*.flatpak

# Lua
lua-*
90 changes: 90 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
cmake_minimum_required(VERSION 3.17)
project(GluAndCoTrack VERSION 1.2)
set(CMAKE_CXX_STANDARD 17)

## Main Executable
add_executable(${PROJECT_NAME} "")

## Set Optimisation Flags for Relase Build
set(CMAKE_CXX_FLAGS_RELEASE "-O3")

## Set Compile Options for FLTK
target_compile_definitions(${PROJECT_NAME}
PRIVATE
_LARGEFILE64_SOURCE
_LARGEFILE_SOURCE
_FILE_OFFSET_BITS=64
_REENTRANT
_THREAD_SAFE
)

## Include Files
target_include_directories(${PROJECT_NAME} PRIVATE include/ icons/)

## Build Main Source-Files
FILE(GLOB SRCS "src/*.cpp")
target_sources(${PROJECT_NAME} PRIVATE ${SRCS})

## Build Classes
FILE(GLOB SRCS_ClASS "src/Classes/*.cpp")
target_sources(${PROJECT_NAME} PRIVATE ${SRCS_ClASS})

## Link SQLite and if not found build it
find_package(SQLite3)

if(${SQLite3_FOUND})
message("Using System Lib of SQLite3")
target_include_directories(${PROJECT_NAME} PRIVATE ${SQLite3_INCLUDE_DIRS})
target_link_libraries(${PROJECT_NAME} ${SQLite3_LIBRARIES})

else()
message("Using Built-in Lib of SQLite3")
add_subdirectory(dependencies/sqlite3)
target_link_libraries(${PROJECT_NAME} sqlite3)
target_include_directories(${PROJECT_NAME} PRIVATE dependencies/sqlite3)
endif()


## Link FLTK
set(FLTK_SKIP_FORMS true)
set(FLTK_SKIP_FLUID true)

set(FLTK_DIR "C:/Program Files/FLTK/" CACHE STRING "Location of FLTK Installation")
message("Using FLTK_DIR: " ${FLTK_DIR})

find_package(FLTK REQUIRED NO_MODULE PATHS ${FLTK_DIR})
target_include_directories(${PROJECT_NAME} PRIVATE ${FLTK_INCLUDE_DIRS})
target_link_libraries(${PROJECT_NAME} fltk_images fltk_png z fltk pthread fontconfig)

## WINDOWS SPECIFIC
if(WIN32)
if(CMAKE_BUILD_TYPE MATCHES "Release")
# Removes terminal from popping up in Windows when using Release-Version
target_link_options(${PROJECT_NAME} PRIVATE "-mwindows")
endif()
# Adds icon, version and other information to executable
configure_file(icons/icon.rc.in icon.rc)
target_sources(${PROJECT_NAME} PRIVATE icon.rc)

## Installer
option(USE_NSIS "Use NSIS generator to produce installer" OFF)

# Custom target for packaging.
if(USE_NSIS)
set(CMAKE_CPACK_GENERATOR "NSIS")
else(USE_NSIS)
set(CMAKE_CPACK_GENERATOR "ZIP")
endif(USE_NSIS)

# Install config
INSTALL(TARGETS ${PROJECT_NAME} )

#CPACK Config
include(InstallRequiredSystemLibraries)
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/License.md")
set(CPACK_PACKAGE_VERSION_MAJOR "${PROJECT_VERSION_MAJOR}")
set(CPACK_PACKAGE_VERSION_MINOR "${PROJECT_VERSION_MINOR}")
include(CPack)

endif (WIN32)

Loading

0 comments on commit cbec23f

Please sign in to comment.