Skip to content
This repository has been archived by the owner on Feb 21, 2021. It is now read-only.

Commit

Permalink
Updated CMakeLists.txt with the new organization of the project.
Browse files Browse the repository at this point in the history
Fix #234
  • Loading branch information
fqez committed Nov 23, 2015
1 parent 17c2007 commit b82f534
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 22 deletions.
37 changes: 24 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -200,16 +200,28 @@ FOREACH(currentSourceFile ${HEADERS_FILES})
INSTALL (FILES ${currentSourceFile} DESTINATION /usr/local/include/jderobot/${new_source1})
ENDFOREACH(currentSourceFile)

# Install Executables
list_subdirectories2( LIST_COMPONENTS ${CMAKE_CURRENT_SOURCE_DIR}/src/stable/components/ 1)

FOREACH (currentBin ${LIST_COMPONENTS})
#SET(EXIST EXIST-NOTFOUND)
find_file(EXIST NAMES ${currentBin} PATHS ${CMAKE_CURRENT_SOURCE_DIR}/src/components/${currentBin})
#IF (EXIST)
INSTALL (PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/src/stable/components/${currentBin}/${currentBin} DESTINATION /usr/local/bin OPTIONAL)
#ENDIF(EXIST)
#MESSAGE("${EXIST}")
# Install Executables
list_subdirectories2( LIST_TOOLS ${CMAKE_CURRENT_SOURCE_DIR}/src/stable/tools/ 1)
list_subdirectories2( LIST_DRIVERS ${CMAKE_CURRENT_SOURCE_DIR}/src/stable/drivers/ 1)


FOREACH (currentBin ${LIST_TOOLS})
#SET(EXIST EXIST-NOTFOUND)
find_file(EXIST NAMES ${currentBin} PATHS ${CMAKE_CURRENT_SOURCE_DIR}/src/components/${currentBin})
find_file(EXIST NAMES ${currentBin} PATHS ${CMAKE_CURRENT_SOURCE_DIR}/src/tools/${currentBin})
#IF (EXIST)
INSTALL (PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/src/stable/tools/${currentBin}/${currentBin} DESTINATION /usr/local/bin OPTIONAL)
#ENDIF(EXIST)
#MESSAGE("${EXIST}")
ENDFOREACH(currentBin)

FOREACH (currentBin ${LIST_DRIVERS})
#SET(EXIST EXIST-NOTFOUND)
find_file(EXIST NAMES ${currentBin} PATHS ${CMAKE_CURRENT_SOURCE_DIR}/src/drivers/${currentBin})
#IF (EXIST)
INSTALL (PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/src/stable/drivers/${currentBin}/${currentBin} DESTINATION /usr/local/bin OPTIONAL)
#ENDIF(EXIST)
#MESSAGE("${EXIST}")
ENDFOREACH(currentBin)

# Install interfaces headers
Expand All @@ -223,15 +235,14 @@ FILE(GLOB SLICE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/stable/interfaces/slice/jd
INSTALL (FILES ${SLICE_FILES} DESTINATION /usr/local/include/jderobot/slice)

# Install CONF
FILE(GLOB_RECURSE CONF_FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/stable/components/*.cfg)
FILE(GLOB_RECURSE CONF_FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/stable/**.cfg)
INSTALL (FILES ${CONF_FILES} DESTINATION /usr/local/share/jderobot/conf)

# Install Glade
FILE(GLOB_RECURSE GLADE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/stable/components/*.glade)
FILE(GLOB_RECURSE GLADE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/stable/**.glade)
INSTALL (FILES ${GLADE_FILES} DESTINATION /usr/local/share/jderobot/glade)



###################
# #
# UNINSTALL #
Expand Down
16 changes: 16 additions & 0 deletions src/stable/drivers/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
list_subdirectories( LIST_DRIVERS ${CMAKE_CURRENT_SOURCE_DIR} 1)

IF(NOT DEFINED build-default)
SET(build-default ON)
ENDIF(NOT DEFINED build-default)

FOREACH (driver ${LIST_DRIVERS})
if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${driver}/CMakeLists.txt)
SET(build_${driver} ${build-default} CACHE BOOL "Build driver ${driver}")
IF(build_${driver})
MESSAGE(STATUS "Processing driver ${driver}")
ADD_SUBDIRECTORY (${driver})
ENDIF(build_${driver})
endif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${driver}/CMakeLists.txt)
ENDFOREACH()

18 changes: 9 additions & 9 deletions src/stable/tools/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
list_subdirectories( LIST_COMPONENTS ${CMAKE_CURRENT_SOURCE_DIR} 1)
list_subdirectories( LIST_TOOLS ${CMAKE_CURRENT_SOURCE_DIR} 1)

IF(NOT DEFINED build-default)
SET(build-default ON)
ENDIF(NOT DEFINED build-default)

FOREACH (component ${LIST_COMPONENTS})
if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${component}/CMakeLists.txt)
SET(build_${component} ${build-default} CACHE BOOL "Build component ${component}")
IF(build_${component})
MESSAGE(STATUS "Processing component ${component}")
ADD_SUBDIRECTORY (${component})
ENDIF(build_${component})
endif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${component}/CMakeLists.txt)
FOREACH (tool ${LIST_TOOLS})
if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${tool}/CMakeLists.txt)
SET(build_${tool} ${build-default} CACHE BOOL "Build tool ${tool}")
IF(build_${tool})
MESSAGE(STATUS "Processing tool ${tool}")
ADD_SUBDIRECTORY (${tool})
ENDIF(build_${tool})
endif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${tool}/CMakeLists.txt)
ENDFOREACH()

0 comments on commit b82f534

Please sign in to comment.