Skip to content

Commit

Permalink
cmakefile
Browse files Browse the repository at this point in the history
  • Loading branch information
handong1979 committed Apr 3, 2020
1 parent f309917 commit 7eeb79a
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 90 deletions.
2 changes: 0 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ link_directories(${PROJECT_SOURCE_DIR}/lib)
set(BUILD_SOFA "build sofa library" TRUE)
set(BUILD_TEST "build test" TRUE)

set(CMAKE_DEBUG_POSTFIX "_d")

if(APPLE)

set(ARMA_OS macos)
Expand Down
69 changes: 24 additions & 45 deletions maneuver/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,47 +1,26 @@
add_executable(leotrans leotrans.cpp)
target_link_libraries(leotrans OrbitDyn)

add_executable(leocap leocap.cpp loadorbit.cpp)
target_link_libraries(leocap OrbitDyn)
set (maneuvers
leotrans
leocap
leodeorbit
sap1
sap2
groundtraj
AdjustTime
attdet
attctrl
consformation
geocolocationE
geocolocationI
geodeorbit
geoEWsk
geoNSsk
geotrans
)

foreach (maneuver ${maneuvers})
add_executable (${maneuver} ${maneuver}.cpp)
target_link_libraries (${maneuver} OrbitDyn)
set_target_properties (${maneuver} PROPERTIES FOLDER Maneuver)
endforeach ()

add_executable(leodeorbit leodeorbit.cpp loadorbit.cpp)
target_link_libraries(leodeorbit OrbitDyn)

add_executable(sap1 sap1.cpp loadorbit.cpp)
target_link_libraries(sap1 OrbitDyn)

add_executable(sap2 sap2.cpp loadorbit.cpp)
target_link_libraries(sap2 OrbitDyn)

add_executable(groundtraj groundtraj.cpp loadorbit.cpp)
target_link_libraries(groundtraj OrbitDyn)

add_executable(AdjustTime AdjustTime.cpp loadorbit.cpp)
target_link_libraries(AdjustTime OrbitDyn)

add_executable(attdet attdet.cpp loadorbit.cpp)
target_link_libraries(attdet OrbitDyn)

add_executable(attctrl attctrl.cpp loadorbit.cpp)
target_link_libraries(attctrl OrbitDyn)

add_executable(consformation consformation.cpp loadorbit.cpp)
target_link_libraries(consformation OrbitDyn)

add_executable(geocolocationE geocolocationE.cpp loadorbit.cpp)
target_link_libraries(geocolocationE OrbitDyn)

add_executable(geocolocationI geocolocationI.cpp loadorbit.cpp)
target_link_libraries(geocolocationI OrbitDyn)

add_executable(geodeorbit geodeorbit.cpp loadorbit.cpp)
target_link_libraries(geodeorbit OrbitDyn)

add_executable(geoEWsk geoEWsk.cpp loadorbit.cpp)
target_link_libraries(geoEWsk OrbitDyn)

add_executable(geoNSsk geoNSsk.cpp loadorbit.cpp)
target_link_libraries(geoNSsk OrbitDyn)

add_executable(geotrans geotrans.cpp loadorbit.cpp)
target_link_libraries(geotrans OrbitDyn)
7 changes: 7 additions & 0 deletions orbitdyn/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,14 @@ set(SRC
StringUtility.cpp
Utility.cpp)

set(CMAKE_DEBUG_POSTFIX "D")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${PROJECT_SOURCE_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${PROJECT_SOURCE_DIR}/bin)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${PROJECT_SOURCE_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${PROJECT_SOURCE_DIR}/bin)

add_library(OrbitDyn SHARED ${SRC})
set_target_properties (OrbitDyn PROPERTIES FOLDER Libraries)

if(APPLE)

Expand Down
5 changes: 3 additions & 2 deletions sofa/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -234,5 +234,6 @@ set(SOFASRC
zp.c
zpv.c
zr.c)

add_library(sofa SHARED ${SOFASRC})
set(CMAKE_DEBUG_POSTFIX "D")
add_library(sofa SHARED ${SOFASRC})
set_target_properties (sofa PROPERTIES FOLDER Libraries)
64 changes: 23 additions & 41 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,43 +1,25 @@
add_executable(test_circle_moon test_circle_moon.cpp)
target_link_libraries(test_circle_moon OrbitDyn)

add_executable(test_DE405_DE421 test_DE405_DE421.cpp)
target_link_libraries(test_DE405_DE421 OrbitDyn)
set (tests
test_circle_moon
test_DE405_DE421
test_earth_lunar_transfer
test_facility
checkmemoryleak
test_mean_inst
test_orbit_propagator
test_orbit_maneuver
test_rapidsattlite
test_RIC
test_sg
test_sofa_Gst
testBackward
test_access
testjson
)

foreach (test ${tests})
add_executable (${test} ${test}.cpp)
target_link_libraries (${test} OrbitDyn)
set_target_properties (${test} PROPERTIES FOLDER Tests)
endforeach ()

add_executable(test_earth_lunar_transfer test_earth_lunar_transfer.cpp)
target_link_libraries(test_earth_lunar_transfer OrbitDyn)

add_executable(test_facility test_facility.cpp)
target_link_libraries(test_facility OrbitDyn)

add_executable(checkmemoryleak checkmemoryleak.cpp)
target_link_libraries(checkmemoryleak OrbitDyn)

add_executable(test_mean_inst test_mean_inst.cpp)
target_link_libraries(test_mean_inst OrbitDyn)

add_executable(test_orbit_propagator test_orbit_propagator.cpp)
target_link_libraries(test_orbit_propagator OrbitDyn)

add_executable(test_orbit_maneuver test_orbit_maneuver.cpp)
target_link_libraries(test_orbit_maneuver OrbitDyn)

add_executable(test_rapidsattlite test_rapidsattlite.cpp)
target_link_libraries(test_rapidsattlite OrbitDyn)

add_executable(test_RIC test_RIC.cpp)
target_link_libraries(test_RIC OrbitDyn)

add_executable(test_sg test_sg.cpp)
target_link_libraries(test_sg OrbitDyn)

add_executable(test_sofa_Gst test_sofa_Gst.cpp)
target_link_libraries(test_sofa_Gst OrbitDyn sofa)

add_executable(testBackward testBackward.cpp)
target_link_libraries(testBackward OrbitDyn)

add_executable(test_access test_access.cpp)
target_link_libraries(test_access OrbitDyn)

add_executable(testjson testjson.cpp)

0 comments on commit 7eeb79a

Please sign in to comment.