1 # Copyright (c) 2015, Intel Corporation 2 # All rights reserved. 3 # 4 # Redistribution and use in source and binary forms, with or without modification, 5 # are permitted provided that the following conditions are met: 6 # 7 # 1. Redistributions of source code must retain the above copyright notice, this 8 # list of conditions and the following disclaimer. 9 # 10 # 2. Redistributions in binary form must reproduce the above copyright notice, 11 # this list of conditions and the following disclaimer in the documentation and/or 12 # other materials provided with the distribution. 13 # 14 # 3. Neither the name of the copyright holder nor the names of its contributors 15 # may be used to endorse or promote products derived from this software without 16 # specific prior written permission. 17 # 18 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR 22 # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 25 # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 29 # Known to work with CMake 3.2.2, might work with older 3.x versions, will not 30 # work with versions prior to 3.0.0. 31 32 cmake_minimum_required(VERSION 3.2.2) 33 34 project(parameter-framework-plugins-skeleton) 35 36 find_package(ParameterFramework REQUIRED) 37 38 set(CMAKE_CXX_STANDARD 11) 39 set(CMAKE_CXX_EXTENSIONS NO) 40 set(CMAKE_CXX_STANDARD_REQUIRED YES) 41 42 if(WIN32) 43 # Force include iso646.h to support alternative operator form (and, or, not...) 44 # Such support is require by the standard and can be enabled with /Za 45 # but doing so breaks compilation of windows headers... 46 set_property(DIRECTORY PROPERTY COMPILE_OPTIONS /W4 /FIiso646.h) 47 else() 48 set_property(DIRECTORY PROPERTY COMPILE_OPTIONS -Werror -Wall -Wextra -Wconversion) 49 endif() 50 51 # Hide symbols by default, then exposed symbols are the same in linux and windows 52 set(CMAKE_CXX_VISIBILITY_PRESET hidden) 53 set(CMAKE_VISIBILITY_INLINES_HIDDEN true) 54 55 # Force libs and executable to all be at a known place - simplifies a lot of 56 # things, especially setting the test environment 57 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin) 58 set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib) 59 60 add_library(skeleton-subsystem MODULE 61 SkeletonSubsystemBuilder.cpp 62 SkeletonSubsystem.cpp 63 SkeletonSubsystemObject.cpp) 64 65 target_link_libraries(skeleton-subsystem PRIVATE ParameterFramework::plugin) 66 67 install(TARGETS skeleton-subsystem 68 LIBRARY DESTINATION lib 69 RUNTIME DESTINATION bin) 70 71 include(../ctest/CMakeLists.txt) 72 add_subdirectory(test) 73