-
-
Save jiverson002/811ab74579a43076e4058a90957339cb to your computer and use it in GitHub Desktop.
An example project using GKlib via the CMake FetchContent module.
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
# Prerequisites | |
*.d | |
# Compiled Object files | |
*.slo | |
*.lo | |
*.o | |
*.obj | |
# Precompiled Headers | |
*.gch | |
*.pch | |
# Compiled Dynamic libraries | |
*.so | |
*.dylib | |
*.dll | |
# Fortran module files | |
*.mod | |
*.smod | |
# Compiled Static libraries | |
*.lai | |
*.la | |
*.a | |
*.lib | |
# Executables | |
*.exe | |
*.out | |
*.app | |
# Build files | |
build |
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
cmake_minimum_required(VERSION 3.14) | |
project(GKlib-FetchContent C) | |
include(FetchContent) | |
FetchContent_Declare( | |
GKlib | |
GIT_REPOSITORY https://github.com/jiverson002/GKlib.git | |
GIT_TAG feature/modern-cmake-pr | |
) | |
FetchContent_MakeAvailable(GKlib) | |
# FetchContent_MakeAvailable() was introduced in CMake 3.14, if prior versions | |
# should be supported, then the following should be used instead: | |
# | |
# FetchContent_GetProperties(GKlib) | |
# if(NOT GKlib_POPULATED) | |
# FetchContent_Populate(GKlib) | |
# add_subdirectory(${GKlib_SOURCE_DIR} ${GKlib_BINARY_DIR}) | |
# endif() | |
add_executable(example example.c) | |
target_link_libraries(example GKlib::GKlib) |
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
#include "GKlib.h" | |
int main() { } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment