Permalink
Browse files

[11399] Make CMake a bit more usefull for Win/MSVC

Also make the -DPREFIX work on Win/MSVC

Signed-off-by: Neo2003 <Neo.2003@Hotmail.fr>
  • Loading branch information...
1 parent 640c010 commit d4b156b81122b32cf5c87cee8d8e4665c89fc41a Neo2003 committed Apr 26, 2011
View
@@ -125,7 +125,9 @@ if(CMAKE_INSTALL_PREFIX STREQUAL "/usr/local")
set(CMAKE_INSTALL_PREFIX ${PREFIX_ABSOLUTE} CACHE PATH "Install path prefix." FORCE)
endif()
if(PREFIX)
- string(REGEX REPLACE "^~" "$ENV{HOME}" PREFIX ${PREFIX})
+ if(!WIN32)
+ string(REGEX REPLACE "^~" "$ENV{HOME}" PREFIX ${PREFIX})
+ endif()
get_filename_component(PREFIX_ABSOLUTE ${PREFIX} ABSOLUTE)
set(CMAKE_INSTALL_PREFIX ${PREFIX} CACHE PATH "Install path prefix." FORCE)
else()
@@ -285,12 +287,12 @@ if(UNIX)
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall -Wfatal-errors -Wextra")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -Wfatal-errors -Wextra")
elseif(WIN32)
- # Disable warnings in Visual Studio 8 and above
+ # Disable warnings in Visual Studio 8 and above and add /MP
if(MSVC AND NOT CMAKE_GENERATOR MATCHES "Visual Studio 7")
- set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /wd4996 /wd4355 /wd4244 /wd4985 /wd4267")
- set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /wd4996 /wd4355 /wd4244 /wd4267")
- set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /wd4996 /wd4355 /wd4244 /wd4985 /wd4267")
- set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /wd4996 /wd4355 /wd4244 /wd4985 /wd4267")
+ set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /wd4996 /wd4355 /wd4244 /wd4985 /wd4267 /MP")
+ set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /wd4996 /wd4355 /wd4244 /wd4267 /MP")
+ set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /wd4996 /wd4355 /wd4244 /wd4985 /wd4267 /MP")
+ set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /wd4996 /wd4355 /wd4244 /wd4985 /wd4267 /MP")
endif()
endif()
@@ -51,8 +51,7 @@ if(WIN32 AND MSVC)
)
ExternalProject_Add_Step(ACE_Project ACE_Build
DEPENDEES ACE_Upgrade
- COMMAND ${ACE_BUILD_TOOL} <SOURCE_DIR>\\ace\\ace_vc8.sln /build Debug|${ACE_CONFIGURATION}
- COMMAND ${ACE_BUILD_TOOL} <SOURCE_DIR>\\ace\\ace_vc8.sln /build Release|${ACE_CONFIGURATION}
+ COMMAND ${ACE_BUILD_TOOL} <SOURCE_DIR>\\ace\\ace_vc8.sln /project ACE /build ${CMAKE_BUILD_TYPE}|${ACE_CONFIGURATION}
ALWAYS 0
)
elseif(UNIX)
Oops, something went wrong.

0 comments on commit d4b156b

Please sign in to comment.