1 # Copyright (c) 2013, Ford Motor Company
4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions are met:
7 # Redistributions of source code must retain the above copyright notice, this
8 # list of conditions and the following disclaimer.
10 # Redistributions in binary form must reproduce the above copyright notice,
11 # this list of conditions and the following
12 # disclaimer in the documentation and/or other materials provided with the
15 # Neither the name of the Ford Motor Company nor the names of its contributors
16 # may be used to endorse or promote products derived from this software
17 # without specific prior written permission.
19 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23 # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 # POSSIBILITY OF SUCH DAMAGE.
32 set(install_destination bin)
33 set(copy_destination ${CMAKE_BINARY_DIR}/src/appMain)
34 set(library_name ${CMAKE_SHARED_LIBRARY_PREFIX}${target}${CMAKE_SHARED_LIBRARY_SUFFIX})
36 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
38 if (EXTENDED_POLICY_FLAG)
39 add_definitions(-DEXTENDED_POLICY)
42 #Generation of policy table interface...
43 #include(${CMAKE_SOURCE_DIR}/tools/intergen/GenerateInterfaceLibrary.cmake)
47 ./usage_statistics/include
48 ${CMAKE_SOURCE_DIR}/src/components/rpc_base/include
49 ${CMAKE_SOURCE_DIR}/src/thirdPartyLibs/jsoncpp/include
50 #${CMAKE_CURRENT_BINARY_DIR}
51 ${CMAKE_SOURCE_DIR}/src/components/utils/include/
52 ${CMAKE_SOURCE_DIR}/src/components/config_profile/include
56 ./src/policy_manager_impl.cc
57 ./src/policy_helper.cc
59 ./src/sql_pt_queries.cc
60 ./src/sql_pt_representation.cc
63 if (EXTENDED_POLICY_FLAG)
65 ./src/sql_pt_ext_queries.cc
66 ./src/sql_pt_ext_representation.cc
70 add_subdirectory(usage_statistics)
72 if (EXTENDED_POLICY_FLAG)
73 add_subdirectory(policy_table/table_struct_ext)
74 include_directories(./policy_table/table_struct_ext)
76 include_directories(./policy_table/table_struct)
77 add_subdirectory(policy_table/table_struct)
80 set(LIBRARIES ConfigProfile policy_struct dbms jsoncpp Utils)
81 if (CMAKE_SYSTEM_NAME STREQUAL "QNX")
83 include_directories (qdb_wrapper/include)
84 add_subdirectory(qdb_wrapper)
87 include_directories (sqlite_wrapper/include)
88 add_subdirectory(sqlite_wrapper)
89 list(APPEND LIBRARIES sqlite3)
92 add_library(${target} SHARED ${SOURCES})
93 target_link_libraries(${target} ${LIBRARIES} )
96 add_dependencies(${target} liblog4cxx)
97 target_link_libraries(${target} log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
100 add_custom_target(copy_library_${target} ALL
101 COMMAND ${CMAKE_COMMAND} -E copy_if_different
102 ${CMAKE_CURRENT_BINARY_DIR}/${library_name}
105 COMMENT "Copying library ${library_name}")
107 if (BUILD_TESTS_WITH_HMI)
108 add_custom_target(test_copy_library_${target} ALL
109 COMMAND ${CMAKE_COMMAND} -E copy_if_different
110 ${CMAKE_CURRENT_BINARY_DIR}/${library_name}
111 ${CMAKE_BINARY_DIR}/test/
113 COMMENT "Copying library ${library_name}")
114 endif(BUILD_TESTS_WITH_HMI)
116 install(TARGETS ${target}
117 DESTINATION ${install_destination}
118 PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
119 GROUP_READ GROUP_EXECUTE
120 WORLD_READ WORLD_EXECUTE