-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* overhaul of build system (#54) * overhaul of build system every folder has CMakeLists.txt for modularity examples/ excluded from default make one config.h for all targets fix olaclient.c #include <ola/OlaClientWrapper.h> * update build sequence exclude PCA9685test from default make * merging master changes back into develop * removed warning about BSD_SOURCES * update to master branch netinst scripts * examples/CMakeLists.txt: target "examples" examples code comments for required pkgs * apt-get pkgs required by examples, make examples
- Loading branch information
Showing
17 changed files
with
60 additions
and
81 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 |
---|---|---|
@@ -1,55 +1,30 @@ | ||
cmake_minimum_required(VERSION 3.0) | ||
project(PCA9685) | ||
project(libPCA9685) | ||
|
||
# set the lib version | ||
set (libPCA9685_VERSION_MAJOR 0) | ||
set (libPCA9685_VERSION_MINOR 7) | ||
set(libPCA9685_VERSION_MAJOR 0) | ||
set(libPCA9685_VERSION_MINOR 7) | ||
|
||
# save the lib version in config.h | ||
configure_file(config.h.cmake ${PROJECT_BINARY_DIR}/config.h) | ||
|
||
# include for config.h | ||
include_directories(${PROJECT_BINARY_DIR}) | ||
|
||
# add flags | ||
set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -D_BSD_SOURCE -std=c11 -Wall -pedantic -Wextra") | ||
set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -D_BSD_SOURCE -D_DEFAULT_SOURCE -std=c11 -Wall -pedantic -Wextra") | ||
|
||
# build the library | ||
add_subdirectory(src) | ||
|
||
# build the test app | ||
add_subdirectory(test EXCLUDE_FROM_ALL) | ||
|
||
# build the examples, but not by default | ||
add_subdirectory(examples EXCLUDE_FROM_ALL) | ||
|
||
# add tests | ||
enable_testing() | ||
add_test(run_test sh -xc "./PCA9685test -td 1 40 > PCA9685_actual_output" 2>&1) | ||
add_test(run_test sh -xc "./test/PCA9685test -td 1 40 > PCA9685_actual_output" 2>&1) | ||
add_test(diff_output sh -xc "diff ../test/PCA9685_expected_output ./PCA9685_actual_output" 2>&1) | ||
|
||
|
||
# build the library | ||
add_subdirectory (src) | ||
include_directories ("${PROJECT_SOURCE_DIR}/src") | ||
|
||
|
||
# build the quickstart example | ||
configure_file ( | ||
"${PROJECT_SOURCE_DIR}/examples/quickstart/quickstartConfig.h.in" | ||
"${PROJECT_BINARY_DIR}/examples/quickstart/quickstartConfig.h" | ||
) | ||
include_directories("${PROJECT_BINARY_DIR}/examples/quickstart") | ||
add_executable (quickstart examples/quickstart/quickstart.c) | ||
target_link_libraries (quickstart PCA9685) | ||
|
||
|
||
# build the PCA9685demo example | ||
configure_file ( | ||
"${PROJECT_SOURCE_DIR}/examples/PCA9685demo/PCA9685demoConfig.h.in" | ||
"${PROJECT_BINARY_DIR}/examples/PCA9685demo/PCA9685demoConfig.h" | ||
) | ||
include_directories("${PROJECT_BINARY_DIR}/examples/PCA9685demo") | ||
add_executable (PCA9685demo examples/PCA9685demo/PCA9685demo.c) | ||
target_link_libraries (PCA9685demo PCA9685) | ||
target_link_libraries (PCA9685demo ncurses) | ||
|
||
|
||
# build the PCA9685test app | ||
configure_file ( | ||
"${PROJECT_SOURCE_DIR}/test/PCA9685testConfig.h.in" | ||
"${PROJECT_BINARY_DIR}/test/PCA9685testConfig.h" | ||
) | ||
include_directories("${PROJECT_BINARY_DIR}/test") | ||
add_executable (PCA9685test test/PCA9685test.c) | ||
target_link_libraries (PCA9685test PCA9685) | ||
|
||
|
||
# build the olaclient app | ||
add_subdirectory(examples/olaclient) | ||
include_directories("${PROJECT_BINARY_DIR}/examples/olaclient") |
File renamed without changes.
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,8 @@ | ||
project (examples) | ||
# build the examples | ||
add_subdirectory (olaclient) | ||
add_subdirectory (PCA9685demo) | ||
add_subdirectory (quickstart) | ||
|
||
add_custom_target(examples) | ||
add_dependencies(examples olaclient PCA9685demo quickstart) |
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,4 @@ | ||
project (PCA9685demo) | ||
add_executable(PCA9685demo PCA9685demo.c) | ||
target_link_libraries(PCA9685demo PCA9685) | ||
target_link_libraries(PCA9685demo ncurses) |
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
This file was deleted.
Oops, something went wrong.
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,3 @@ | ||
project (quickstart) | ||
add_executable(quickstart quickstart.c) | ||
target_link_libraries(quickstart PCA9685) |
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,14 +1,9 @@ | ||
cmake_minimum_required(VERSION 3.0) | ||
project (libPCA9685) | ||
project(libPCA9685) | ||
|
||
set (libPCA9685_VERSION_MAJOR 0) | ||
set (libPCA9685_VERSION_MINOR 7) | ||
configure_file ( | ||
"${PROJECT_SOURCE_DIR}/libPCA9685Config.h.in" | ||
"${PROJECT_BINARY_DIR}/libPCA9685Config.h" | ||
) | ||
include_directories ("${PROJECT_BINARY_DIR}") | ||
# build the lib | ||
add_library(PCA9685 SHARED PCA9685.c) | ||
|
||
install (TARGETS PCA9685 DESTINATION lib) | ||
install (FILES PCA9685.h DESTINATION include) | ||
# install the lib | ||
install(TARGETS PCA9685 DESTINATION lib) | ||
install(FILES PCA9685.h DESTINATION include) |
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 was deleted.
Oops, something went wrong.
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,8 @@ | ||
cmake_minimum_required(VERSION 3.0) | ||
project(PCA9685test) | ||
|
||
# build the test app | ||
add_executable(PCA9685test PCA9685test.c) | ||
|
||
# link with the lib | ||
target_link_libraries(PCA9685test PCA9685) |
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