-
Notifications
You must be signed in to change notification settings - Fork 12
CMake improvements #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,8 @@ | ||
| cmake_minimum_required(VERSION 3.0.2) | ||
| if(CMAKE_MAJOR_VERSION LESS 3) | ||
| cmake_minimum_required(VERSION 2.6) | ||
| else() | ||
| cmake_minimum_required(VERSION 2.8.12) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the reason to support a cmake version from 10 years ago? 👀
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's still used on one of the systems on which I'm testing roc (some old raspberry pi). While there's no big maintaining burden, I prefer to keep compatibility with older systems, because often people are too lazy to update them, like me :) |
||
| endif() | ||
|
|
||
| ##project | ||
| project(openfec C) | ||
|
|
@@ -39,13 +43,17 @@ message(STATUS "Optimization level ${OPTIMIZE}") | |
|
|
||
| endif (DEBUG STREQUAL "ON") | ||
|
|
||
| set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin/${CMAKE_BUILD_TYPE}) | ||
| set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin/${CMAKE_BUILD_TYPE}) | ||
| set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin/${CMAKE_BUILD_TYPE} | ||
| CACHE STRING "output path for libraries") | ||
| set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin/${CMAKE_BUILD_TYPE} | ||
| CACHE STRING "output path for executables") | ||
| MARK_AS_ADVANCED( | ||
| LIBRARY_OUTPUT_PATH | ||
| EXECUTABLE_OUTPUT_PATH | ||
| ) | ||
|
|
||
| option(INSTALL_DEVTOOLS "install developer tools to the system" OFF) | ||
|
|
||
| link_directories(${LIBRARY_OUTPUT_PATH}) | ||
|
|
||
| add_subdirectory(pc) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,13 @@ | ||
| file (GLOB eperftool_sources ./*) | ||
|
|
||
| set(EPERFTOOL_BIN ${PROJECT_BINARY_DIR}/applis/eperftool/eperftool CACHE STRING "eperftool dir") | ||
| set(EPERFTOOL_BIN ${EXECUTABLE_OUTPUT_PATH}/eperftool CACHE STRING "eperftool exe") | ||
| add_executable( eperftool ${eperftool_sources}) | ||
|
|
||
|
|
||
| target_link_libraries( eperftool openfec m) | ||
|
|
||
| install(TARGETS eperftool) | ||
| if(INSTALL_DEVTOOLS) | ||
| install(TARGETS eperftool | ||
| RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} | ||
| COMPONENT devtools) | ||
| endif() |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,20 @@ | ||
| file (GLOB simple_server_sources ./simple_server.c) | ||
|
|
||
| set(SIMPLE_SERVER_BIN ${PROJECT_SOURCE_DIR}/bin/${CMAKE_BUILD_TYPE}/simple_server CACHE STRING "simple_server dir") | ||
| set(SIMPLE_SERVER_BIN ${EXECUTABLE_OUTPUT_PATH}/simple_server CACHE STRING "simple_server exe") | ||
| add_executable(simple_server ${simple_server_sources}) | ||
|
|
||
| target_link_libraries(simple_server openfec m) | ||
|
|
||
|
|
||
| file (GLOB simple_client_sources ./simple_client.c) | ||
|
|
||
| set(SIMPLE_SERVER_BIN ${PROJECT_SOURCE_DIR}/bin/${CMAKE_BUILD_TYPE}/simple_client CACHE STRING "simple_client dir") | ||
| set(SIMPLE_SERVER_BIN ${EXECUTABLE_OUTPUT_PATH}/simple_client CACHE STRING "simple_client exe") | ||
| add_executable(simple_client ${simple_client_sources}) | ||
|
|
||
| target_link_libraries(simple_client openfec m) | ||
|
|
||
| install(TARGETS simple_server simple_client) | ||
| if(INSTALL_DEVTOOLS) | ||
| install(TARGETS simple_server simple_client | ||
| RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} | ||
| COMPONENT applis) | ||
| endif() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can do
make -C buildand drop thecd.Alternatively:
ctest --test-dir build --output-on-failureThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it's used to make it similar with other steps.