Skip to content

Commit

Permalink
Refactoring CMakeLists.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
bsongis committed May 27, 2014
1 parent b736517 commit 7f7d92b
Showing 1 changed file with 24 additions and 39 deletions.
63 changes: 24 additions & 39 deletions companion/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -111,19 +111,16 @@ include_directories(
add_subdirectory(modeledit)
add_subdirectory(simulation)

set(companion_SRCS
set(common_SRCS
eeprominterface.cpp
hexinterface.cpp
flashinterface.cpp
file.cpp
xmlinterface.cpp
${PROJECT_BINARY_DIR}/radio.cxx
firmwares/th9x/th9xeeprom.cpp
firmwares/th9x/th9xeeprom.cpp # TODO not needed
firmwares/th9x/th9xinterface.cpp
firmwares/er9x/er9xeeprom.cpp
firmwares/er9x/er9xinterface.cpp
firmwares/gruvin9x/gruvin9xeeprom.cpp
firmwares/gruvin9x/gruvin9xinterface.cpp
firmwares/ersky9x/ersky9xeeprom.cpp
firmwares/ersky9x/ersky9xinterface.cpp
firmwares/opentx/opentxeeprom.cpp
firmwares/opentx/open9xStockeeprom.cpp
firmwares/opentx/open9xGruvin9xeeprom.cpp
Expand All @@ -133,13 +130,24 @@ set(companion_SRCS
firmwares/opentx/opentxSky9xsimulator.cpp
firmwares/opentx/opentxGruvin9xsimulator.cpp
firmwares/opentx/opentxM128simulator.cpp
firmwares/opentx/opentxsimulator.cpp
firmwares/ersky9x/ersky9xeeprom.cpp
firmwares/ersky9x/ersky9xinterface.cpp
firmwares/opentx/opentxsimulator.cpp
file.cpp
googleanalytics.cpp
appdata.cpp
)

set(common_MOC_HDRS
googleanalytics.h
)

set(companion_SRCS
hexinterface.cpp
flashinterface.cpp
xmlinterface.cpp
${PROJECT_BINARY_DIR}/radio.cxx
${RADIO_SRC_DIRECTORY}/stamp-opentx.h
${RADIO_SRC_DIRECTORY}/bitmaps/sticks.lbm
${RADIO_SRC_DIRECTORY}/translations/en.h
appdata.cpp
helpers.cpp
mdichild.cpp
generaledit.cpp
Expand All @@ -164,7 +172,6 @@ set(companion_SRCS
qcustomplot.cpp
wizarddata.cpp
wizarddialog.cpp
googleanalytics.cpp
)

set(companion_MOC_HDRS
Expand All @@ -191,7 +198,6 @@ set(companion_MOC_HDRS
qautocombobox.h
helpers.h
wizarddialog.h
googleanalytics.h
)

set(companion_UIS
Expand Down Expand Up @@ -268,8 +274,9 @@ FOREACH( language ${LANGUAGES} )
SET( companion_TS ${companion_TS} translations/companion_${language}.ts )
ENDFOREACH( language )

set( companion_SRCS ${common_SRCS} ${companion_SRCS} )
QT4_WRAP_UI( companion_SRCS ${companion_UIS} )
QT4_WRAP_CPP( companion_SRCS ${companion_MOC_HDRS} )
QT4_WRAP_CPP( companion_SRCS ${companion_MOC_HDRS} ${common_MOC_HDRS} )
QT4_ADD_TRANSLATION( companion_QM ${companion_TS} )
QT4_ADD_RESOURCES( companion_SRCS ${companion_RCS} )

Expand Down Expand Up @@ -313,44 +320,22 @@ add_custom_command(
)

set(simu_SRCS
eeprominterface.cpp
firmwares/th9x/th9xeeprom.cpp # TODO not needed
firmwares/th9x/th9xinterface.cpp
${TH9X_CHECKOUT_DIRECTORY}/th9xsimulator.cpp
firmwares/er9x/er9xeeprom.cpp # TODO not needed
firmwares/er9x/er9xinterface.cpp
${ER9X_CHECKOUT_DIRECTORY}/er9xsimulator.cpp
firmwares/gruvin9x/gruvin9xeeprom.cpp # TODO not needed
firmwares/gruvin9x/gruvin9xinterface.cpp
firmwares/opentx/opentxeeprom.cpp # TODO not needed
firmwares/opentx/open9xStockeeprom.cpp # TODO not needed
firmwares/opentx/open9xGruvin9xeeprom.cpp # TODO not needed
firmwares/opentx/open9xSky9xeeprom.cpp # TODO not needed
firmwares/opentx/opentxinterface.cpp
firmwares/opentx/opentxTaranisSimulator.cpp
firmwares/opentx/opentxSky9xsimulator.cpp
firmwares/opentx/opentxGruvin9xsimulator.cpp
firmwares/opentx/opentxM128simulator.cpp
firmwares/opentx/opentxsimulator.cpp
firmwares/ersky9x/ersky9xeeprom.cpp # TODO not needed
firmwares/ersky9x/ersky9xinterface.cpp
${ERSKY9X_CHECKOUT_DIRECTORY}/ersky9xsimulator.cpp
${RADIO_SRC_DIRECTORY}/bitmaps/sticks.lbm
${RADIO_SRC_DIRECTORY}/translations/en.h
file.cpp # TODO not needed
modeledit/node.cpp
modeledit/edge.cpp # TODO not needed
appdata.cpp
simulator.cpp
googleanalytics.cpp
)

set(simu_HDRS
set(simu_MOC_HDRS
modeledit/node.h
googleanalytics.h
)

qt4_wrap_cpp(simu_SRCS ${simu_HDRS} )
set( simu_SRCS ${simu_SRCS} ${common_SRCS} )
qt4_wrap_cpp(simu_SRCS ${simu_MOC_HDRS} ${common_MOC_HDRS} )
qt4_add_resources(simu_SRCS companion.qrc) # TODO not needed

if(WIN32)
Expand Down

8 comments on commit 7f7d92b

@projectkk2glider
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After this commit running cmake ../src/ returns error:

$ cmake ../src/
-- Looking for XercesC 
--   found xerces-c: /usr/lib/x86_64-linux-gnu/libxerces-c.so
-- Looking for Xsd 
-- /usr/bin/xsdcxx
XSD Include Path: /usr/include
-- Looking for SDL 
SDL Include Path: /usr/include/SDL
-- Looking for PHONON 
-- Phonon Version: 4.6.0
PHONON Include Path: /usr/include/qt4
CMake Error: Attempt to add a custom rule to output "<removed>/opentx/companion/debug/moc_googleanalytics.cxx.rule" which already has a custom rule.
-- Configuring incomplete, errors occurred!

@bsongis
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you do a make clean?

@projectkk2glider
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make clean not helping. Even removing whole build directory and starting with new one doesn't help.

@bsongis
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then install the latest CMake version (2.8.12), I have it here and I also installed it on the compilation server

@projectkk2glider
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jenkins had the same issue http://jenkins.open-tx.org:8080/job/OpenTX%20-%20Commit%20builds/1629/console

I presume you fixed it by installing new cmake. I will try that later.

@projectkk2glider
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Installing cmake 2.8.12.2 did solve this issue. But, I would be more happy if contents of CMakeLists.txt were modified to work with older versions of cmake.

@bsongis
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, indeed, I have a rework in progress in a dedicated branch, but it will happen after 2.0.0 is out!

@projectkk2glider
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I came up with this solution bffff32. Looks like macro QT4_GENERATE_MOC can't process same file twice in cmake 2.8.10.

Please sign in to comment.