-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Improved CMake build system #15 feat: Example about the usage of the library feat: CI now checks the code using cpplint fix: Cleaner documentation
- Loading branch information
1 parent
9a2ef33
commit 49d22a6
Showing
11 changed files
with
326 additions
and
256 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 |
---|---|---|
|
@@ -17,4 +17,5 @@ unit_tests | |
# Build Folders | ||
|
||
cmake-build-* | ||
build | ||
build | ||
Debug |
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,32 @@ | ||
cmake_minimum_required(VERSION 3.14) | ||
|
||
project(dylib_example) | ||
|
||
set(CMAKE_CXX_STANDARD 11) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
|
||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}) | ||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}) | ||
|
||
# dylib fetch | ||
|
||
include(FetchContent) | ||
|
||
FetchContent_Declare( | ||
dylib | ||
GIT_REPOSITORY "https://github.com/martin-olivier/dylib" | ||
GIT_TAG "v1.8.3" | ||
) | ||
|
||
FetchContent_MakeAvailable(dylib) | ||
|
||
# build lib.cpp into a shared library | ||
|
||
add_library(dynamic_lib SHARED lib.cpp) | ||
set_target_properties(dynamic_lib PROPERTIES PREFIX "") | ||
target_link_libraries(dynamic_lib PRIVATE dylib) | ||
|
||
# build main.cpp into an executable | ||
|
||
add_executable(dylib_example main.cpp) | ||
target_link_libraries(dylib_example PRIVATE dylib) |
Oops, something went wrong.