diff --git a/CMakeLists.txt b/CMakeLists.txt index 3e5c199..e769820 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,6 +4,7 @@ project(lambdacommon) list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) include(GenerateExportHeader) include(utils/CompileUtility) +include(utils/InstallUtility) set(CMAKE_CXX_STANDARD 14) @@ -19,7 +20,7 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -framework CoreFoundation -framework ApplicationServices") endif() -# All files +# All files: # There is the C++ header files. set(HEADERS_CONNECTION include/lambdacommon/connection/address.h) set(HEADERS_DOCUMENT include/lambdacommon/documents/document.h) @@ -67,6 +68,7 @@ if (LAMBDACOMMON_INSTALL) install(FILES ${LOOP_HEADER} DESTINATION ${HEADER_PARENT_DIR}) endforeach () install(FILES ${CMAKE_BINARY_DIR}/exports/lambdacommon_exports.h DESTINATION include/lambdacommon) + install(FILES ${CMAKE_SOURCE_DIR}/LICENSE DESTINATION share/licenses/lambdacommon) install(TARGETS lambdacommon RUNTIME DESTINATION bin COMPONENT libraries LIBRARY DESTINATION lib COMPONENT libraries @@ -78,15 +80,8 @@ if (LAMBDACOMMON_INSTALL) ARCHIVE DESTINATION lib COMPONENT libraries) endif () - # Uninstall target - if(NOT TARGET uninstall) - configure_file( - "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in" - "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" - IMMEDIATE @ONLY) - - add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake) - endif() + # Uninstall target. + setup_uninstall_target() endif () # Build the tests if the option is on. diff --git a/build.sh b/build.sh index 7f82b62..b8eb517 100644 --- a/build.sh +++ b/build.sh @@ -1,10 +1,10 @@ #!/bin/sh -# Some color variables +# Some color variables. RED='\033[0;91m' NC='\033[0m' -sh ./cleaningWorkspace.sh +sh ./clean_workspace.sh echo "cd to build directory" @@ -15,13 +15,13 @@ cmake .. if [ $? -ne 0 ]; then echo "${RED}Error: CMake doesn't exit with success! Cleaning...${NC}" cd .. -sh ./cleaningWorkspace.sh +sh ./clean_workspace.sh else make if [ $? -ne 0 ]; then -echo "${RED}Error: Make doesn't compile with success! Cleaning...${NC}" +echo "${RED}Error: Make doesn't exit with success! Cleaning...${NC}" cd .. -sh ./cleaningWorkspace.sh +sh ./clean_workspace.sh fi fi diff --git a/cleaningWorkspace.sh b/clean_workspace.sh similarity index 91% rename from cleaningWorkspace.sh rename to clean_workspace.sh index 83b08b7..a3a0251 100644 --- a/cleaningWorkspace.sh +++ b/clean_workspace.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/sh echo "Checking build directories..." diff --git a/cmake b/cmake index adcaf00..a3f64b2 160000 --- a/cmake +++ b/cmake @@ -1 +1 @@ -Subproject commit adcaf00b6d313a3f2a5a2b21faec38fb3f535335 +Subproject commit a3f64b2ccf8cc40356993a609a8f83ab29e926ba diff --git a/cmake_uninstall.cmake.in b/cmake_uninstall.cmake.in deleted file mode 100644 index fb56b76..0000000 --- a/cmake_uninstall.cmake.in +++ /dev/null @@ -1,21 +0,0 @@ -if (NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt") - message(FATAL_ERROR "Cannot find install manifest: @CMAKE_BINARY_DIR@/install_manifest.txt") -endif (NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt") - -file(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files) -string(REGEX REPLACE "\n" ";" files "${files}") -foreach (file ${files}) - message(STATUS "Uninstalling $ENV{DESTDIR}${file}") - if (IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") - exec_program( - "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" - OUTPUT_VARIABLE rm_out - RETURN_VALUE rm_retval - ) - if (NOT "${rm_retval}" STREQUAL 0) - message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}") - endif (NOT "${rm_retval}" STREQUAL 0) - else (IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") - message(STATUS "File $ENV{DESTDIR}${file} does not exist.") - endif (IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") -endforeach (file) diff --git a/include/lambdacommon/lambdacommon.h b/include/lambdacommon/lambdacommon.h index 7d9a558..7568bfe 100644 --- a/include/lambdacommon/lambdacommon.h +++ b/include/lambdacommon/lambdacommon.h @@ -42,7 +42,7 @@ #define LAMBDACOMMON_VERSION_MAJOR 1 #define LAMBDACOMMON_VERSION_MINOR 9 -#define LAMBDACOMMON_VERSION_PATCH 1 +#define LAMBDACOMMON_VERSION_PATCH 2 // Deletes the pointer and sets the variable to null. It's just simpler to write like this. #define LCOMMON_DELETE_POINTER(pointer) delete pointer; pointer = nullptr; diff --git a/src/graphics/color.cpp b/src/graphics/color.cpp index a2d75a3..d939909 100644 --- a/src/graphics/color.cpp +++ b/src/graphics/color.cpp @@ -12,6 +12,7 @@ #include "../../include/lambdacommon/maths.h" #include #include +#include namespace lambdacommon { diff --git a/src/system/system.cpp b/src/system/system.cpp index 41bd36d..1ac9f6f 100644 --- a/src/system/system.cpp +++ b/src/system/system.cpp @@ -580,7 +580,7 @@ namespace lambdacommon void LAMBDACOMMON_API sleep(utime_t time) { #ifdef LAMBDA_WINDOWS - Sleep(time); + Sleep(static_cast(time)); #else auto goal = time / 1000 * CLOCKS_PER_SEC + clock(); while (goal > clock()); diff --git a/test.sh b/test.sh index f2a3ca7..34c0a26 100644 --- a/test.sh +++ b/test.sh @@ -1,6 +1,6 @@ -#!/usr/bin/env bash +#!/bin/sh -# Some color variables +# Some color variables. RED='\033[0;91m' NC='\033[0m'