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

CMakeLists.txt #1

Open
aybe opened this issue Nov 29, 2022 · 0 comments
Open

CMakeLists.txt #1

aybe opened this issue Nov 29, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@aybe
Copy link
Owner

aybe commented Nov 29, 2022

This works for Windows, other platforms should be addressed:

cmake_minimum_required(VERSION 3.11)

project(imgui.NET.Native VERSION 1.88)

set (CMAKE_CXX_STANDARD 11)

set (CMAKE_CXX_STANDARD_REQUIRED true)

# imgui

add_library(imgui SHARED
    imgui/imgui/imgui.cpp
    imgui/imgui/imgui_draw.cpp
    imgui/imgui/imgui_demo.cpp
    imgui/imgui/imgui_widgets.cpp
    imgui/imgui/imgui_tables.cpp
)

target_compile_definitions(imgui
    PUBLIC
        IMGUI_DISABLE_OBSOLETE_FUNCTIONS
        IMGUI_DISABLE_OBSOLETE_KEYIO
)

if (WIN32)
    target_compile_definitions(imgui
        PUBLIC
            IMGUI_API=__declspec\(dllexport\)
    )
else()
    message(FATAL_ERROR "Not implemented")
endif()

# implot

add_library(implot SHARED
    implot/implot/implot.cpp
    implot/implot/implot_demo.cpp
    implot/implot/implot_items.cpp
)

target_include_directories(implot PUBLIC imgui/imgui)

target_compile_definitions(implot
    PUBLIC
        IMPLOT_DISABLE_OBSOLETE_FUNCTIONS
)

target_link_libraries(implot PUBLIC imgui)

if (WIN32)
    target_compile_definitions(implot
        PRIVATE
            IMGUI_API=__declspec\(dllimport\)
            IMPLOT_API=__declspec\(dllexport\)
    )
else()
    message(FATAL_ERROR "Not implemented")
endif()
@aybe aybe self-assigned this Jan 8, 2023
@aybe aybe added the enhancement New feature or request label Jan 10, 2023
@aybe aybe mentioned this issue Feb 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant