Hi WIN32 builders,

For those who want to build and INSTALL the 
FG exes, fgfs, fgjs, metar, etc... the attached patch 
is very necessary to separate the Debug and Release 
builds...

If you are NOT using the 'INSTALL' then these 
are already separated by MSVC into the INTDIRS,
Release and Debug... so no problem there...

But at present, the last 'install' will overwrite 
the previous EXES... leaving you wondering which 
configuration you are running ;=((

The CMakeLists.txt already does -
set(CMAKE_DEBUG_POSTFIX "d" ...)
and this works fine for library builds.

But for each EXE it is necessary to specifically 
do a set properties to add 'd' to the Debug build,
like -

set_target_properties(targ PROPERTIES DEBUG_POSTFIX d)

And that is what the attached patch does ;=)).

I personally would like to see this patched added 
to the git source, but it is ONLY for WIN32 
building, so maybe each needs to also be put in

if (WIN32)
  set_target_properties(...
endif (WIN32)

Unix deal with debug slightly differently - just 
whether the binary contains symbols or not, the -g 
compile option - and does not seem disturbed by 
this particular 'set_target_properties(...)'...

But in windows different system runtime libraries 
are used and you can get warnings, even link errors 
in mixing these two...

Regards,
Geoff.

attached: cmake-WIN32.patch - this was against 
git next of just a few days ago...


diff --git a/src/FDM/YASim/CMakeLists.txt b/src/FDM/YASim/CMakeLists.txt
index 352a78b..ba7152e 100644
--- a/src/FDM/YASim/CMakeLists.txt
+++ b/src/FDM/YASim/CMakeLists.txt
@@ -47,7 +47,10 @@ target_link_libraries(yasim
 target_link_libraries(yasim-proptest
 		${SIMGEAR_CORE_LIBRARIES}
 		${SIMGEAR_CORE_LIBRARY_DEPENDENCIES})
-
+        
+set_target_properties ( yasim PROPERTIES DEBUG_POSTFIX d )
+set_target_properties ( yasim-proptest PROPERTIES DEBUG_POSTFIX d )
+        
 install(TARGETS yasim yasim-proptest RUNTIME DESTINATION bin)
 
 endif(ENABLE_TESTS)
diff --git a/src/Input/CMakeLists.txt b/src/Input/CMakeLists.txt
index 009929d..5497a78 100644
--- a/src/Input/CMakeLists.txt
+++ b/src/Input/CMakeLists.txt
@@ -52,6 +52,8 @@ target_link_libraries(fgjs
 	${PLIB_LIBRARIES}
 	${SIMGEAR_CORE_LIBRARY_DEPENDENCIES})
 
+set_target_properties ( fgjs PROPERTIES DEBUG_POSTFIX d )
+
 add_executable(js_demo js_demo.cxx)
 
 target_link_libraries(js_demo 
@@ -59,6 +61,8 @@ target_link_libraries(js_demo
 	${PLIB_LIBRARIES}
 	${SIMGEAR_CORE_LIBRARY_DEPENDENCIES})
 
+set_target_properties ( js_demo PROPERTIES DEBUG_POSTFIX d )
+
 flightgear_component(Input "${SOURCES}" "${HEADERS}")
 
 install(TARGETS fgjs js_demo RUNTIME DESTINATION bin)
diff --git a/src/Main/CMakeLists.txt b/src/Main/CMakeLists.txt
index 259b511..39ca2af 100644
--- a/src/Main/CMakeLists.txt
+++ b/src/Main/CMakeLists.txt
@@ -67,6 +67,8 @@ source_group("Main\\Headers" FILES ${HEADERS})
 source_group("Main\\Sources" FILES ${SOURCES})
 add_executable(fgfs ${SOURCES} ${FG_SOURCES} ${FG_HEADERS} ${HEADERS})
 
+set_target_properties ( fgfs PROPERTIES DEBUG_POSTFIX d )
+
 # disable sqlite3 dynamic lib support
 # this should really be a SOURCE property, but the way we handle
 # Fcomponent sources is making that tricky
@@ -119,4 +121,6 @@ target_link_libraries(metar
 	${PLATFORM_LIBS}
 )
 
+set_target_properties ( metar PROPERTIES DEBUG_POSTFIX d )
+
 install(TARGETS metar RUNTIME DESTINATION bin)
diff --git a/utils/GPSsmooth/CMakeLists.txt b/utils/GPSsmooth/CMakeLists.txt
index 2349cc7..4b4690f 100644
--- a/utils/GPSsmooth/CMakeLists.txt
+++ b/utils/GPSsmooth/CMakeLists.txt
@@ -38,4 +38,8 @@ target_link_libraries(UGsmooth
     ${ZLIB_LIBRARY}
 )
 
+set_target_properties ( GPSsmooth PROPERTIES DEBUG_POSTFIX d )
+set_target_properties ( MIDGsmooth PROPERTIES DEBUG_POSTFIX d )
+set_target_properties ( UGsmooth PROPERTIES DEBUG_POSTFIX d )
+
 install(TARGETS GPSsmooth MIDGsmooth UGsmooth RUNTIME DESTINATION bin)
diff --git a/utils/TerraSync/CMakeLists.txt b/utils/TerraSync/CMakeLists.txt
index cc27ec8..0ec9e5b 100644
--- a/utils/TerraSync/CMakeLists.txt
+++ b/utils/TerraSync/CMakeLists.txt
@@ -6,4 +6,7 @@ target_link_libraries(terrasync
 	${SIMGEAR_CORE_LIBRARY_DEPENDENCIES}
 )
 
+set_target_properties ( terrasync PROPERTIES DEBUG_POSTFIX d )
+
 install(TARGETS terrasync RUNTIME DESTINATION bin)
+
diff --git a/utils/fgadmin/src/CMakeLists.txt b/utils/fgadmin/src/CMakeLists.txt
index 42b95d7..5ccb618 100644
--- a/utils/fgadmin/src/CMakeLists.txt
+++ b/utils/fgadmin/src/CMakeLists.txt
@@ -15,4 +15,6 @@ target_link_libraries(fgadmin FGAdminUI
 	${ZLIB_LIBRARY}
 )
 
+set_target_properties ( fgadmin PROPERTIES DEBUG_POSTFIX d )
+
 install(TARGETS fgadmin RUNTIME DESTINATION bin)
diff --git a/utils/fgelev/CMakeLists.txt b/utils/fgelev/CMakeLists.txt
index 90b52c0..50c1d35 100644
--- a/utils/fgelev/CMakeLists.txt
+++ b/utils/fgelev/CMakeLists.txt
@@ -7,4 +7,6 @@ target_link_libraries(fgelev
         ${SIMGEAR_CORE_LIBRARY_DEPENDENCIES}
 )
 
+set_target_properties ( fgelev PROPERTIES DEBUG_POSTFIX d )
+
 install(TARGETS fgelev RUNTIME DESTINATION bin)
diff --git a/utils/fgpanel/CMakeLists.txt b/utils/fgpanel/CMakeLists.txt
index f7ac79c..4427b8d 100644
--- a/utils/fgpanel/CMakeLists.txt
+++ b/utils/fgpanel/CMakeLists.txt
@@ -34,6 +34,8 @@ if(GLUT_FOUND)
 	)
 
 	include_directories(${PNG_INCLUDE_DIR})
+    
+    set_target_properties ( fgpanel PROPERTIES DEBUG_POSTFIX d )
 
 	install(TARGETS fgpanel RUNTIME DESTINATION bin)
 else()
diff --git a/utils/fgviewer/CMakeLists.txt b/utils/fgviewer/CMakeLists.txt
index dcfc3ac..111b5c7 100644
--- a/utils/fgviewer/CMakeLists.txt
+++ b/utils/fgviewer/CMakeLists.txt
@@ -8,4 +8,6 @@ target_link_libraries(fgviewer
         ${SIMGEAR_CORE_LIBRARY_DEPENDENCIES}
 )
 
+set_target_properties ( fgviewer PROPERTIES DEBUG_POSTFIX d )
+
 install(TARGETS fgviewer RUNTIME DESTINATION bin)
------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to