Skip to content
Browse files

cmake: Cleaned code (Option tests)

  • Loading branch information...
1 parent 4c43d66 commit 1dc03ea6786f4141d6844114bb710179edcec5d8 @JulienMichot JulienMichot committed
Showing with 35 additions and 36 deletions.
  1. +2 −2 ChangeLog
  2. +16 −17 src/CMake/Documentation.cmake
  3. +2 −2 src/CMake/Installation.cmake
  4. +2 −2 src/CMake/Testing.cmake
  5. +11 −13 src/CMakeLists.txt
  6. +2 −0 src/libmv/multiview/CMakeLists.txt
View
4 ChangeLog
@@ -1,7 +1,7 @@
2011-03-26 [r386-1102] Libmv Team <libmv-devel@googlegroups.com>
- * tag:Tagging the 0.1 release of libmv.
- * third_party: Updated packaging rules for linux/windows and improved outliers
+ * tag:Tagging the 0.1 release of libmv.
+ * third_party: Updated packaging rules for linux/windows and improved outliers
detection during the reconstruction.
* cmake: Updated installation of doc, src, contrib and extras files on linux.
* cmake: Added an initial ChangeLog and updated packaging rules for windows.
View
33 src/CMake/Documentation.cmake
@@ -22,7 +22,7 @@ OPTION(BUILD_DOC "Build the documentation. (Doxygen needed)" OFF)
# check if doxygen is even installed
FIND_PACKAGE(Doxygen)
-IF (NOT DOXYGEN_FOUND STREQUAL "NO" AND BUILD_DOC STREQUAL ON)
+IF (DOXYGEN_FOUND AND BUILD_DOC)
CONFIGURE_FILE(${LIBMV_SOURCE_DIR}/CMake/Doxyfile.cmake
${PROJECT_BINARY_DIR}/Doxyfile
@@ -40,20 +40,19 @@ IF (NOT DOXYGEN_FOUND STREQUAL "NO" AND BUILD_DOC STREQUAL ON)
ADD_CUSTOM_TARGET(doc)
ENDIF()
ADD_DEPENDENCIES(doc doxygen)
+ENDIF(DOXYGEN_FOUND AND BUILD_DOC)
- OPTION(INSTALL_DOCUMENTATION "Install the documentation" OFF)
- IF (INSTALL_DOCUMENTATION STREQUAL ON)
- # install HTML API documentation and manual pages
- SET(DOC_PATH "${LIBMV_SHARE_OUTPUT_DIR}/../doc/libmv-${LIBMV_VERSION}")
- INSTALL(DIRECTORY ${LIBMV_SOURCE_DIR}/../doc/doxygen/html
- DESTINATION ${DOC_PATH}
- COMPONENT documentation)
- # install man pages into packages, scope is now project root..
- #IF (UNIX)
- # INSTALL(DIRECTORY ${LIBMV_SOURCE_DIR}/../doc/man/man3
- # DESTINATION ${LIBMV_SHARE_OUTPUT_DIR}/../man/man3/
- # COMPONENT documentation)
- #ENDIF (UNIX)
- ENDIF (INSTALL_DOCUMENTATION STREQUAL ON)
-
-ENDIF(NOT DOXYGEN_FOUND STREQUAL "NO" AND BUILD_DOC STREQUAL ON)
+OPTION(INSTALL_DOCUMENTATION "Install the documentation" OFF)
+IF (INSTALL_DOCUMENTATION)
+# install HTML API documentation and manual pages
+SET(DOC_PATH "${LIBMV_SHARE_OUTPUT_DIR}/../doc/libmv-${LIBMV_VERSION}")
+INSTALL(DIRECTORY ${LIBMV_SOURCE_DIR}/../doc/doxygen/html
+ DESTINATION ${DOC_PATH}
+ COMPONENT documentation)
+# install man pages into packages, scope is now project root..
+#IF (UNIX)
+# INSTALL(DIRECTORY ${LIBMV_SOURCE_DIR}/../doc/man/man3
+# DESTINATION ${LIBMV_SHARE_OUTPUT_DIR}/../man/man3/
+# COMPONENT documentation)
+#ENDIF (UNIX)
+ENDIF (INSTALL_DOCUMENTATION)
View
4 src/CMake/Installation.cmake
@@ -98,7 +98,7 @@ INSTALL(FILES ../README ../LICENSE ../AUTHORS
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ)
OPTION(INSTALL_SOURCE "Install the source code (C++ files,...)" OFF)
-IF (INSTALL_SOURCE STREQUAL ON)
+IF (INSTALL_SOURCE)
INSTALL(DIRECTORY ../src
DESTINATION ${LIBMV_SHARE_OUTPUT_DIR}
COMPONENT sources
@@ -115,5 +115,5 @@ IF (INSTALL_SOURCE STREQUAL ON)
DESTINATION ${LIBMV_SHARE_OUTPUT_DIR}
COMPONENT sources
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ)
-ENDIF (INSTALL_SOURCE STREQUAL ON)
+ENDIF (INSTALL_SOURCE)
View
4 src/CMake/Testing.cmake
@@ -20,7 +20,7 @@
OPTION(BUILD_TESTS "Build the unit tests." ON)
MACRO (LIBMV_TEST NAME EXTRA_LIBS)
- IF (BUILD_TESTS STREQUAL ON)
+ IF (BUILD_TESTS)
ADD_EXECUTABLE(${NAME}_test ${NAME}_test.cc)
TARGET_LINK_LIBRARIES(${NAME}_test
${EXTRA_LIBS} # Extra libs MUST be first.
@@ -31,5 +31,5 @@ MACRO (LIBMV_TEST NAME EXTRA_LIBS)
pthread)
SET_TARGET_PROPERTIES(${NAME}_test PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${LIBMV_TESTS_OUTPUT_DIR})
ADD_TEST(${NAME}_test ${LIBMV_TESTS_OUTPUT_DIR}/${NAME}_test)
- ENDIF (BUILD_TESTS STREQUAL ON)
+ ENDIF (BUILD_TESTS)
ENDMACRO (LIBMV_TEST)
View
24 src/CMakeLists.txt
@@ -106,7 +106,6 @@ IF (UNIX)
third_party/zlib)
ENDIF (UNIX)
-
INCLUDE(Documentation)
INCLUDE(Installation)
INCLUDE(Testing)
@@ -114,25 +113,24 @@ INCLUDE(Testing)
ADD_SUBDIRECTORY(libmv)
ADD_SUBDIRECTORY(third_party)
-IF (BUILD_TESTS STREQUAL ON)
+IF (BUILD_TESTS)
ADD_SUBDIRECTORY(testing)
-ENDIF (BUILD_TESTS STREQUAL ON)
+ENDIF (BUILD_TESTS)
-IF (QT4_FOUND STREQUAL ON)
+IF (QT4_FOUND)
OPTION(BUILD_GUI "Build the GUI executables." ON)
- IF (BUILD_GUI STREQUAL ON)
+ IF (BUILD_GUI)
MESSAGE(STATUS "Qt4 found: GUI enabled.")
ADD_SUBDIRECTORY(ui)
- ELSE (BUILD_GUI STREQUAL ON)
- MESSAGE(STATUS "Qt4 not found: GUI disabled.")
- MESSAGE(STATUS "If you have installed Qt4, check that qmake.exe is accessible\
- from your PATH.")
- ENDIF (BUILD_GUI STREQUAL ON)
-ENDIF (QT4_FOUND STREQUAL ON)
+ ENDIF (BUILD_GUI)
+ELSE (QT4_FOUND)
+ MESSAGE(STATUS "Qt4 not found: GUI disabled.")
+ MESSAGE(STATUS "If you have installed Qt4, check that qmake.exe is accessible from your PATH.")
+ENDIF (QT4_FOUND)
OPTION(BUILD_TOOLS "Build the command line tools." ON)
-IF (BUILD_TOOLS STREQUAL ON)
+IF (BUILD_TOOLS)
ADD_SUBDIRECTORY(tools)
-ENDIF (BUILD_TOOLS STREQUAL ON)
+ENDIF (BUILD_TOOLS)
INCLUDE(Packaging)
View
2 src/libmv/multiview/CMakeLists.txt
@@ -28,8 +28,10 @@ ADD_LIBRARY(multiview
TARGET_LINK_LIBRARIES(multiview numeric V3D colamd ldl)
LIBMV_INSTALL_LIB(multiview)
+IF (BUILD_TESTS)
ADD_LIBRARY(multiview_test_data
test_data_sets.cc)
+ENDIF (BUILD_TESTS)
MACRO (MULTIVIEW_TEST NAME)
LIBMV_TEST(${NAME} "multiview_test_data;multiview;numeric")

0 comments on commit 1dc03ea

Please sign in to comment.
Something went wrong with that request. Please try again.