diff options
-rw-r--r-- | CMakeLists.txt | 10 | ||||
-rw-r--r-- | client/CMakeLists.txt | 5 | ||||
-rw-r--r-- | common/CMakeLists.txt | 10 | ||||
-rw-r--r-- | common/commands/CMakeLists.txt | 1 | ||||
-rw-r--r-- | resource/CMakeLists.txt | 4 |
5 files changed, 19 insertions, 11 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 91c4568..09c6a1e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
@@ -20,10 +20,14 @@ include(ECMPackageConfigHelpers) | |||
20 | 20 | ||
21 | find_package(Qt5Core REQUIRED) | 21 | find_package(Qt5Core REQUIRED) |
22 | find_package(FlatBuffers REQUIRED) | 22 | find_package(FlatBuffers REQUIRED) |
23 | function(generate_flatbuffers dest) | 23 | function(generate_flatbuffers) |
24 | # TODO: move the file from ${fbs}_generated.h to just ${fbs}? | ||
25 | foreach(fbs ${ARGN}) | 24 | foreach(fbs ${ARGN}) |
26 | execute_process(COMMAND ${FLATBUFFERS_FLATC_EXECUTABLE} -c -b --gen-includes -o ${dest} ${CMAKE_CURRENT_SOURCE_DIR}/${fbs}) | 25 | message("making ${CMAKE_CURRENT_BINARY_DIR}/${fbs}_generated.h from ${CMAKE_CURRENT_SOURCE_DIR}/${fbs}.fbs") |
26 | add_custom_command( | ||
27 | OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${fbs}_generated.h | ||
28 | COMMAND ${FLATBUFFERS_FLATC_EXECUTABLE} -c -b --gen-includes -o ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/${fbs}.fbs | ||
29 | DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${fbs}.fbs | ||
30 | ) | ||
27 | endforeach(fbs) | 31 | endforeach(fbs) |
28 | endfunction(generate_flatbuffers) | 32 | endfunction(generate_flatbuffers) |
29 | 33 | ||
diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index 186e3fe..859f707 100644 --- a/client/CMakeLists.txt +++ b/client/CMakeLists.txt | |||
@@ -2,13 +2,12 @@ project(toynadi_client) | |||
2 | 2 | ||
3 | include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) | 3 | include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) |
4 | 4 | ||
5 | set(common_path "../common/") | ||
6 | |||
7 | set(toynadiclient_SRCS | 5 | set(toynadiclient_SRCS |
8 | ${common_path}/console.cpp | ||
9 | main.cpp | 6 | main.cpp |
10 | resourceaccess.cpp | 7 | resourceaccess.cpp |
11 | ) | 8 | ) |
9 | |||
12 | add_executable(${PROJECT_NAME} ${toynadiclient_SRCS}) | 10 | add_executable(${PROJECT_NAME} ${toynadiclient_SRCS}) |
11 | target_link_libraries(${PROJECT_NAME} toynadicommon) | ||
13 | qt5_use_modules(${PROJECT_NAME} Widgets Network) | 12 | qt5_use_modules(${PROJECT_NAME} Widgets Network) |
14 | install(TARGETS ${PROJECT_NAME} DESTINATION bin) | 13 | install(TARGETS ${PROJECT_NAME} DESTINATION bin) |
diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 2ceacf8..32e10f6 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt | |||
@@ -1 +1,9 @@ | |||
1 | add_subdirectory(commands) | 1 | project(toynadicommon) |
2 | generate_flatbuffers(commands/handshake) | ||
3 | |||
4 | set(command_SRCS | ||
5 | console.cpp | ||
6 | ${CMAKE_CURRENT_BINARY_DIR}/commands/handshake_generated.h) | ||
7 | |||
8 | add_library(${PROJECT_NAME} ${command_SRCS}) | ||
9 | qt5_use_modules(${PROJECT_NAME} Widgets) | ||
diff --git a/common/commands/CMakeLists.txt b/common/commands/CMakeLists.txt deleted file mode 100644 index 2a9ba64..0000000 --- a/common/commands/CMakeLists.txt +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | generate_flatbuffers(${CMAKE_CURRENT_BINARY_DIR} handshake.fbs) | ||
diff --git a/resource/CMakeLists.txt b/resource/CMakeLists.txt index 3de51b5..d74c705 100644 --- a/resource/CMakeLists.txt +++ b/resource/CMakeLists.txt | |||
@@ -2,14 +2,12 @@ project(toynadi_resource) | |||
2 | 2 | ||
3 | include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) | 3 | include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) |
4 | 4 | ||
5 | set(common_path "../common/") | ||
6 | |||
7 | set(toynadiresource_SRCS | 5 | set(toynadiresource_SRCS |
8 | ${common_path}/console.cpp | ||
9 | main.cpp | 6 | main.cpp |
10 | listener.cpp | 7 | listener.cpp |
11 | ) | 8 | ) |
12 | 9 | ||
13 | add_executable(${PROJECT_NAME} ${toynadiresource_SRCS}) | 10 | add_executable(${PROJECT_NAME} ${toynadiresource_SRCS}) |
11 | target_link_libraries(${PROJECT_NAME} toynadicommon) | ||
14 | qt5_use_modules(${PROJECT_NAME} Widgets Network) | 12 | qt5_use_modules(${PROJECT_NAME} Widgets Network) |
15 | install(TARGETS ${PROJECT_NAME} DESTINATION bin) | 13 | install(TARGETS ${PROJECT_NAME} DESTINATION bin) |