diff --git a/Source/Core/CMakeLists.txt b/Source/Core/CMakeLists.txt index 8c1ad903e9..5cd2ae2239 100644 --- a/Source/Core/CMakeLists.txt +++ b/Source/Core/CMakeLists.txt @@ -3,6 +3,7 @@ add_subdirectory(Common) add_subdirectory(Core) add_subdirectory(DiscIO) add_subdirectory(DolphinWX) +add_subdirectory(DolphinNoGUI) add_subdirectory(InputCommon) add_subdirectory(UICommon) add_subdirectory(VideoCommon) diff --git a/Source/Core/DolphinNoGUI/CMakeLists.txt b/Source/Core/DolphinNoGUI/CMakeLists.txt new file mode 100644 index 0000000000..7680c28dcb --- /dev/null +++ b/Source/Core/DolphinNoGUI/CMakeLists.txt @@ -0,0 +1,27 @@ +if(NOT(USE_X11 OR ENABLE_HEADLESS)) + return() +endif() + +if(APPLE) + set(DOLPHIN_EXE_BASE Dolphin) +else() + set(DOLPHIN_EXE_BASE dolphin-emu) +endif() + +set(DOLPHIN_NOGUI_EXE ${DOLPHIN_EXE_BASE}-nogui) + +set(NOGUI_SRCS MainNoGUI.cpp) + +add_executable(dolphin-nogui ${NOGUI_SRCS}) +set_target_properties(dolphin-nogui PROPERTIES OUTPUT_NAME ${DOLPHIN_NOGUI_EXE}) + +target_link_libraries(dolphin-nogui PRIVATE + core + uicommon + cpp-optparse + ${LIBS} +) + +set(CPACK_PACKAGE_EXECUTABLES ${CPACK_PACKAGE_EXECUTABLES} dolphin-nogui) +install(TARGETS dolphin-nogui RUNTIME DESTINATION ${bindir}) + diff --git a/Source/Core/DolphinWX/MainNoGUI.cpp b/Source/Core/DolphinNoGUI/MainNoGUI.cpp similarity index 100% rename from Source/Core/DolphinWX/MainNoGUI.cpp rename to Source/Core/DolphinNoGUI/MainNoGUI.cpp diff --git a/Source/Core/DolphinWX/CMakeLists.txt b/Source/Core/DolphinWX/CMakeLists.txt index 5b02ad2ce4..4689c2fd2b 100644 --- a/Source/Core/DolphinWX/CMakeLists.txt +++ b/Source/Core/DolphinWX/CMakeLists.txt @@ -79,8 +79,6 @@ set(GUI_SRCS WxUtils.cpp ) -set(NOGUI_SRCS MainNoGUI.cpp) - set(WXLIBS ${wxWidgets_LIBRARIES}) if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") @@ -195,11 +193,3 @@ if(wxWidgets_FOUND) set(CPACK_PACKAGE_EXECUTABLES ${CPACK_PACKAGE_EXECUTABLES} ${DOLPHIN_EXE}) endif() - -if(USE_X11 OR ENABLE_HEADLESS) - set(DOLPHIN_NOGUI_EXE ${DOLPHIN_EXE_BASE}-nogui) - add_executable(${DOLPHIN_NOGUI_EXE} ${SRCS} ${NOGUI_SRCS}) - target_link_libraries(${DOLPHIN_NOGUI_EXE} ${LIBS}) - set(CPACK_PACKAGE_EXECUTABLES ${CPACK_PACKAGE_EXECUTABLES} ${DOLPHIN_NOGUI_EXE}) - install(TARGETS ${DOLPHIN_NOGUI_EXE} RUNTIME DESTINATION ${bindir}) -endif()