MantisBT - CMake | |||||
| View Issue Details | |||||
| ID | Project | Category | View Status | Date Submitted | Last Update |
| 0012918 | CMake | CMake | public | 2012-01-30 00:53 | 2012-07-09 06:52 |
| Reporter | TTAN | ||||
| Assigned To | Brad King | ||||
| Priority | high | Severity | major | Reproducibility | always |
| Status | closed | Resolution | no change required | ||
| Platform | Windows 7 | OS | OS Version | ||
| Product Version | CMake 2.8.7 | ||||
| Target Version | Fixed in Version | ||||
| Summary | 0012918: CMake wrongly generates x64 VC10 project files when Boost default stage folder is used for x32 | ||||
| Description | I've got two builds of boost libraries for x32 and x64, being staged into \stage and \vc10x64_stage respectively. with this command for the attached CMakeLists.txt below: cmake ../.. -G"Visual Studio 10 Win64" it correctly find the \vc10x64_stage folder, e.g.: -- Check for working C compiler using: Visual Studio 10 Win64 -- Check for working C compiler using: Visual Studio 10 Win64 -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working CXX compiler using: Visual Studio 10 Win64 -- Check for working CXX compiler using: Visual Studio 10 Win64 -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Using 64bit compiler -- Using 64bit Boost libs at X:/ttan/open-source/boost/trunk/vc10x64_stage/lib for host&machine exes -- Boost version: 1.49.0 -- Found the following Boost libraries: -- system -- date_time -- thread -- Using 64bit Boost libs at X:/ttan/open-source/boost/trunk/vc10x64_stage/lib for test executables -- Using 64bit Boost libs at X:/ttan/open-source/boost/trunk/vc10x64_stage/lib for pyhostlink lib -- Boost version: 1.49.0 -- Found the following Boost libraries: -- system -- date_time -- thread -- python -- Found PythonLibs: C:/Python27/libs/python27.lib -- Configuring done -- Generating done -- Build files have been written to: D:/H/src/build but fails to write into element <AdditionalDependencies> in the .vcxproj files, which actually refer to the libs under /stage. Renaming /stage to something else solves the problem | ||||
| Steps To Reproduce | - get a copy of boost library - get it built and staged into folder /stage with VC10 x32, (to save time just pick one libray, say filesystem) - get it built and staged into folder /vc10x64_stage with VC10 x64, (to save time just pick one libray, say filesystem) - modify the attached CMakelists.txt to point to teh boost folder - run cmake -G"Visual Studio 10 Win64" under VC10 x64 command Prompt console - check the <AdditionalDependencies> tags in the generated vcxproj file, where the boost.system lib file is wrongly set to the one in /stage not /vc10x64_stage | ||||
| Additional Information | CMakelists.txt for test: set(bitness 32) if(CMAKE_SIZEOF_VOID_P EQUAL 8) set(bitness 64) endif() # compiler options if(CMAKE_COMPILER_IS_GNUCXX) #add_definitions(-std=gnu++0x -time -o2 -wall -w -wshadow -wpointer-arith -wcast-qual -winline -werror) add_definitions(-std=gnu++0x -time -O2 -DBOOST_LIB_DIAGNOSTIC) #add_definitions(-std=gnu++0x -shared -O2 -o pyhostlink.so pyhostlink.cpp -lboost_python -I/usr/include/python2.7) endif() if(MSVC) #add_definitions(/EHsc /O2 /bigobj /Bt /MP1 /wd4003 /DBOOST_LIB_DIAGNOSTIC) add_definitions(/EHsc /O2 /bigobj /Bt /MP1 /wd4003 /DBOOST_LIB_DIAGNOSTIC /DBOOST_PYTHON_STATIC_LIB) endif() # finding boost if(WIN32) # Operating System = Windows, including Cygwin set(my_boost_root "X:/ttan/open-source/boost/trunk") set(BOOST_ROOT ${my_boost_root}) # visual C++ if(MSVC) # lib for vc++ x32 if(bitness EQUAL 32) set(my_stage_root stage) endif() # lib for vc++ x64 if(bitness EQUAL 64) set(my_stage_root vc10x64_stage) endif() endif(MSVC) # compiler is a variant of g++ if(MINGW) # lib for gcc x32 if(bitness EQUAL 32) set(my_stage_root gcc_stage) endif() # lib for gcc x64 if(bitness EQUAL 64) set(my_stage_root gccx64_stage) endif() endif(MINGW) set(Boost_LIBRARY_DIR "${my_boost_root}/${my_stage_root}/lib") message(STATUS "Using ${bitness}bit Boost libs at ${Boost_LIBRARY_DIR} for pyhostlink lib") endif(WIN32) if(UNIX) # Operating System = all UNIX-like OS's, including Apple OS X and Cygwin. set(Boost_INCLUDE_DIR /usr/local/include) set(Boost_LIBRARY_DIR /usr/local/lib) #set(Boost_ADDITIONAL_VERSIONS "1.48" "1.48.0") find_package(Threads) #for pthread endif(UNIX) # setting Boost usage set(Boost_USE_STATIC_LIBS ON) set(Boost_USE_MULTITHREADED ON) set(Boost_USE_STATIC_RUNTIME OFF) find_package(Boost COMPONENTS system date_time thread python REQUIRED) # seeting python usage find_package(PythonLibs REQUIRED) include_directories(${PYTHON_INCLUDE_DIRS}) link_directories(${PYTHON_LIBRARIES}) if(Boost_FOUND) # setup boost dependencies include_directories(${Boost_INCLUDE_DIR}) link_directories(${Boost_LIBRARY_DIR}) set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin) # build machine set(MACHINE_SRC_LIST pyhostlink.cpp) set(hostlink_lib_name pyhostlink) add_library(${hostlink_lib_name} SHARED ${MACHINE_SRC_LIST}) set_target_properties(${hostlink_lib_name} PROPERTIES PREFIX "") if(MSVC) set_target_properties(${hostlink_lib_name} PROPERTIES OUTPUT_NAME "${hostlink_lib_name}.pyd") endif(MSVC) target_link_libraries(${hostlink_lib_name} ${Boost_LIBRARIES} ${PYTHON_LIBRARIES}) #install(TARGETS ${machine_exe_name} ${host_exe_name} # RUNTIME DESTINATION bin # LIBRARY DESTINATION lib # ARCHIVE DESTINATION lib #) endif() | ||||
| Tags | 2010, boost, CMake, msvc10, vs2010 | ||||
| Relationships | |||||
| Attached Files | |||||
| Issue History | |||||
| Date Modified | Username | Field | Change | ||
| 2012-01-30 00:53 | TTAN | New Issue | |||
| 2012-01-30 00:55 | TTAN | Tag Attached: 2010 | |||
| 2012-01-30 00:55 | TTAN | Tag Attached: boost | |||
| 2012-01-30 00:55 | TTAN | Tag Attached: CMake | |||
| 2012-01-30 00:55 | TTAN | Tag Attached: msvc10 | |||
| 2012-01-30 00:55 | TTAN | Tag Attached: vs2010 | |||
| 2012-01-30 09:00 | Brad King | Note Added: 0028421 | |||
| 2012-01-30 09:00 | Brad King | Status | new => feedback | ||
| 2012-01-30 21:18 | TTAN | Note Added: 0028427 | |||
| 2012-01-30 21:18 | TTAN | Status | feedback => new | ||
| 2012-01-31 10:15 | Brad King | Note Added: 0028432 | |||
| 2012-02-01 00:31 | TTAN | Note Added: 0028434 | |||
| 2012-02-01 08:00 | Brad King | Status | new => resolved | ||
| 2012-02-01 08:00 | Brad King | Resolution | open => no change required | ||
| 2012-02-01 08:00 | Brad King | Assigned To | => Brad King | ||
| 2012-07-09 06:52 | David Cole | Note Added: 0029962 | |||
| 2012-07-09 06:52 | David Cole | Status | resolved => closed | ||
| Notes | |||||
|
|
|||||
|
|
||||
|
|
|||||
|
|
||||
|
|
|||||
|
|
||||
|
|
|||||
|
|
||||
|
|
|||||
|
|
||||