MantisBT - CMake | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0015301 | CMake | CMake | public | 2014-12-12 12:03 | 2015-05-04 09:05 |
Reporter | jackcmedia | ||||
Assigned To | |||||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | no change required | ||
Platform | OS | Windows | OS Version | 7, 64 Bits | |
Product Version | CMake 3.0.2 | ||||
Target Version | Fixed in Version | ||||
Summary | 0015301: FIND_LIBRARY_USE_LIB64_PATHS doesn't work on Windows OSes | ||||
Description | Setting up a bi-arch cross-compiling script to generate 32 or 64 bit binaries on demand. Found that FIND_LIBRARY_USE_LIB64_PATHS doesn't work on Windows, failing to locate the 64 bit libraries placed on a folder named "lib64". Renaming said folder to "lib" makes it work as intended. | ||||
Steps To Reproduce | 1.- Install CMake 3.0.2 (TDM-GCC's MinGW-w64 4.9.2 and CLion are my compiler and IDE of choice, but are not required). 2.- Set up SFML 2.1 64 bits, a third party library, like this: include lib64 (x64 libs) and set the CMake (or environmental variable) SFML_ROOT pointing to the root folder of the third party library. 3.- Create a minimal CMakeLists.txt, like the following: cmake_minimum_required(VERSION 2.8) project(CMakeTest LANGUAGES CXX) if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") message(WARNING "Target is 64 bits") else("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") message(WARNING "Target is 32 bits") endif("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS ON) set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/Modules" ${CMAKE_MODULE_PATH}) find_package(SFML 2.1 REQUIRED graphics system window) include_directories(${PROJECT_SOURCE_DIR}/) aux_source_directory(. SRC_LIST) add_executable(${PROJECT_NAME} ${SRC_LIST}) if(SFML_FOUND) include_directories(${SFML_INCLUDE_DIR}) target_link_libraries(${PROJECT_NAME} ${SFML_LIBRARIES}) endif() 4.- Create a minimal source file, like the following: #include <SFML/Graphics/RenderWindow.hpp> int main() { sf::RenderWindow window2; return 0; } 5.- Download FindSFML.cmake from https://github.com/LaurentGomila/SFML/blob/2.1/cmake/Modules/FindSFML.cmake [^] and add it to the project inside ${PROJECT_SOURCE_DIR}/cmake/Modules. 6.- Try to compile and confirm it fails to locate the libraries. 7.- Rename "lib64" to "lib" and compile again. This time, it's a success. | ||||
Additional Information | |||||
Tags | c++, CMake, find_library, unix, Windows 7 | ||||
Relationships | |||||
Attached Files | |||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2014-12-12 12:03 | jackcmedia | New Issue | |||
2014-12-12 13:22 | Brad King | Note Added: 0037448 | |||
2014-12-13 09:15 | jackcmedia | Note Added: 0037449 | |||
2014-12-13 09:16 | jackcmedia | Tag Attached: c++ | |||
2014-12-13 09:16 | jackcmedia | Tag Attached: CMake | |||
2014-12-13 09:16 | jackcmedia | Tag Attached: find_library | |||
2014-12-13 09:16 | jackcmedia | Tag Attached: unix | |||
2014-12-13 09:16 | jackcmedia | Tag Attached: Windows 7 | |||
2014-12-14 09:17 | jackcmedia | Note Added: 0037455 | |||
2014-12-14 09:18 | jackcmedia | Note Edited: 0037455 | bug_revision_view_page.php?bugnote_id=37455#r1642 | ||
2014-12-15 09:08 | Brad King | Note Added: 0037456 | |||
2014-12-15 09:08 | Brad King | Status | new => resolved | ||
2014-12-15 09:08 | Brad King | Resolution | open => no change required | ||
2015-05-04 09:05 | Robert Maynard | Note Added: 0038696 | |||
2015-05-04 09:05 | Robert Maynard | Status | resolved => closed |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|