diff options
author | Ivo Stoilov (GitHub) <istoilov@luxoft.com> | 2017-01-04 12:07:16 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-04 12:07:16 +0200 |
commit | 15fc6572395056b43cd6fbf23737048772daa350 (patch) | |
tree | a3ad387b922123ff1d63d5ded3eac0c8535a8ccc /src/components/config_profile | |
parent | 4ff12fe67f0ed15700fd030690276712ef23659d (diff) | |
parent | 22b926d4af4e4aab9ae0746d2bfd8625ceadcc9d (diff) | |
download | sdl_core-15fc6572395056b43cd6fbf23737048772daa350.tar.gz |
Merge pull request #1144 from istoilovgithub/fix/cmake_files_refactoring
Refactor CMake files
Diffstat (limited to 'src/components/config_profile')
-rw-r--r-- | src/components/config_profile/CMakeLists.txt | 16 | ||||
-rw-r--r-- | src/components/config_profile/test/CMakeLists.txt | 16 |
2 files changed, 16 insertions, 16 deletions
diff --git a/src/components/config_profile/CMakeLists.txt b/src/components/config_profile/CMakeLists.txt index 107fd58127..2f8561fc2d 100644 --- a/src/components/config_profile/CMakeLists.txt +++ b/src/components/config_profile/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2014, Ford Motor Company +# Copyright (c) 2016, Ford Motor Company # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -28,6 +28,7 @@ # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. +include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake) include_directories ( include @@ -35,13 +36,18 @@ include_directories ( ${LOG4CXX_INCLUDE_DIRECTORY} ) -set (SOURCES - ${COMPONENTS_DIR}/config_profile/src/profile.cc - ${COMPONENTS_DIR}/config_profile/src/ini_file.cc +set(PATHS + ${CMAKE_CURRENT_SOURCE_DIR}/include + ${CMAKE_CURRENT_SOURCE_DIR}/src ) +set(LIBRARIES + Utils +) + +collect_sources(SOURCES "${PATHS}") add_library("ConfigProfile" ${SOURCES}) -target_link_libraries("ConfigProfile" Utils) +target_link_libraries("ConfigProfile" ${LIBRARIES}) if(BUILD_TESTS) add_subdirectory(test) diff --git a/src/components/config_profile/test/CMakeLists.txt b/src/components/config_profile/test/CMakeLists.txt index 1246bff066..597be8fe00 100644 --- a/src/components/config_profile/test/CMakeLists.txt +++ b/src/components/config_profile/test/CMakeLists.txt @@ -28,23 +28,20 @@ # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. -if(BUILD_TESTS) +include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake) include_directories ( ${GMOCK_INCLUDE_DIRECTORY} ${COMPONENTS_DIR}/config_profile/include ) - -set(testSources - profile_test.cc - ini_file_test.cc -) - -set(testLibraries +set(LIBRARIES gmock ConfigProfile ) + +collect_sources(SOURCES "${CMAKE_CURRENT_SOURCE_DIR}") +create_test(config_profile_test "${SOURCES}" "${LIBRARIES}") file(COPY smartDeviceLink.ini DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) file(COPY smartDeviceLink_test.ini DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) @@ -52,6 +49,3 @@ file(COPY smartDeviceLink_invalid_pairs.ini DESTINATION ${CMAKE_CURRENT_BINARY_D file(COPY smartDeviceLink_invalid_string.ini DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) file(COPY smartDeviceLink_invalid_int.ini DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) file(COPY smartDeviceLink_invalid_boolean.ini DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) -create_test("config_profile_test" "${testSources}" "${testLibraries}") - -endif() |