Bug #306
Make quassel compile with msvc on windows
0%
Description
This is a fairly simple patch, just going to inline it because I'm too lazy to create a patchfile...
Fix quassel build in msvc.
The output directory in msvc for executables is not ${CMAKE_BINARY_DIR}, but rather ${CMAKE_BINARY_DIR}/BUILDTYPE. This causes the run of genversion to fail because its located in ${CMAKE_BINARY_DIR}/Debug, for example. This directory is in the path however, so we can just call it directly.
There is the possiblity of this introducing a security risk, as if genversion does not compile, and there is a harmful genversion somewhere further in $PATH, it could be run. I'm not sure if this is truly an issue, however.
-------------------------------- CMakeLists.txt --------------------------------
index 6f24251..277eb2b 100644@ -103,7 +103,7
@ include_directories(${QT_INCLUDES})
add_executable(genversion ${CMAKE_SOURCE_DIR}/src/common/genversion.cpp)
target_link_libraries(genversion ${QT_LIBRARIES} ${QT_CORE_LIB_DEPENDENCIES})
-add_custom_target(genversion_run ALL ${CMAKE_BINARY_DIR}/genversion
+add_custom_target(genversion_run ALL genversion
${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR}/src/common/version.gen)
add_dependencies(genversion_run genversion)
Associated revisions
Find genversion.exe on Wintendo. Fixes BR #306, thanks to Hydrogen and SaroEngels!
History
#1 Updated by Hydrogen about 16 years ago
Lets change that to the following... Thanks Saroengels for the hint :)
-add_custom_target(genversion_run ALL genversion
+get_target_property( GENVERSION_EXECUTABLE genversion LOCATION )
+add_custom_target(genversion_run ALL ${GENVERSION_EXECUTABLE}
#2 Updated by Sputnick about 16 years ago
http://git.quassel-irc.org/?p=quassel.git;a=commit;h=bef2224798775ce371f85b225ef80b3b03197c83
Please let me know if it still doesn't work somewhere, as I can't test on MSVC currently. At least it seems not to cause problems on Linux :)
Find genversion.exe on Wintendo. Fixes BR #306, thanks to Hydrogen and SaroEngels!