Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cmake doesn't display display message

Tags:

c

cmake

Fedora 15
cmake version 2.8.4

I am using the following CMakeLists.txt. However the status message doesn't display when I run cmake .

CMAKE_MINIMUM_REQUIRED(VERSION 2.6)

PROJECT(proj2 C)

IF(CMAKE_COMPILER_IS_GNUCXX)
    MESSAGE(STATUS "==== GCC detected - Adding compiler flags")
    SET(CMAKE_C_FLAGS "-pthread -ggdb -Wextra -Wall")
ENDIF(CMAKE_COMPILER_IS_GNUCXX)

ADD_EXECUTABLE(crypto_app main.c)

TARGET_LINK_LIBRARIES(crypto_app crypt)

All I get is the following:

-- The C compiler identification is GNU
-- Check for working C compiler: /usr/lib64/ccache/gcc
-- Check for working C compiler: /usr/lib64/ccache/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/projects/proj1/

Many thanks for any suggestions about this.

like image 420
ant2009 Avatar asked May 31 '11 16:05

ant2009


1 Answers

You're telling cmake that it's a C project, and then checking for a CXX (i.e. C++) compiler. CMAKE_COMPILER_IS_GNUCXX will never be true in this case. That's why.

like image 51
Chris Eberle Avatar answered Sep 30 '22 09:09

Chris Eberle