Commit f676d89b9400f429c7d8557888c44f48b0e29780
1 parent
fc1cf266
Updated CMakeLists.txt
Showing
1 changed file
with
19 additions
and
10 deletions
CMakeLists.txt
1 | 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 ) | |
2 | +project(osdev_dbconnector) | |
3 | +# ============================================================================== | |
4 | +# Check to see if we're a submodule or top-repo. | |
5 | +if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/cmake) | |
6 | + message( STATUS "Looks like we're a single module" ) | |
5 | 7 | LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) |
6 | -elseif( IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../cmake ) | |
8 | +elseif(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../cmake) | |
9 | + message( STATUS "Looks like we're a submodule" ) | |
7 | 10 | LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../cmake) |
8 | 11 | else() |
9 | - return() | |
12 | + message( FATAL_ERROR "No cmake directory found. Did you run the submodules script?" ) | |
10 | 13 | endif() |
11 | 14 | |
15 | +# ============================================================================== | |
12 | 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}/versioning) | |
18 | + LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/versioning/cmake) | |
19 | +elseif(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../versioning) | |
20 | + LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../versioning/cmake) | |
21 | +else() | |
22 | + message( FATAL_ERROR "No ${CURRENT_SOURCE_DIR}/osdev_versioning directory found. Did you run the submodules script?" ) | |
16 | 23 | endif() |
17 | 24 | |
25 | +# ============================================================================== | |
26 | + | |
18 | 27 | include(projectheader) |
19 | 28 | project_header(osdev_dbconnector) |
20 | 29 | |
21 | 30 | add_subdirectory(src) |
22 | 31 | add_subdirectory(tests) |
23 | 32 | |
24 | -# include(packaging) | |
25 | -# package_component() | |
33 | +include(packaging) | |
34 | +package_component() | ... | ... |