CMAKE_C++_CREATE_SHARED_LIBRARY missing

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

CMAKE_C++_CREATE_SHARED_LIBRARY missing

Dvir Yitzchaki

Hi.

 

I use cmake 3.3.1 on Red-Hat 5 and 6.

When I generate a project I get the following error:

 

CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.

Missing variable is:

CMAKE_C++_CREATE_SHARED_LIBRARY

 

However, after the error the generation succeeds and I can build the project successfully.

The same project is generated without errors on Windows 7 with Visual Studio generators and other projects are also generated without errors on the same Linux machine.

 

Does anyone knows the source of that error?

 

Thanks,

 

Dvir


--

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: CMAKE_C++_CREATE_SHARED_LIBRARY missing

Andreas Mohr
Hi,

On Sun, Jul 10, 2016 at 12:00:02PM -0400, [hidden email] wrote:

> Message: 1
> Date: Sun, 10 Jul 2016 05:04:35 +0000
> From: Dvir Yitzchaki <[hidden email]>
> To: "'[hidden email]'" <[hidden email]>
> Subject: [CMake] CMAKE_C++_CREATE_SHARED_LIBRARY missing
> Message-ID:
> <[hidden email]>
> Content-Type: text/plain; charset="us-ascii"
>
> Hi.
>
> I use cmake 3.3.1 on Red-Hat 5 and 6.
> When I generate a project I get the following error:
>
> CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
> Missing variable is:
> CMAKE_C++_CREATE_SHARED_LIBRARY
>
> However, after the error the generation succeeds and I can build the project successfully.
> The same project is generated without errors on Windows 7 with Visual Studio generators and other projects are also generated without errors on the same Linux machine.
>
> Does anyone knows the source of that error?

Rimshot idea:

Quite possibly someone did a
    project(foo C C++)
rather than using the (IIRC - no docs here ATM) correct CXX.

HTH,

Andreas Mohr
--

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: CMAKE_C++_CREATE_SHARED_LIBRARY missing

Dvir Yitzchaki
You were close.
I searched for 'C++' in all our CMakeLists.txt and found the line

set_target_properties(foo PROPERTIES LINKER_LANGUAGE C++)

changed that to CXX and now the error is gone.

Thanks,

Dvir
   

-----Original Message-----
From: Andreas Mohr [mailto:[hidden email]]
Sent: Sunday, July 10, 2016 7:12 PM
To: [hidden email]
Cc: Dvir Yitzchaki
Subject: Re: [CMake] CMAKE_C++_CREATE_SHARED_LIBRARY missing

Hi,

On Sun, Jul 10, 2016 at 12:00:02PM -0400, [hidden email] wrote:

> Message: 1
> Date: Sun, 10 Jul 2016 05:04:35 +0000
> From: Dvir Yitzchaki <[hidden email]>
> To: "'[hidden email]'" <[hidden email]>
> Subject: [CMake] CMAKE_C++_CREATE_SHARED_LIBRARY missing
> Message-ID:
> <[hidden email]>
> Content-Type: text/plain; charset="us-ascii"
>
> Hi.
>
> I use cmake 3.3.1 on Red-Hat 5 and 6.
> When I generate a project I get the following error:
>
> CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
> Missing variable is:
> CMAKE_C++_CREATE_SHARED_LIBRARY
>
> However, after the error the generation succeeds and I can build the project successfully.
> The same project is generated without errors on Windows 7 with Visual Studio generators and other projects are also generated without errors on the same Linux machine.
>
> Does anyone knows the source of that error?

Rimshot idea:

Quite possibly someone did a
    project(foo C C++)
rather than using the (IIRC - no docs here ATM) correct CXX.

HTH,

Andreas Mohr
--

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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