rewrite cmakelists
This commit is contained in:
parent
a158d87b63
commit
3bb50fa399
|
|
@ -7,9 +7,11 @@ project(player)
|
||||||
project(server)
|
project(server)
|
||||||
project(studio)
|
project(studio)
|
||||||
|
|
||||||
find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets OpenGLWidgets)
|
option(COMPILE_PLAYER "Compile the RBXNU Player" ON)
|
||||||
|
option(COMPILE_SERVER "Compile the RBXNU Server" ON)
|
||||||
|
option(COMPILE_STUDIO "Compile the RBXNU Studio" ON)
|
||||||
|
|
||||||
find_package(Boost REQUIRED)
|
find_package(Boost REQUIRED)
|
||||||
qt_standard_project_setup()
|
|
||||||
|
|
||||||
add_library(engine STATIC
|
add_library(engine STATIC
|
||||||
src/engine/app/gui/Adorn.cpp
|
src/engine/app/gui/Adorn.cpp
|
||||||
|
|
@ -26,29 +28,40 @@ add_library(engine STATIC
|
||||||
src/include/engine/network/Guid.hpp
|
src/include/engine/network/Guid.hpp
|
||||||
)
|
)
|
||||||
|
|
||||||
create_resources(rsc/client ${CMAKE_BINARY_DIR}/client_rsc.h)
|
|
||||||
qt_add_executable(player
|
|
||||||
src/client/player/main.cpp
|
|
||||||
|
|
||||||
${CMAKE_BINARY_DIR}/client_rsc.c
|
|
||||||
)
|
|
||||||
|
|
||||||
create_resources(rsc/server ${CMAKE_BINARY_DIR}/server_rsc.h)
|
|
||||||
add_executable(server
|
|
||||||
src/client/server/main.cpp
|
|
||||||
)
|
|
||||||
|
|
||||||
create_resources(rsc/studio ${CMAKE_BINARY_DIR}/studio_rsc.h)
|
|
||||||
qt_add_executable(studio
|
|
||||||
src/client/studio/StudioWindow.cpp
|
|
||||||
src/include/client/studio/StudioWindow.hpp
|
|
||||||
src/client/studio/main.cpp
|
|
||||||
)
|
|
||||||
|
|
||||||
target_include_directories(engine PUBLIC src/include ${CMAKE_BINARY_DIR})
|
target_include_directories(engine PUBLIC src/include ${CMAKE_BINARY_DIR})
|
||||||
target_link_libraries(engine PUBLIC ${BOOST_LIBRARIES})
|
target_link_libraries(engine PUBLIC ${BOOST_LIBRARIES})
|
||||||
|
|
||||||
set(QT6_LIBRARIES_INCL Qt6::Core Qt6::Gui Qt6::Widgets Qt6::OpenGLWidgets)
|
if(COMPILE_PLAYER)
|
||||||
target_link_libraries(player PRIVATE ${QT6_LIBRARIES_INCL} engine)
|
create_resources(rsc/client ${CMAKE_BINARY_DIR}/player_rsc.h)
|
||||||
target_link_libraries(studio PRIVATE ${QT6_LIBRARIES_INCL} engine)
|
add_executable(player
|
||||||
target_link_libraries(server PRIVATE engine)
|
src/client/player/main.cpp
|
||||||
|
|
||||||
|
${CMAKE_BINARY_DIR}/player_rsc.h
|
||||||
|
)
|
||||||
|
target_link_libraries(player PRIVATE engine)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(COMPILE_SERVER)
|
||||||
|
create_resources(rsc/server ${CMAKE_BINARY_DIR}/server_rsc.h)
|
||||||
|
add_executable(server
|
||||||
|
src/client/server/main.cpp
|
||||||
|
|
||||||
|
${CMAKE_BINARY_DIR}/server_rsc.h
|
||||||
|
)
|
||||||
|
target_link_libraries(server PRIVATE engine)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(COMPILE_STUDIO)
|
||||||
|
find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets OpenGLWidgets)
|
||||||
|
qt_standard_project_setup()
|
||||||
|
set(QT6_LIBRARIES_INCL Qt6::Core Qt6::Gui Qt6::Widgets Qt6::OpenGLWidgets)
|
||||||
|
create_resources(rsc/studio ${CMAKE_BINARY_DIR}/studio_rsc.h)
|
||||||
|
qt_add_executable(studio
|
||||||
|
src/client/studio/StudioWindow.cpp
|
||||||
|
src/include/client/studio/StudioWindow.hpp
|
||||||
|
src/client/studio/main.cpp
|
||||||
|
|
||||||
|
${CMAKE_BINARY_DIR}/studio_rsc.h
|
||||||
|
)
|
||||||
|
target_link_libraries(studio PRIVATE ${QT6_LIBRARIES_INCL} engine)
|
||||||
|
endif()
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,15 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
int main()
|
#include <QApplication>
|
||||||
|
|
||||||
|
#include <client/player/PlayerWindow.hpp>
|
||||||
|
|
||||||
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
printf("Hello world!");
|
QApplication app(argc, argv);
|
||||||
|
PlayerWindow window = PlayerWindow();
|
||||||
|
|
||||||
|
window.show();
|
||||||
|
|
||||||
|
return app.exec();
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue