Browse Source

Fix build if doxygen is unavailable in system

semlanik 7 years ago
parent
commit
727625a784
1 changed files with 9 additions and 9 deletions
  1. 9 9
      CMakeLists.txt

+ 9 - 9
CMakeLists.txt

@@ -44,6 +44,14 @@ set(PROJECT_TARGETS ${PROJECT_TARGETS} ubxprotoshared)
 
 set(PROJECT_LIBS ubxproto)
 
+install(TARGETS ${PROJECT_TARGETS}
+        EXPORT ${PROJECT_NAME}Targets
+        ARCHIVE DESTINATION "/${INSTALL_LIB_DIR}" COMPONENT staticlib
+        LIBRARY DESTINATION "/${INSTALL_LIB_DIR}" COMPONENT sharedlib
+        PUBLIC_HEADER DESTINATION "/${INSTALL_INCLUDE_DIR}/ubxproto"
+        COMPONENT dev
+        )
+
 find_package(Doxygen)
 if(DOXYGEN_FOUND)
   set(DOXYGEN_INPUT ${CMAKE_SOURCE_DIR})
@@ -51,18 +59,10 @@ if(DOXYGEN_FOUND)
   add_custom_target(doc COMMAND ${DOXYGEN_EXECUTABLE} ubxproto.doxyconf
                     WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
                     COMMENT "Generating doxygen documenation")
+  install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/doc" DESTINATION "/${INSTALL_DATA_DIR}")
 else(DOXYGEN_FOUND)
   message(STATUS "WARNING: Doxygen not found - Reference manual will not be created")
 endif(DOXYGEN_FOUND)
 
-install(TARGETS ${PROJECT_TARGETS}
-        EXPORT ${PROJECT_NAME}Targets
-        ARCHIVE DESTINATION "/${INSTALL_LIB_DIR}" COMPONENT staticlib
-        LIBRARY DESTINATION "/${INSTALL_LIB_DIR}" COMPONENT sharedlib
-        PUBLIC_HEADER DESTINATION "/${INSTALL_INCLUDE_DIR}/ubxproto"
-        COMPONENT dev
-        )
-install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/doc" DESTINATION "/${INSTALL_DATA_DIR}")
-
 #Generate cmake find library addtion
 include(CMakeGen)