forked from MaJerle/lwgps
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request MaJerle#20 from rmspacefish/mueller/added-cmake-su…
…pport Added CMake support
- Loading branch information
Showing
9 changed files
with
72 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,6 @@ | |
*.uvoptx | ||
*.__i | ||
*.i | ||
*.txt | ||
!docs/*.txt | ||
RTE/ | ||
|
||
|
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,39 @@ | ||
################################################################################ | ||
# 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 set the LWGPS_CONFIG_PATH path variable where | ||
# the configuration file is located so that is is included properly. | ||
# | ||
# 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) | ||
|
||
set(LIB_LWGPS_NAME lwgps) | ||
|
||
add_library(${LIB_LWGPS_NAME}) | ||
|
||
add_subdirectory(${LIB_LWGPS_NAME}) | ||
add_subdirectory(examples) | ||
|
||
# The project CMakeLists can set a LWGPS_CONFIG_PATH path including the lwgps_opts.h file | ||
# and add it. | ||
if(NOT LWGPS_CONFIG_PATH) | ||
message(STATUS "Lightweight GPS configuration path not set.") | ||
endif() | ||
|
||
# Extract the absolute path of the provided configuration path | ||
if(IS_ABSOLUTE ${LWGPS_CONFIG_PATH}) | ||
set(LWGPS_CONFIG_PATH_ABSOLUTE ${LWGPS_CONFIG_PATH}) | ||
else() | ||
get_filename_component(LWGPS_CONFIG_PATH_ABSOLUTE | ||
${LWGPS_CONFIG_PATH} REALPATH BASE_DIR ${CMAKE_SOURCE_DIR} | ||
) | ||
endif() | ||
|
||
target_include_directories(${LIB_LWGPS_NAME} PRIVATE | ||
${LWGPS_CONFIG_PATH_ABSOLUTE} | ||
) | ||
|
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
Empty file.
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 @@ | ||
add_subdirectory(src) |
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,3 @@ | ||
add_subdirectory(include) | ||
add_subdirectory(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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
target_include_directories(${LIB_LWGPS_NAME} INTERFACE | ||
${CMAKE_CURRENT_SOURCE_DIR} | ||
) | ||
|
||
target_include_directories(${LIB_LWGPS_NAME} PRIVATE | ||
${CMAKE_CURRENT_SOURCE_DIR} | ||
) |
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,3 @@ | ||
target_sources(${LIB_LWGPS_NAME} PRIVATE | ||
lwgps.c | ||
) |
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,3 @@ | ||
target_sources(${LIB_LWGPS_NAME} PRIVATE | ||
lwgps.c | ||
) |