]> granicus.if.org Git - icinga2/blob - tools/CMakeLists.txt
Fix project type for the Icinga2SetupAgent project.
[icinga2] / tools / CMakeLists.txt
1 # Icinga 2
2 # Copyright (C) 2012-2014 Icinga Development Team (http://www.icinga.org)
3 #
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software Foundation
16 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
17
18 add_subdirectory(mkclass)
19 add_subdirectory(mkembedconfig)
20
21 if(UNIX OR CYGWIN)
22   configure_file(icinga2-enable-feature.cmake ${CMAKE_CURRENT_BINARY_DIR}/icinga2-enable-feature @ONLY)
23   configure_file(icinga2-discover-agent.cmake ${CMAKE_CURRENT_BINARY_DIR}/icinga2-discover-agent @ONLY)
24   configure_file(icinga2-forget-agent.cmake ${CMAKE_CURRENT_BINARY_DIR}/icinga2-forget-agent @ONLY)
25   configure_file(icinga2-list-agents.cmake ${CMAKE_CURRENT_BINARY_DIR}/icinga2-list-agents @ONLY)
26
27   install(
28     FILES ${CMAKE_CURRENT_BINARY_DIR}/icinga2-enable-feature ${CMAKE_CURRENT_BINARY_DIR}/icinga2-discover-agent
29           ${CMAKE_CURRENT_BINARY_DIR}/icinga2-forget-agent ${CMAKE_CURRENT_BINARY_DIR}/icinga2-list-agents
30     DESTINATION ${CMAKE_INSTALL_SBINDIR}
31     PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
32   )
33
34   install(CODE "execute_process(COMMAND \"${CMAKE_COMMAND}\" -E create_symlink ./icinga2-enable-feature \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_SBINDIR}/icinga2-disable-feature\")")
35
36   install(
37     FILES ${CMAKE_CURRENT_SOURCE_DIR}/migration/icinga2-migrate-config
38     DESTINATION ${CMAKE_INSTALL_BINDIR}
39     PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
40   )
41 endif()
42
43 if(MSVC)
44   include_external_msproject(
45     icinga2setupagent
46     ${CMAKE_CURRENT_SOURCE_DIR}/icinga2-setup-agent/Icinga2SetupAgent.csproj
47     TYPE FAE04EC0-301F-11D3-BF4B-00C04F79EFBC
48   )
49
50   install(
51     FILES ${CMAKE_CURRENT_SOURCE_DIR}/icinga2-setup-agent/bin/${CMAKE_BUILD_TYPE}/Icinga2SetupAgent.exe
52     DESTINATION ${CMAKE_INSTALL_SBINDIR}
53   )
54 endif()