Commit cb1cc3f7c6716b656616f2e64ef942c699d9c773

Authored by Steven de Ridder
1 parent f676d89b

adjusted include_directories in CMakeLists.txt

Showing 1 changed file with 28 additions and 8 deletions
src/CMakeLists.txt
1   -cmake_minimum_required(VERSION 3.0)
  1 +cmake_minimum_required(VERSION 3.12)
  2 +# ==============================================================================
  3 +# Check to see if we're a submodule or top-repo.
  4 +if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../cmake)
  5 + message( STATUS "Looks like we're a single module" )
  6 + LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../cmake)
  7 +elseif(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../../cmake)
  8 + message( STATUS "Looks like we're a submodule" )
  9 + LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../cmake)
  10 +else()
  11 + message( FATAL_ERROR "No cmake directory found. Did you run the submodules script?" )
  12 +endif()
  13 +
  14 +# ==============================================================================
  15 +# Check to see if there is versioning information available
  16 +if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../versioning)
  17 + LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../versioning/cmake)
  18 +elseif(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../../versioning)
  19 + LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../versioning/cmake)
  20 +else()
  21 + message( FATAL_ERROR "No ${CURRENT_SOURCE_DIR}/osdev_versioning directory found. Did you run the submodules script?" )
  22 +endif()
  23 +# ==============================================================================
  24 +
2 25 include(projectheader)
3 26 project_header(dbconnector)
4 27  
... ... @@ -13,11 +36,10 @@ include_directories( SYSTEM
13 36 include(compiler)
14 37  
15 38 include_directories(
16   - ${CMAKE_CURRENT_SOURCE_DIR}/../pugixml
17   - ${CMAKE_CURRENT_SOURCE_DIR}/../logutils
18   - ${CMAKE_CURRENT_SOURCE_DIR}/../config
19   - ${CMAKE_CURRENT_SOURCE_DIR}/../dcxml
20   - ${CMAKE_CURRENT_SOURCE_DIR}/../global
  39 + ${CMAKE_CURRENT_SOURCE_DIR}/../pugixml/src/
  40 + ${CMAKE_CURRENT_SOURCE_DIR}/../logutils/src/
  41 + ${CMAKE_CURRENT_SOURCE_DIR}/../config/src/
  42 + ${CMAKE_CURRENT_SOURCE_DIR}/../global/src/
21 43 )
22 44  
23 45 set(SRC_LIST
... ... @@ -47,8 +69,6 @@ include(library)
47 69 add_libraries(
48 70 ${Qt5Core_LIBRARIES}
49 71 ${Qt5Sql_LIBRARIES}
50   - logutils
51   - global
52 72 pugixml
53 73 )
54 74  
... ...