The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=13222 
====================================================================== 
Reported By:                sobigboy
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   13222
Category:                   CMake
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2012-05-15 10:35 EDT
Last Modified:              2012-05-15 10:35 EDT
====================================================================== 
Summary:                    The CMake functions:  check_function_exists(), the
check_library_exists(), and the find_package() fail
Description: 
The check_function_exists(), the check_library_exists(), and the find_package()
all fail if they are preceded by set(CMAKE_C_FLAGS “-Mfilename”).

Steps to Reproduce: 
1. Ensure the server has both CC and cc compilers installed.
2. Create a CMakeLists.txt file that contains the statement:
   set(CMAKE_C_FLAGS “-Mfilename”)
3. After this statement add one or more of the above functions.
4. Execute the build and observe that CMake reports the search fails.
5. Remove the set(CMAKE_C_FLAGS “-Mfilename”) statement.
6. Execute the build again and observe that CMake reports the search is
   successful.


Additional Information: 
I used the rt library and Threads package for testing.

CMake recognizes both the CC and cc compilers, but only the CC compiler is used
for the build (all source files are .h and .cpp).

According to man ld, the –M switch “reads mapfile as a text file of
directives to ld.”

All three functions fail regardless of the contents of the mapfile, whether the
mapfile exists or not, or even when a filename is not specified.

Surprisingly, set(CMAKE_CXX_FLAGS “-Mfilename”) does not cause the three
functions to fail.

====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2012-05-15 10:35 sobigboy       New Issue                                    
======================================================================

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

Reply via email to