Seperate CMakeLists.txt files. More warnings enabled.
parent
ea8da1cac8
commit
21fb28bbfe
|
@ -1,16 +1,22 @@
|
||||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
|
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
|
||||||
PROJECT(SGP4)
|
PROJECT(SGP4)
|
||||||
|
|
||||||
file(GLOB SRCS libsgp4/*.cpp)
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||||
|
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra")
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wshadow")
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor")
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic")
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-long-long")
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wcast-align")
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wsign-conversion")
|
||||||
|
|
||||||
include_directories(libsgp4)
|
include_directories(libsgp4)
|
||||||
|
|
||||||
add_library(sgp4 STATIC ${SRCS})
|
add_subdirectory(libsgp4)
|
||||||
add_executable(sattrack sattrack/sattrack.cpp)
|
add_subdirectory(sattrack)
|
||||||
target_link_libraries(sattrack sgp4 rt)
|
add_subdirectory(runtest)
|
||||||
add_executable(runtest runtest/runtest.cpp)
|
add_subdirectory(passpredict)
|
||||||
target_link_libraries(runtest sgp4 rt)
|
|
||||||
add_executable(passpredict passpredict/passpredict.cpp)
|
|
||||||
target_link_libraries(passpredict sgp4 rt)
|
|
||||||
|
|
||||||
file(COPY SGP4-VER.TLE DESTINATION ${PROJECT_BINARY_DIR})
|
file(COPY SGP4-VER.TLE DESTINATION ${PROJECT_BINARY_DIR})
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
set(SRCS
|
||||||
|
CoordGeodetic.cpp
|
||||||
|
CoordTopocentric.cpp
|
||||||
|
DateTime.cpp
|
||||||
|
DecayedException.cpp
|
||||||
|
Eci.cpp
|
||||||
|
Globals.cpp
|
||||||
|
Observer.cpp
|
||||||
|
OrbitalElements.cpp
|
||||||
|
SGP4.cpp
|
||||||
|
SatelliteException.cpp
|
||||||
|
SolarPosition.cpp
|
||||||
|
TimeSpan.cpp
|
||||||
|
Tle.cpp
|
||||||
|
TleException.cpp
|
||||||
|
Util.cpp
|
||||||
|
Vector.cpp)
|
||||||
|
|
||||||
|
add_library(sgp4 STATIC ${SRCS})
|
|
@ -177,7 +177,7 @@ void Tle::ExtractInteger(const std::string& str, unsigned int& val)
|
||||||
if (isdigit(*i))
|
if (isdigit(*i))
|
||||||
{
|
{
|
||||||
found_digit = true;
|
found_digit = true;
|
||||||
temp = (temp * 10) + (static_cast<unsigned char>(*i) - '0');
|
temp = (temp * 10) + static_cast<unsigned int>(*i - '0');
|
||||||
}
|
}
|
||||||
else if (found_digit)
|
else if (found_digit)
|
||||||
{
|
{
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
set(SRCS
|
||||||
|
passpredict.cpp)
|
||||||
|
|
||||||
|
add_executable(passpredict
|
||||||
|
${SRCS})
|
||||||
|
target_link_libraries(passpredict
|
||||||
|
sgp4
|
||||||
|
rt)
|
|
@ -0,0 +1,8 @@
|
||||||
|
set(SRCS
|
||||||
|
runtest.cpp)
|
||||||
|
|
||||||
|
add_executable(runtest
|
||||||
|
${SRCS})
|
||||||
|
target_link_libraries(runtest
|
||||||
|
sgp4
|
||||||
|
rt)
|
|
@ -0,0 +1,8 @@
|
||||||
|
set(SRCS
|
||||||
|
sattrack.cpp)
|
||||||
|
|
||||||
|
add_executable(sattrack
|
||||||
|
${SRCS})
|
||||||
|
target_link_libraries(sattrack
|
||||||
|
sgp4
|
||||||
|
rt)
|
|
@ -32,7 +32,7 @@ int main()
|
||||||
|
|
||||||
std::cout << tle << std::endl;
|
std::cout << tle << std::endl;
|
||||||
|
|
||||||
while (true)
|
for (int i = 0; i < 10; ++i)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* current time
|
* current time
|
||||||
|
|
Loading…
Reference in New Issue