Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need Official CMAKE Script for Prebuilt Libraries #346

Open
3 tasks
DibyaXPP opened this issue Nov 3, 2024 · 9 comments
Open
3 tasks

Need Official CMAKE Script for Prebuilt Libraries #346

DibyaXPP opened this issue Nov 3, 2024 · 9 comments
Labels
cmake Related to CMake build system help wanted Extra attention is needed

Comments

@DibyaXPP
Copy link

DibyaXPP commented Nov 3, 2024

I tried to make my own CMAKE Script for Visual Studio 2022, but i failed to make it build

cmake cmake_minimum_required(VERSION 3.16)
project(aui_app)

# Set path to the pre-downloaded AUI library
set(AUI_DIR "C:/Users/Dibya/Downloads/aui_windows-msvc-x86_64-shared-release(2).tar/aui_windows-msvc-x86_64-shared-release(2)")

# Add AUI to CMake's module path
list(APPEND CMAKE_MODULE_PATH "${AUI_DIR}")
list(APPEND CMAKE_PREFIX_PATH "${AUI_DIR}")

# Include AUI boot file if it exists locally
include("${AUI_DIR}/aui.boot.cmake" OPTIONAL)

# Import AUI manually if not using `aui.boot.cmake`
find_package(aui REQUIRED COMPONENTS core views)

# Create the executable and link AUI components
add_executable(${PROJECT_NAME} src/main.cpp) 

# Link the AUI components to your project
target_link_libraries(${PROJECT_NAME} PRIVATE aui::core aui::views)

With official AUI BOOT Script given in readme.md, i managed to make a simple app so i consider it a success, but a official working method for pre-built binary is needed.
AUI

@Alex2772 Alex2772 added help wanted Extra attention is needed cmake Related to CMake build system labels Nov 4, 2024
@Alex2772
Copy link
Collaborator

Alex2772 commented Nov 4, 2024

Just to make things clear: why don't you consider using *official* way of importing aui?

set(AUI_VERSION master)
# Use AUI.Boot
file(
        DOWNLOAD
        https://raw.githubusercontent.com/aui-framework/aui/${AUI_VERSION}/aui.boot.cmake
        ${CMAKE_CURRENT_BINARY_DIR}/aui.boot.cmake)
include(${CMAKE_CURRENT_BINARY_DIR}/aui.boot.cmake)

# import AUI
auib_import(aui https://github.com/aui-framework/aui
        COMPONENTS core views
        VERSION ${AUI_VERSION})

@Alex2772
Copy link
Collaborator

Alex2772 commented Nov 4, 2024

#133

@DibyaXPP
Copy link
Author

DibyaXPP commented Nov 4, 2024

I cann't get Release build to work, moreover it take time to build AUI on my old i7 3770K [Around 20 Minutes]
Thanks for reply

@Alex2772
Copy link
Collaborator

Alex2772 commented Nov 4, 2024

As a workaround, you may specify -DCMAKE_BUILD_TYPE=Release while configuring AND specify “Release” build type in Visual Studio in the dropdown:

PNG image

or through command line when building:
cmake —build . —config Release

@DibyaXPP
Copy link
Author

DibyaXPP commented Nov 4, 2024

Where to specify -DCMAKE_BUILD_TYPE=Release in Visual Studio 2022?

@Alex2772
Copy link
Collaborator

Alex2772 commented Nov 4, 2024

It's not about Visual Studio, it’s about cmake. I assume you are running cmake from console before opening the project.

@DibyaXPP
Copy link
Author

DibyaXPP commented Nov 4, 2024

Not really i made a Cmake app from Visual studio and copied official CMAKE AUI Boot Script to CMAKEList.txt, made a src directory , ran build all and it worked. [Please see the CMAKELIST which i highlighted], then i ran build all it worked

AUICMAKE

I never used CMAKE outside Visual studio environment, shall i run CMAKE from Visual Studio Native CMD next time?

@Alex2772
Copy link
Collaborator

Alex2772 commented Nov 4, 2024

Oh i see, you are using CMake directly from Visual Studio.

I've just set up the same environment. It looks like it does not use Visual Studio generator. It uses ninja.

Screenshot_20241104_190541

Could you clarify which generator your Visual Studio uses?

@DibyaXPP
Copy link
Author

DibyaXPP commented Nov 5, 2024

I also found -G"ninja" in my log,
[I am attaching the log]
cmakelog.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cmake Related to CMake build system help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants