Commit 79ceff26 authored by James Goppert's avatar James Goppert

Moved git submodule stuff out of cmake file.

parent 0ef47dea
...@@ -3,7 +3,7 @@ cmake_minimum_required (VERSION 2.6) ...@@ -3,7 +3,7 @@ cmake_minimum_required (VERSION 2.6)
project (qgroundcontrol) project (qgroundcontrol)
# marcos # marcos
macro(find_or_build_from_source PACKAGE PACKAGE_PATH IS_GIT_SUBMODULE) macro(find_or_build_from_source PACKAGE PACKAGE_PATH)
add_custom_target(${PACKAGE}) add_custom_target(${PACKAGE})
if (NOT ${PACKAGE}_BUILD_FROM_SOURCE) if (NOT ${PACKAGE}_BUILD_FROM_SOURCE)
find_package(${PACKAGE}) find_package(${PACKAGE})
...@@ -14,11 +14,6 @@ macro(find_or_build_from_source PACKAGE PACKAGE_PATH IS_GIT_SUBMODULE) ...@@ -14,11 +14,6 @@ macro(find_or_build_from_source PACKAGE PACKAGE_PATH IS_GIT_SUBMODULE)
add_custom_target(${PACKAGE}_BUILD DEPENDS ${PACKAGE}_BUILD.stamp) add_custom_target(${PACKAGE}_BUILD DEPENDS ${PACKAGE}_BUILD.stamp)
add_dependencies(${PACKAGE} ${PACKAGE}_BUILD) add_dependencies(${PACKAGE} ${PACKAGE}_BUILD)
set(${PACKAGE}_FOUND TRUE) set(${PACKAGE}_FOUND TRUE)
if (${IS_GIT_SUBMODULE})
message(STATUS "${PACKAGE} detected as git submodule, will attempt to initialize it")
list(APPEND GIT_SUBMODULES ${PACKAGE_PATH})
add_dependencies(${PACKAGE}_BUILD GIT)
endif()
endif() endif()
endmacro(find_or_build_from_source) endmacro(find_or_build_from_source)
...@@ -103,18 +98,6 @@ include(CPack) ...@@ -103,18 +98,6 @@ include(CPack)
# add make dist target # add make dist target
add_custom_target(dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source) add_custom_target(dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source)
# git submodules
if(IS_DIRECTORY ${PROJECT_SOURCE_DIR}/.git)
message(STATUS "git repository detected, will attempt to load submodules")
set(FOUND_GIT_REPO TRUE)
add_custom_command(OUTPUT GIT.stamp
COMMAND cd ${PROJECT_SOURCE_DIR} && git submodule init ${GIT_SUBMODULES}
COMMAND cd ${PROJECT_SOURCE_DIR} && git submodule update ${GIT_SUBMODULES})
add_custom_target(GIT DEPENDS GIT.stamp)
else()
set(FOUND_GIT_REPO FALSE)
endif()
# find libraries with cmake modules # find libraries with cmake modules
find_package(Qt4 COMPONENTS QtGui QtCore QtNetwork QtOpenGL QtSVG QtXML QtPhonon QtWebKit REQUIRED) find_package(Qt4 COMPONENTS QtGui QtCore QtNetwork QtOpenGL QtSVG QtXML QtPhonon QtWebKit REQUIRED)
set(PHONON_FIND_QUIETLY FALSE) set(PHONON_FIND_QUIETLY FALSE)
...@@ -131,8 +114,8 @@ else() ...@@ -131,8 +114,8 @@ else()
set(OPENSCENEGRAPH_FOUND TRUE) set(OPENSCENEGRAPH_FOUND TRUE)
endif() endif()
find_or_build_from_source(MAVLINK thirdParty/mavlink FOUND_GIT_REPO) find_or_build_from_source(MAVLINK thirdParty/mavlink)
find_or_build_from_source(QSERIAL thirdParty/qserial FOUND_GIT_REPO) find_or_build_from_source(QSERIAL thirdParty/qserial)
# build libraries from source if not found on system # build libraries from source if not found on system
if(MAVLINK_BUILD_FROM_SOURCE) if(MAVLINK_BUILD_FROM_SOURCE)
...@@ -202,7 +185,6 @@ if(QSERIAL_BUILD_FROM_SOURCE) ...@@ -202,7 +185,6 @@ if(QSERIAL_BUILD_FROM_SOURCE)
add_library(qserial ${qserialMoc} ${qserialSrc}) add_library(qserial ${qserialMoc} ${qserialSrc})
target_link_libraries(qserial ${QT_LIBRARIES}) target_link_libraries(qserial ${QT_LIBRARIES})
set(QSERIAL_INCLUDE_DIRS set(QSERIAL_INCLUDE_DIRS
${PROJECT_SOURCE_DIR}/thirdParty/qserial/include ${PROJECT_SOURCE_DIR}/thirdParty/qserial/include
${PROJECT_SOURCE_DIR}/thirdParty/qserial/include/QtSerialPort ${PROJECT_SOURCE_DIR}/thirdParty/qserial/include/QtSerialPort
......
...@@ -18,12 +18,12 @@ do ...@@ -18,12 +18,12 @@ do
if [ $OPT = "in_source_build" ] &> /dev/null if [ $OPT = "in_source_build" ] &> /dev/null
then then
echo you chose in source build echo you chose in source build
mkdir -p build && cd build && cmake -DIN_SRC_BUILD:bool=TRUE .. && make $MAKEARGS git submodule init && git submodule update && mkdir -p build && cd build && cmake -DIN_SRC_BUILD:bool=TRUE .. && make $MAKEARGS
exit 0 exit 0
elif [ $OPT = "install_build" ] &> /dev/null elif [ $OPT = "install_build" ] &> /dev/null
then then
echo you chose install build echo you chose install build
mkdir -p build && cd build && cmake .. && make $MAKEARGS git submodule init && git submodule update mkdir -p build && cd build && cmake .. && make $MAKEARGS
exit 0 exit 0
elif [ $OPT = "grab_debian_dependencies" ] &> /dev/null elif [ $OPT = "grab_debian_dependencies" ] &> /dev/null
then then
...@@ -40,13 +40,13 @@ do ...@@ -40,13 +40,13 @@ do
elif [ $OPT = "package_source" ] &> /dev/null elif [ $OPT = "package_source" ] &> /dev/null
then then
echo you chose to package the source echo you chose to package the source
mkdir -p build && cd build && cmake .. && make package_source git submodule init && git submodule update && mkdir -p build && cd build && cmake .. && make package_source
exit 0 exit 0
elif [ $OPT = "package" ] &> /dev/null elif [ $OPT = "package" ] &> /dev/null
then then
echo you chose to package the binary echo you chose to package the binary
mkdir -p build && cd build && cmake .. && make package git submodule init && git submodule update && mkdir -p build && cd build && cmake .. && make package
exit 0 exit 0
elif [ $OPT = "clean" ] &> /dev/null elif [ $OPT = "clean" ] &> /dev/null
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment