bloom
Topic Author
Posts: 1
Joined: 14 Jan 2023, 15:09

Basic cmake file for application framework

18 Jan 2023, 21:07

Hey! I am working with CLion, thus using cmake to build my project. However I can't seem to get a basic application framework app up and running.

I am getting a bunch of undefined reference errors, like these:
undefined reference to `NoesisApp::Launcher::SetArguments(int, char**)'
C:\Program Files\JetBrains\CLion 2022.3.1\bin\mingw\bin/ld.exe: /main.cpp:12: undefined reference to `NoesisApp::ApplicationLauncher::SetApplicationFile(char const*)'
C:\Program Files\JetBrains\CLion 2022.3.1\bin\mingw\bin/ld.exe: /main.cpp:14: undefined reference to `NoesisApp::DisplayLauncher::Run()'
My cmake looks like this:
cmake_minimum_required(VERSION 3.24)
project(editor)

set(CMAKE_CXX_STANDARD 20)

set(NOESIS_INCLUDE_DIRS
    ${CMAKE_SOURCE_DIR}/game/deps/NoesisGUI/Include
    ${CMAKE_SOURCE_DIR}/game/deps/NoesisGUI/Src/Packages/App/AndroidDisplay/Include
    ${CMAKE_SOURCE_DIR}/game/deps/NoesisGUI/Src/Packages/App/ApplicationLauncher/Include
    ${CMAKE_SOURCE_DIR}/game/deps/NoesisGUI/Src/Packages/App/Display/Include
    ${CMAKE_SOURCE_DIR}/game/deps/NoesisGUI/Src/Packages/App/DisplayLauncher/Include
    ${CMAKE_SOURCE_DIR}/game/deps/NoesisGUI/Src/Packages/App/EmscriptenDisplay/Include
    ${CMAKE_SOURCE_DIR}/game/deps/NoesisGUI/Src/Packages/App/Interactivity/Include
    ${CMAKE_SOURCE_DIR}/game/deps/NoesisGUI/Src/Packages/App/Launcher/Include
    ${CMAKE_SOURCE_DIR}/game/deps/NoesisGUI/Src/Packages/App/MediaElement/Include
    ${CMAKE_SOURCE_DIR}/game/deps/NoesisGUI/Src/Packages/App/Providers/Include
    ${CMAKE_SOURCE_DIR}/game/deps/NoesisGUI/Src/Packages/App/Shaders/Include
    ${CMAKE_SOURCE_DIR}/game/deps/NoesisGUI/Src/Packages/App/Theme/Include
    ${CMAKE_SOURCE_DIR}/game/deps/NoesisGUI/Src/Packages/App/UWPDisplay/Include
    ${CMAKE_SOURCE_DIR}/game/deps/NoesisGUI/Src/Packages/App/Win32Display/Include)

set (NOESIS_LIBRARIES
    ${CMAKE_SOURCE_DIR}/game/libs/Noesis.lib
    ${CMAKE_SOURCE_DIR}/game/libs/NoesisApp.lib
)

include_directories(
    ${CMAKE_SOURCE_DIR}/game
)

add_compile_options(-MMD -Wall -Wextra -pedantic -Werror)

set(EXECUTABLE_OUTPUT_PATH bin/${CMAKE_BUILD_TYPE})
add_executable(${PROJECT_NAME} main.cpp EditorLauncher.cpp EditorLauncher.h EditorApp.cpp EditorApp.h EditorMainWindow.cpp EditorMainWindow.h)

target_include_directories(${PROJECT_NAME} SYSTEM PRIVATE ${NOESIS_INCLUDE_DIRS})
target_link_libraries(${PROJECT_NAME} ${CMAKE_SOURCE_DIR}/game/libs/vulkan-1.lib ${NOESIS_LIBRARIES})

add_custom_command(
        TARGET ${PROJECT_NAME} POST_BUILD
        COMMAND ${CMAKE_COMMAND} -E copy_if_different
        "${CMAKE_SOURCE_DIR}game/deps/NoesisGUI/Bin/windows_x86_64"
        $<TARGET_FILE_DIR:${PROJECT_NAME}>
)
Anyone got a basic cmake file working? Or notice anything wrong in mine?
 
User avatar
jsantos
Site Admin
Posts: 3918
Joined: 20 Jan 2012, 17:18
Contact:

Re: Basic cmake file for application framework

19 Jan 2023, 14:09

We include makefiles (for Android, Linux and Wasm) in our SDKs, I think you can use that as a starting point to create you cmake project.

Who is online

Users browsing this forum: Ahrefs [Bot] and 22 guests