-
-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
192 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"version": 4, | ||
"configurations": [ | ||
{ | ||
"name": "Win32", | ||
"includePath": [ | ||
"${workspaceFolder}\\dev\\VisualStudio\\", | ||
"${workspaceFolder}\\lwgps\\src\\include\\" | ||
], | ||
"defines": [ | ||
"WIN32", | ||
"_DEBUG", | ||
"UNICODE", | ||
"_UNICODE", | ||
"LWGPS_DEV" | ||
], | ||
"compilerPath": "c:\\msys64\\mingw64\\bin\\gcc.exe", | ||
"cStandard": "gnu17", | ||
"cppStandard": "gnu++14", | ||
"intelliSenseMode": "windows-gcc-x86", | ||
"configurationProvider": "ms-vscode.cmake-tools" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "(Windows) Launch", | ||
"type": "cppdbg", | ||
"request": "launch", | ||
"program": "${workspaceFolder}\\build\\LwLibPROJECT.exe", | ||
"miDebuggerPath": "c:\\msys64\\mingw64\\bin\\gdb.exe", | ||
"args": [], | ||
"stopAtEntry": false, | ||
"cwd": "${fileDirname}", | ||
"environment": [], | ||
"console": "integratedTerminal" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
{ | ||
"version": "2.0.0", | ||
|
||
/* For this builds, you need | ||
* | ||
* - Ninja build system | ||
* - MSYS2 compiler with ninja support | ||
* - C/C++ extension for VSCode | ||
* - CMake-Tools extension for VSCode | ||
*/ | ||
"tasks": [ | ||
{ | ||
"type": "cppbuild", | ||
"label": "Build project", | ||
"command": "cmake", | ||
"args": ["--build", "\"build\""], | ||
"options": { | ||
"cwd": "${workspaceFolder}" | ||
}, | ||
"problemMatcher": ["$gcc"], | ||
"group": { | ||
"kind": "build", | ||
"isDefault": true | ||
} | ||
}, | ||
{ | ||
"type": "shell", | ||
"label": "Re-build project", | ||
"command": "cmake", | ||
"args": ["--build", "\"build\"", "--clean-first", "-v"], | ||
"options": { | ||
"cwd": "${workspaceFolder}" | ||
}, | ||
"problemMatcher": ["$gcc"], | ||
}, | ||
{ | ||
"type": "shell", | ||
"label": "Clean project", | ||
"command": "cmake", | ||
"args": ["--build", "\"build\"", "--target", "clean"], | ||
"options": { | ||
"cwd": "${workspaceFolder}" | ||
}, | ||
"problemMatcher": [] | ||
}, | ||
{ | ||
"type": "shell", | ||
"label": "Run application", | ||
"command": "${workspaceFolder}\\build\\LwLibPROJECT.exe", | ||
"args": [], | ||
"problemMatcher": [], | ||
}, | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,40 @@ | ||
################################################################################ | ||
# Lightweight GPS (lwgps) CMake support | ||
################################################################################ | ||
# The lwgps library can be configured with a lwgps_opts.h file. | ||
# If such a file is used, the user should have the path containing this file | ||
# in the target include directories in an upper CMakeLists.txt | ||
# | ||
# Other than that, only two steps are necessary to compile and link against LWGPS: | ||
# 1. Use add_subdirectory to add the lwgps folder | ||
# 2. Link against lwgps with target_link_libraries | ||
################################################################################ | ||
cmake_minimum_required(VERSION 3.13) | ||
cmake_minimum_required(VERSION 3.0.0) | ||
|
||
set(LWGPS_LIB_NAME lwgps) | ||
if(NOT (TARGET ${LWGPS_LIB_NAME})) | ||
add_library(${LWGPS_LIB_NAME} INTERFACE) | ||
target_sources(${LWGPS_LIB_NAME} INTERFACE "lwgps/src/lwgps/lwgps.c") | ||
target_include_directories(${LWGPS_LIB_NAME} INTERFACE "lwgps/src/include") | ||
# Setup project | ||
project(LwLibPROJECT) | ||
|
||
# ------------------------------------------------- | ||
# This CMakeLists.txt is used only if it is a top-level file. | ||
# Purpose of it is to be able to compile project in standalone way only | ||
# | ||
# When library sources are to be included in another project | ||
# user shall use /lwgps/CMakeLists.txt instead | ||
if (NOT PROJECT_IS_TOP_LEVEL) | ||
message(FATAL_ERROR "This CMakeLists.txt can only be used as top-level. Use /lwgps/CMakeLists.txt for library include purpose") | ||
endif() | ||
|
||
# Set as executable | ||
add_executable(${PROJECT_NAME}) | ||
|
||
# Add key executable block | ||
target_sources(${PROJECT_NAME} PUBLIC | ||
${CMAKE_CURRENT_LIST_DIR}/dev/VisualStudio/main.c | ||
${CMAKE_CURRENT_LIST_DIR}/examples/test_code.c | ||
) | ||
|
||
# Add key include paths | ||
target_include_directories(${PROJECT_NAME} PUBLIC | ||
${CMAKE_CURRENT_LIST_DIR}/dev/VisualStudio | ||
) | ||
|
||
# Compilation definition information | ||
target_compile_definitions(${PROJECT_NAME} PUBLIC | ||
WIN32 | ||
_DEBUG | ||
CONSOLE | ||
LWGPS_DEV | ||
) | ||
|
||
# Add subdir with lwgps and link to project | ||
add_subdirectory("lwgps" lwgps) | ||
target_link_libraries(${PROJECT_NAME} lwgps) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,20 @@ | ||
add_subdirectory(src) | ||
cmake_minimum_required(VERSION 3.13) | ||
|
||
# Debug message | ||
message("LWGPS: Entering lib source CMakeLists.txt") | ||
|
||
# Set library name | ||
set(LWGPS_LIB_NAME "lwgps") | ||
|
||
# Register library to the system | ||
add_library(${LWGPS_LIB_NAME} INTERFACE) | ||
|
||
# Setup generic source files | ||
target_sources(${LWGPS_LIB_NAME} INTERFACE | ||
${CMAKE_CURRENT_LIST_DIR}/src/lwgps/lwgps.c | ||
) | ||
|
||
# Setup include directories | ||
target_include_directories(${LWGPS_LIB_NAME} INTERFACE | ||
${CMAKE_CURRENT_LIST_DIR}/src/include | ||
) |