micmacIGN / micmac

Free open-source photogrammetry software tools
http://micmac.ensg.eu
Other
705 stars 151 forks source link

Precompiled headers and nix #108

Open viric opened 6 years ago

viric commented 6 years ago

The nix packaging system uses a gcc that really needs the "-x c++-header" option; in your precompiled_headers.cmake that option is in a variable but never used.

This fixes the build for me in nix:

 --git a/precompiled_headers.cmake b/precompiled_headers.cmake
index eb3025626..c485a7810 100644
--- a/precompiled_headers.cmake
+++ b/precompiled_headers.cmake
@@ -51,7 +51,7 @@ if(WITH_HEADER_PRECOMP)
                        SET(OPTION_HP "-x c++-header")

                        STRING(TOUPPER "CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}" _flags_var_name)
-                       SET(_compiler_FLAGS ${${_flags_var_name}} ${EXTRA_CXX_FLAGS} ${CMAKE_CXX_FLAGS})
+                      SET(_compiler_FLAGS ${${_flags_var_name}} ${EXTRA_CXX_FLAGS} ${CMAKE_CXX_FLAGS} ${OPTION_HP})

                        GET_DIRECTORY_PROPERTY(_directory_flags INCLUDE_DIRECTORIES)
                        include_dirs_to_flags("${_directory_flags}" directory_includes)