mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-27 19:45:43 +03:00
Оптимизировал все CMakeLists.txt
This commit is contained in:
@@ -1,7 +1,35 @@
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
message("Using CMake ${CMAKE_VERSION}\n")
|
||||
|
||||
project(LMS LANGUAGES CXX)
|
||||
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
set(REPO_PATH ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
set(PROJECT_TYPE_DEBUG TRUE)
|
||||
endif()
|
||||
if(PROJECT_TYPE_DEBUG)
|
||||
add_definitions(-DPROJECT_TYPE_DEBUG)
|
||||
endif()
|
||||
|
||||
include(cmake/CommonInfoForProject.cmake)
|
||||
|
||||
common_info_for_project(LMS)
|
||||
|
||||
find_package(Qt5 COMPONENTS Widgets REQUIRED)
|
||||
find_package(Qt5 COMPONENTS Network REQUIRED)
|
||||
find_package(Qt5 COMPONENTS Sql REQUIRED)
|
||||
find_package(Qt5 COMPONENTS LinguistTools REQUIRED)
|
||||
find_package(Qt5 COMPONENTS Xml REQUIRED)
|
||||
find_package(Qt5 COMPONENTS Concurrent REQUIRED)
|
||||
|
||||
add_subdirectory(DataBaseLMS)
|
||||
add_subdirectory(InstructorsAndTrainees)
|
||||
add_subdirectory(GUIdataBaseLMS)
|
||||
|
||||
@@ -1,27 +1,6 @@
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
project(DataBaseLMS LANGUAGES CXX)
|
||||
|
||||
get_filename_component(REPO_PATH ${CMAKE_CURRENT_SOURCE_DIR} DIRECTORY)
|
||||
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
set(PROJECT_TYPE_DEBUG TRUE)
|
||||
endif()
|
||||
|
||||
if(PROJECT_TYPE_DEBUG)
|
||||
add_definitions(-DPROJECT_TYPE_DEBUG)
|
||||
endif()
|
||||
|
||||
find_package(Qt5 COMPONENTS Widgets REQUIRED)
|
||||
find_package(Qt5 COMPONENTS Sql REQUIRED)
|
||||
find_package(Qt5 COMPONENTS LinguistTools REQUIRED)
|
||||
common_info_for_project(DataBaseLMS)
|
||||
|
||||
add_library(DataBaseLMS SHARED
|
||||
DataBaseLMS_global.h
|
||||
@@ -52,8 +31,6 @@ target_link_libraries(DataBaseLMS PRIVATE Qt5::Sql)
|
||||
|
||||
target_compile_definitions(DataBaseLMS PRIVATE DATABASELMS_LIBRARY)
|
||||
|
||||
message("${REPO_PATH}")
|
||||
|
||||
if(PROJECT_TYPE_DEBUG)
|
||||
|
||||
add_custom_command(TARGET DataBaseLMS
|
||||
|
||||
@@ -1,28 +1,6 @@
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
project(GUIdataBaseLMS LANGUAGES CXX)
|
||||
|
||||
get_filename_component(REPO_PATH ${CMAKE_CURRENT_SOURCE_DIR} DIRECTORY)
|
||||
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
set(PROJECT_TYPE_DEBUG TRUE)
|
||||
endif()
|
||||
|
||||
if(PROJECT_TYPE_DEBUG)
|
||||
add_definitions(-DPROJECT_TYPE_DEBUG)
|
||||
endif()
|
||||
|
||||
find_package(Qt5 COMPONENTS Widgets REQUIRED)
|
||||
find_package(Qt5 COMPONENTS Sql REQUIRED)
|
||||
find_package(Qt5 COMPONENTS Xml REQUIRED)
|
||||
find_package(Qt5 COMPONENTS Network REQUIRED)
|
||||
common_info_for_project(GUIdataBaseLMS)
|
||||
|
||||
add_executable(GUIdataBaseLMS
|
||||
main.cpp
|
||||
@@ -32,13 +10,11 @@ mainwindow.ui
|
||||
testDBpgSQL.qrc
|
||||
)
|
||||
|
||||
|
||||
target_link_libraries(GUIdataBaseLMS PRIVATE Qt5::Widgets)
|
||||
target_link_libraries(GUIdataBaseLMS PRIVATE Qt5::Sql)
|
||||
target_link_libraries(GUIdataBaseLMS PRIVATE Qt5::Xml)
|
||||
target_link_libraries(GUIdataBaseLMS PRIVATE Qt5::Network)
|
||||
|
||||
|
||||
target_include_directories(GUIdataBaseLMS PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../InstructorsAndTrainees)
|
||||
target_include_directories(GUIdataBaseLMS PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../InstructorsAndTrainees/instructors)
|
||||
target_include_directories(GUIdataBaseLMS PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../InstructorsAndTrainees/trainees)
|
||||
|
||||
@@ -1,29 +1,6 @@
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
project(InstructorsAndTrainees LANGUAGES CXX)
|
||||
|
||||
get_filename_component(REPO_PATH ${CMAKE_CURRENT_SOURCE_DIR} DIRECTORY)
|
||||
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
set(PROJECT_TYPE_DEBUG TRUE)
|
||||
endif()
|
||||
|
||||
if(PROJECT_TYPE_DEBUG)
|
||||
add_definitions(-DPROJECT_TYPE_DEBUG)
|
||||
endif()
|
||||
|
||||
find_package(Qt5 COMPONENTS Widgets REQUIRED)
|
||||
find_package(Qt5 COMPONENTS Sql REQUIRED)
|
||||
find_package(Qt5 COMPONENTS LinguistTools REQUIRED)
|
||||
find_package(Qt5 COMPONENTS Xml REQUIRED)
|
||||
find_package(Qt5 COMPONENTS Network REQUIRED)
|
||||
common_info_for_project(InstructorsAndTrainees)
|
||||
|
||||
add_library(InstructorsAndTrainees SHARED
|
||||
instructorsAndTrainees_global.h
|
||||
@@ -105,7 +82,6 @@ target_link_libraries(InstructorsAndTrainees PRIVATE Qt5::Sql)
|
||||
target_link_libraries(InstructorsAndTrainees PRIVATE Qt5::Xml)
|
||||
target_link_libraries(InstructorsAndTrainees PRIVATE Qt5::Network)
|
||||
|
||||
|
||||
target_include_directories(InstructorsAndTrainees PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/instructors)
|
||||
target_include_directories(InstructorsAndTrainees PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/trainees)
|
||||
target_include_directories(InstructorsAndTrainees PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/tasks)
|
||||
@@ -116,7 +92,6 @@ target_include_directories(InstructorsAndTrainees PUBLIC ${CMAKE_CURRENT_SOURCE_
|
||||
|
||||
target_compile_definitions(InstructorsAndTrainees PRIVATE INSTRUCTORSANDTRAINEES_LIBRARY)
|
||||
|
||||
|
||||
target_include_directories(InstructorsAndTrainees PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../DataBaseLMS)
|
||||
if(PROJECT_TYPE_DEBUG)
|
||||
target_link_directories(InstructorsAndTrainees PUBLIC ${REPO_PATH}/BUILDS/Debug64/DataBaseLMS)
|
||||
@@ -125,7 +100,6 @@ elseif()
|
||||
endif()
|
||||
target_link_libraries(InstructorsAndTrainees PRIVATE libDataBaseLMS.dll)
|
||||
|
||||
|
||||
if(PROJECT_TYPE_DEBUG)
|
||||
add_custom_command(TARGET InstructorsAndTrainees
|
||||
POST_BUILD
|
||||
@@ -140,6 +114,5 @@ elseif()
|
||||
${REPO_PATH}/BUILDS/Release64/GUIdataBaseLMS)
|
||||
endif()
|
||||
|
||||
|
||||
#Только для TSMP!
|
||||
#install(TARGETS InstructorsAndTrainees DESTINATION ${VEYON_LIB_DIR})
|
||||
|
||||
@@ -1,31 +1,6 @@
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
project(ServerLMS LANGUAGES CXX)
|
||||
|
||||
get_filename_component(REPO_PATH ${CMAKE_CURRENT_SOURCE_DIR} DIRECTORY)
|
||||
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
set(PROJECT_TYPE_DEBUG TRUE)
|
||||
endif()
|
||||
|
||||
if(PROJECT_TYPE_DEBUG)
|
||||
add_definitions(-DPROJECT_TYPE_DEBUG)
|
||||
endif()
|
||||
|
||||
find_package(Qt5 COMPONENTS Widgets REQUIRED)
|
||||
find_package(Qt5 COMPONENTS Network REQUIRED)
|
||||
find_package(Qt5 COMPONENTS Sql REQUIRED)
|
||||
find_package(Qt5 COMPONENTS LinguistTools REQUIRED)
|
||||
find_package(Qt5 REQUIRED COMPONENTS Concurrent)
|
||||
find_package(Qt5 COMPONENTS Xml REQUIRED)
|
||||
|
||||
common_info_for_project(ServerLMS)
|
||||
|
||||
add_library(ServerLMS SHARED
|
||||
ServerLMS_global.h
|
||||
@@ -75,7 +50,6 @@ target_link_libraries(ServerLMS PRIVATE Qt5::Concurrent)
|
||||
target_link_libraries(ServerLMS PRIVATE Qt5::Sql)
|
||||
target_link_libraries(ServerLMS PRIVATE Qt5::Xml)
|
||||
|
||||
|
||||
target_include_directories(ServerLMS PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../DataBaseLMS)
|
||||
if(PROJECT_TYPE_DEBUG)
|
||||
target_link_directories(ServerLMS PUBLIC ${REPO_PATH}/BUILDS/Debug64/DataBaseLMS)
|
||||
@@ -84,10 +58,8 @@ elseif()
|
||||
endif()
|
||||
target_link_libraries(ServerLMS PRIVATE libDataBaseLMS.dll)
|
||||
|
||||
|
||||
target_compile_definitions(ServerLMS PRIVATE SERVERLMS_LIBRARY)
|
||||
|
||||
|
||||
if(PROJECT_TYPE_DEBUG)
|
||||
add_custom_command(TARGET ServerLMS
|
||||
POST_BUILD
|
||||
|
||||
@@ -1,31 +1,6 @@
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
project(TestServerLMS LANGUAGES CXX)
|
||||
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
|
||||
get_filename_component(REPO_PATH ${CMAKE_CURRENT_SOURCE_DIR} DIRECTORY)
|
||||
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
set(PROJECT_TYPE_DEBUG TRUE)
|
||||
endif()
|
||||
|
||||
if(PROJECT_TYPE_DEBUG)
|
||||
add_definitions(-DPROJECT_TYPE_DEBUG)
|
||||
endif()
|
||||
|
||||
find_package(Qt5 COMPONENTS Widgets REQUIRED)
|
||||
find_package(Qt5 COMPONENTS Network REQUIRED)
|
||||
find_package(Qt5 COMPONENTS Sql REQUIRED)
|
||||
find_package(Qt5 COMPONENTS LinguistTools REQUIRED)
|
||||
find_package(Qt5 COMPONENTS Xml REQUIRED)
|
||||
common_info_for_project(TestServerLMS)
|
||||
|
||||
add_executable(TestServerLMS
|
||||
main.cpp
|
||||
@@ -40,7 +15,6 @@ target_link_libraries(TestServerLMS PRIVATE Qt5::Network)
|
||||
target_link_libraries(TestServerLMS PRIVATE Qt5::Sql)
|
||||
target_link_libraries(TestServerLMS PRIVATE Qt5::Xml)
|
||||
|
||||
message("${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
target_include_directories(TestServerLMS PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../DataBaseLMS)
|
||||
if(PROJECT_TYPE_DEBUG)
|
||||
target_link_directories(TestServerLMS PUBLIC ${REPO_PATH}/BUILDS/Debug64/DataBaseLMS)
|
||||
|
||||
7
cmake/CommonInfoForProject.cmake
Normal file
7
cmake/CommonInfoForProject.cmake
Normal file
@@ -0,0 +1,7 @@
|
||||
macro(common_info_for_project TARGET_NAME)
|
||||
message("${TARGET_NAME}: ")
|
||||
message("CMAKE_CURRENT_SOURCE_DIR: ${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
message("REPO_PATH: ${REPO_PATH}")
|
||||
message("PROJECT_TYPE_DEBUG: ${PROJECT_TYPE_DEBUG}\n")
|
||||
endmacro()
|
||||
|
||||
Reference in New Issue
Block a user