Commit 39a9e98f2c9ae50d1063c3544a84d725342e8774

Authored by Steven de Ridder
1 parent 61cff0a3

adjusted cmakelists to find the subdirectory folder.

CMakeLists.txt
1 1 cmake_minimum_required(VERSION 3.0)
  2 +project(transqueue)
2 3  
3   -# Check to see where cmake is located.
4   -if( IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/cmake )
5   - LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
6   -elseif( IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../cmake )
7   - LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../cmake)
  4 +# ==============================================================================
  5 +# Check to see if we're a submodule or top-repo.
  6 +if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/submodules/cmake)
  7 + message( STATUS "Looks like we're a single module" )
  8 + LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/submodules/cmake)
  9 +elseif(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../submodules/cmake)
  10 + message( STATUS "Looks like we're a submodule" )
  11 + LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../submodules/cmake)
8 12 else()
9   - return()
  13 + message( FATAL_ERROR "No cmake directory found. Did you run the submodules script?" )
10 14 endif()
11 15  
  16 +# ==============================================================================
12 17 # Check to see if there is versioning information available
13   -if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/osdev_versioning/cmake)
14   - LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/osdev_versioning/cmake)
15   - include(osdevversion)
  18 +if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/submodules/versioning)
  19 + LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/submodules/versioning/cmake)
  20 +elseif(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../submodules/versioning)
  21 + LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../submodules/versioning/cmake)
  22 +else()
  23 + message( FATAL_ERROR "No ${CURRENT_SOURCE_DIR}/osdev_versioning directory found. Did you run the submodules script?" )
16 24 endif()
17 25  
  26 +# ==============================================================================
  27 +
18 28 include(projectheader)
19 29 project_header(osdev_transqueue)
20 30  
... ...
scripts/setup_submodules
... ... @@ -107,10 +107,10 @@ function add_submodules()
107 107 echo -e "< ${SUB_MODULE} >"
108 108 if [[ "${OPEN_REPOS[*]}" =~ "${SUB_MODULE}" ]];
109 109 then
110   - git submodule add -f ${GIT_URL_SUBS}/${SUB_MODULE}.git ${SUB_MODULE}
  110 + git submodule add -f ${GIT_URL_SUBS}/${SUB_MODULE}.git submodules/${SUB_MODULE}
111 111 git config submodule.${SUB_MODULE}.url ${GIT_URL_SUBS}/${SUB_MODULE}.git
112 112 else
113   - git submodule add -f ${GIT_URL_SUBS_CLOSED}/${SUB_MODULE}.git ${SUB_MODULE}
  113 + git submodule add -f ${GIT_URL_SUBS_CLOSED}/${SUB_MODULE}.git submodules/${SUB_MODULE}
114 114 git config submodule.${SUB_MODULE}.url ${GIT_URL_SUBS_CLOSED}/${SUB_MODULE}.git
115 115 fi
116 116 done
... ...
src/CMakeLists.txt
1 1 cmake_minimum_required(VERSION 3.0)
2   -LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake)
3 2 include(projectheader)
4 3 project_header(transqueue)
5 4  
... ... @@ -8,10 +7,10 @@ find_package( Qt5Sql REQUIRED )
8 7  
9 8 include_directories( SYSTEM
10 9 ${Qt5Core_INCLUDE_DIRS}
11   - ${CMAKE_CURRENT_SOURCE_DIR}/../datatypes
12   - ${CMAKE_CURRENT_SOURCE_DIR}/../logutils
13   - ${CMAKE_CURRENT_SOURCE_DIR}/../config
14   - ${CMAKE_CURRENT_SOURCE_DIR}/../pugixml
  10 + ${CMAKE_CURRENT_SOURCE_DIR}/../submodules/datatypes/src
  11 + ${CMAKE_CURRENT_SOURCE_DIR}/../submodules/logutils/src
  12 + ${CMAKE_CURRENT_SOURCE_DIR}/../submodules/config/src
  13 + ${CMAKE_CURRENT_SOURCE_DIR}/../submodules/pugixml/src
15 14 )
16 15  
17 16 include(compiler)
... ...