Commit 298a7901eb947ac99cd12c7c05218c1c52fa0260
1 parent
4d804c25
adjusted cmakelists to find the subdirectory folder.
Showing
3 changed files
with
23 additions
and
15 deletions
CMakeLists.txt
1 | cmake_minimum_required(VERSION 3.0) | 1 | cmake_minimum_required(VERSION 3.0) |
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) | 2 | +project(osdev_iputils) |
3 | +# ============================================================================== | ||
4 | +# Check to see if we're a submodule or top-repo. | ||
5 | +if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/submodules/cmake) | ||
6 | + message( STATUS "Looks like we're a single module" ) | ||
7 | + LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/submodules/cmake) | ||
8 | +elseif(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../submodules/cmake) | ||
9 | + message( STATUS "Looks like we're a submodule" ) | ||
10 | + LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../submodules/cmake) | ||
8 | else() | 11 | else() |
9 | - return() | 12 | + message( FATAL_ERROR "No cmake directory found. Did you run the submodules script?" ) |
10 | endif() | 13 | endif() |
11 | 14 | ||
15 | +# ============================================================================== | ||
12 | # Check to see if there is versioning information available | 16 | # 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) | 17 | +if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/submodules/versioning) |
18 | + LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/submodules/versioning/cmake) | ||
19 | +elseif(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../submodules/versioning) | ||
20 | + LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../submodules/versioning/cmake) | ||
21 | +else() | ||
22 | + message( FATAL_ERROR "No ${CURRENT_SOURCE_DIR}/osdev_versioning directory found. Did you run the submodules script?" ) | ||
16 | endif() | 23 | endif() |
17 | 24 | ||
25 | +# ============================================================================== | ||
26 | + | ||
18 | include(projectheader) | 27 | include(projectheader) |
19 | project_header(osdev_iputils) | 28 | project_header(osdev_iputils) |
20 | 29 |
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
@@ -3,7 +3,7 @@ LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake) | @@ -3,7 +3,7 @@ LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake) | ||
3 | include(projectheader) | 3 | include(projectheader) |
4 | project_header(iputils) | 4 | project_header(iputils) |
5 | 5 | ||
6 | -find_package( Qt5Core REQUIRED ) | 6 | +find_package( Qt5Core REQUIRED ) |
7 | find_package( Qt5Network REQUIRED ) | 7 | find_package( Qt5Network REQUIRED ) |
8 | 8 | ||
9 | include_directories( SYSTEM | 9 | include_directories( SYSTEM |
@@ -14,7 +14,7 @@ include_directories( SYSTEM | @@ -14,7 +14,7 @@ include_directories( SYSTEM | ||
14 | include(compiler) | 14 | include(compiler) |
15 | 15 | ||
16 | include_directories( | 16 | include_directories( |
17 | - ${CMAKE_CURRENT_SOURCE_DIR}/../logutils | 17 | + ${CMAKE_CURRENT_SOURCE_DIR}/../submodules/logutils/src |
18 | ) | 18 | ) |
19 | 19 | ||
20 | set(SRC_LIST | 20 | set(SRC_LIST |
@@ -49,7 +49,6 @@ include(library) | @@ -49,7 +49,6 @@ include(library) | ||
49 | add_libraries( | 49 | add_libraries( |
50 | ${Qt5Core_LIBRARIES} | 50 | ${Qt5Core_LIBRARIES} |
51 | ${Qt5Network_LIBRARIES} | 51 | ${Qt5Network_LIBRARIES} |
52 | - logutils | ||
53 | ) | 52 | ) |
54 | 53 | ||
55 | include(installation) | 54 | include(installation) |