Changeset: 0d7085186c91 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0d7085186c91
Modified Files:
        CMakeLists.txt
        cmake/FindLiblas.cmake
        monetdb_config.h.in
Branch: cmake-fun
Log Message:

Trust output of liblas-config for the library location and keep 
monetdb_config.h definitions in alphabetic order.


diffs (55 lines):

diff --git a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -123,7 +123,7 @@ set(WITH_ZLIB "AUTO" CACHE STRING "Inclu
 
 # Instalation directories
 set(PROGRAM_PERMISSIONS_DEFAULT OWNER_WRITE OWNER_READ OWNER_EXECUTE 
GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) # required for some 
instalation files
-if(WIN32)
+if(WIN32) # Variables with _DIR are used for monetdb_config.h file, which need 
proper escape on Windows
        string(REPLACE "/" "\\\\" TRIMMED_INSTALL_PREFIX 
"${CMAKE_INSTALL_PREFIX}") # Fix cmake conversions
        set(BINDIR "${CMAKE_INSTALL_PREFIX}/bin")
        set(BIN_DIR "${TRIMMED_INSTALL_PREFIX}\\\\bin")
diff --git a/cmake/FindLiblas.cmake b/cmake/FindLiblas.cmake
--- a/cmake/FindLiblas.cmake
+++ b/cmake/FindLiblas.cmake
@@ -16,12 +16,12 @@ if(LIBLAS_CONFIG)
        if(NOT LIBLAS_LIBDIR_CODE EQUAL 0)
                unset(LIBLAS_LIBRARIES)
        endif()
+
+       # Call find_package_handle_standard_args only if LIBLAS_CONFIG succeded
+       include(FindPackageHandleStandardArgs)
+       find_package_handle_standard_args(LIBLAS DEFAULT_MSG LIBLAS_INCLUDE_DIR)
 endif()
 
-# Handle the QUIETLY and REQUIRED arguments and set LIBLAS_FOUND to TRUE if 
all listed variables are TRUE.
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(LIBLAS DEFAULT_MSG LIBLAS_LIBRARIES 
LIBLAS_INCLUDE_DIR)
-
 if(LIBLAS_FOUND)
        file(STRINGS "${LIBLAS_INCLUDE_DIR}/liblas/capi/las_version.h" 
LIBLAS_VERSION_LINES REGEX "#define[ \t]+LIBLAS_VERSION_(MAJOR|MINOR|REV)")
        string(REGEX REPLACE ".*LIBLAS_VERSION_MAJOR *\([0-9]*\).*" "\\1" 
LIBLAS_VERSION_MAJOR "${LIBLAS_VERSION_LINES}")
diff --git a/monetdb_config.h.in b/monetdb_config.h.in
--- a/monetdb_config.h.in
+++ b/monetdb_config.h.in
@@ -73,9 +73,6 @@
 #include <ws2tcpip.h>
 #endif /* _MSC_VER */
 
-/* Mercurial repository version */
-#cmakedefine MERCURIAL_ID "@MERCURIAL_ID@"
-
 /* location where binaries are installed */
 #cmakedefine BINDIR "@BIN_DIR@"
 
@@ -394,6 +391,9 @@
 /* modifiable single-machine data */
 #cmakedefine LOCALSTATEDIR "@LOCALSTATE_DIR@"
 
+/* Mercurial repository version */
+#cmakedefine MERCURIAL_ID "@MERCURIAL_ID@"
+
 /* The used password hash algorithm */
 #cmakedefine MONETDB5_PASSWDHASH "@MONETDB5_PASSWDHASH@"
 
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to