-
Notifications
You must be signed in to change notification settings - Fork 258
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build library and examples using CMake on macos
- Loading branch information
Showing
5 changed files
with
164 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
cmake_minimum_required(VERSION 3.15) | ||
|
||
project(imnodes) | ||
|
||
set(CMAKE_CXX_STANDARD 11) | ||
set(CMAKE_CXX_STANDARD_REQUIRED True) | ||
|
||
find_package(imgui CONFIG REQUIRED) | ||
find_package(SDL2 CONFIG REQUIRED) | ||
|
||
|
||
# Imnodes | ||
|
||
add_library(imnodes) | ||
target_sources(imnodes PRIVATE | ||
imnodes.h | ||
imnodes_internal.h | ||
imnodes.cpp) | ||
target_include_directories(imnodes PUBLIC ${CMAKE_SOURCE_DIR}) | ||
target_link_libraries(imnodes PUBLIC imgui::imgui) | ||
|
||
|
||
# Example projects | ||
|
||
add_executable(colornode | ||
${CMAKE_SOURCE_DIR}/imnodes.cpp | ||
${CMAKE_SOURCE_DIR}/example/main.cpp | ||
${CMAKE_SOURCE_DIR}/example/color_node_editor.cpp) | ||
target_link_libraries(colornode imnodes SDL2::SDL2) | ||
if (APPLE) | ||
target_link_libraries(colornode "-framework OpenGL") | ||
endif() | ||
|
||
add_executable(multieditor | ||
${CMAKE_SOURCE_DIR}/imnodes.cpp | ||
${CMAKE_SOURCE_DIR}/example/main.cpp | ||
${CMAKE_SOURCE_DIR}/example/multi_editor.cpp) | ||
target_link_libraries(multieditor imnodes SDL2::SDL2) | ||
if (APPLE) | ||
target_link_libraries(multieditor "-framework OpenGL") | ||
endif() | ||
|
||
add_executable(saveload | ||
${CMAKE_SOURCE_DIR}/imnodes.cpp | ||
${CMAKE_SOURCE_DIR}/example/main.cpp | ||
${CMAKE_SOURCE_DIR}/example/save_load.cpp) | ||
target_link_libraries(saveload imnodes SDL2::SDL2) | ||
if (APPLE) | ||
target_link_libraries(saveload "-framework OpenGL") | ||
endif() | ||
|
||
add_executable(hello | ||
${CMAKE_SOURCE_DIR}/imnodes.cpp | ||
${CMAKE_SOURCE_DIR}/example/main.cpp | ||
${CMAKE_SOURCE_DIR}/example/hello.cpp) | ||
target_link_libraries(hello imnodes SDL2::SDL2) | ||
if (APPLE) | ||
target_link_libraries(hello "-framework OpenGL") | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"name": "imnodes", | ||
"version-string": "0.1.0-dev", | ||
"dependencies": [ | ||
"sdl2", | ||
{ | ||
"name": "imgui", | ||
"features": [ "sdl2-binding", "opengl3-binding" ] | ||
} | ||
] | ||
} |