Skip to content

A tiny, neat C library that portably invokes native file open and save dialogs.

License

Notifications You must be signed in to change notification settings

aarcangeli/nativefiledialog-cmake

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

87 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Native File Dialog CMake

In this fork I replaced Premake and other build system with CMake

For more information look at the original README.md

Example

An example of CMakeLists.txt

add_subdirectory(libs/nativefiledialog)
add_executable(mytarget main.cpp)
target_link_libraries(mytarget nativefiledialog)

and main.cpp

#include <nfd.h>
#include <stdio.h>
#include <stdlib.h>

int main( void )
{
    nfdchar_t *outPath = NULL;
    nfdresult_t result = NFD_OpenDialog( NULL, NULL, &outPath );
        
    if ( result == NFD_OKAY ) {
        puts("Success!");
        puts(outPath);
        free(outPath);
    }
    else if ( result == NFD_CANCEL ) {
        puts("User pressed cancel.");
    }
    else {
        printf("Error: %s\n", NFD_GetError() );
    }

    return 0;
}

About

A tiny, neat C library that portably invokes native file open and save dialogs.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 43.7%
  • C 39.0%
  • Objective-C 15.6%
  • CMake 1.7%