Commit eb41be64c239d81bfd6fa63dc595fa666265adfa

Authored by Steven de Ridder
1 parent 596c916b

adjusted cmakelists to find the subdirectory folder

CMakeLists.txt
1 cmake_minimum_required(VERSION 3.0) 1 cmake_minimum_required(VERSION 3.0)
2 2
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) 3 +project(osdev_orm)
  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 else() 12 else()
9 - return() 13 + message( FATAL_ERROR "No cmake directory found. Did you run the submodules script?" )
10 endif() 14 endif()
11 15
  16 +# ==============================================================================
12 # Check to see if there is versioning information available 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 endif() 24 endif()
17 25
  26 +# ==============================================================================
  27 +
18 include(projectheader) 28 include(projectheader)
19 project_header(osdev_orm) 29 project_header(osdev_orm)
20 30
scripts/setup_submodules
@@ -107,10 +107,10 @@ function add_submodules() @@ -107,10 +107,10 @@ function add_submodules()
107 echo -e "< ${SUB_MODULE} >" 107 echo -e "< ${SUB_MODULE} >"
108 if [[ "${OPEN_REPOS[*]}" =~ "${SUB_MODULE}" ]]; 108 if [[ "${OPEN_REPOS[*]}" =~ "${SUB_MODULE}" ]];
109 then 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 git config submodule.${SUB_MODULE}.url ${GIT_URL_SUBS}/${SUB_MODULE}.git 111 git config submodule.${SUB_MODULE}.url ${GIT_URL_SUBS}/${SUB_MODULE}.git
112 else 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 git config submodule.${SUB_MODULE}.url ${GIT_URL_SUBS_CLOSED}/${SUB_MODULE}.git 114 git config submodule.${SUB_MODULE}.url ${GIT_URL_SUBS_CLOSED}/${SUB_MODULE}.git
115 fi 115 fi
116 done 116 done
src/CMakeLists.txt
@@ -13,14 +13,14 @@ include_directories( SYSTEM @@ -13,14 +13,14 @@ include_directories( SYSTEM
13 include(compiler) 13 include(compiler)
14 14
15 include_directories( 15 include_directories(
16 - ${CMAKE_CURRENT_SOURCE_DIR}/../config  
17 - ${CMAKE_CURRENT_SOURCE_DIR}/../global  
18 - ${CMAKE_CURRENT_SOURCE_DIR}/../logutils  
19 - ${CMAKE_CURRENT_SOURCE_DIR}/../../interfaces  
20 - ${CMAKE_CURRENT_SOURCE_DIR}/../datatypes  
21 - ${CMAKE_CURRENT_SOURCE_DIR}/../dbconnector  
22 - ${CMAKE_CURRENT_SOURCE_DIR}/../transqueue  
23 - ${CMAKE_CURRENT_SOURCE_DIR}/../pugixml 16 + ${CMAKE_CURRENT_SOURCE_DIR}/../submodules/config/src
  17 + ${CMAKE_CURRENT_SOURCE_DIR}/../submodules/global/src
  18 + ${CMAKE_CURRENT_SOURCE_DIR}/../submodules/logutils/src
  19 + ${CMAKE_CURRENT_SOURCE_DIR}/../submodules/interfaces/src
  20 + ${CMAKE_CURRENT_SOURCE_DIR}/../submodules/datatypes/src
  21 + ${CMAKE_CURRENT_SOURCE_DIR}/../submodules/dbconnector/src
  22 + ${CMAKE_CURRENT_SOURCE_DIR}/../submodules/transqueue/src
  23 + ${CMAKE_CURRENT_SOURCE_DIR}/../submodules/pugixml/src
24 ) 24 )
25 25
26 set(SRC_LIST 26 set(SRC_LIST
@@ -58,11 +58,6 @@ include(library) @@ -58,11 +58,6 @@ include(library)
58 add_libraries( 58 add_libraries(
59 ${Qt5Core_LIBRARIES} 59 ${Qt5Core_LIBRARIES}
60 ${Qt5Sql_LIBRARIES} 60 ${Qt5Sql_LIBRARIES}
61 - global  
62 - logutils  
63 - datatypes  
64 - dbconnector  
65 - transqueue  
66 ) 61 )
67 62
68 include(installation) 63 include(installation)