MantisBT - CMake
View Issue Details
0013222CMakeCMakepublic2012-05-15 10:352016-06-10 14:31
sobigboy 
Kitware Robot 
normalminoralways
closedmoved 
SunSolaris5.10
CMake 2.8.7 
 
0013222: The CMake functions: check_function_exists(), the check_library_exists(), and the find_package() fail
The check_function_exists(), the check_library_exists(), and the find_package() all fail if they are preceded by set(CMAKE_C_FLAGS “-Mfilename”).
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.
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.
No tags attached.
Issue History
2012-05-15 10:35sobigboyNew Issue
2012-05-16 14:59sobigboyNote Added: 0029483
2012-05-16 16:04Antonio OspiteNote Added: 0029485
2012-05-16 16:09Antonio OspiteNote Edited: 0029485bug_revision_view_page.php?bugnote_id=29485#r652
2012-05-16 17:28sobigboyNote Added: 0029487
2012-08-11 21:35David ColeStatusnew => backlog
2012-08-11 21:35David ColeNote Added: 0030418
2016-06-10 14:28Kitware RobotNote Added: 0042048
2016-06-10 14:28Kitware RobotStatusbacklog => resolved
2016-06-10 14:28Kitware RobotResolutionopen => moved
2016-06-10 14:28Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0029483)
sobigboy   
2012-05-16 14:59   
This issue may be related to ID 0013208.
(0029485)
Antonio Ospite   
2012-05-16 16:04   
(edited on: 2012-05-16 16:09)
sogiboy, what's in CMakeFiles/CMakeError.log ?

(0029487)
sobigboy   
2012-05-16 17:28   
make: Fatal Error: Command failed for target 'CMakeFiles/cmTryCompileExec.dir/CheckFunctionExists.c.o'
...
make: Fatal Error: Command failed for target 'cmTryCompileExec/fast'
(0030418)
David Cole   
2012-08-11 21:35   
Sending old, never assigned issues to the backlog.

(The age of the bug, plus the fact that it's never been assigned to anyone means that nobody is actively working on it...)

If an issue you care about is sent to the backlog when you feel it should have been addressed in a different manner, please bring it up on the CMake mailing list for discussion. Sign up for the mailing list here, if you're not already on it: http://www.cmake.org/mailman/listinfo/cmake [^]

It's easy to re-activate a bug here if you can find a CMake developer who has the bandwidth to take it on, and ferry a fix through to our 'next' branch for dashboard testing.
(0042048)
Kitware Robot   
2016-06-10 14:28   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.