Skip to main content
Rollback to Revision 1
Source Link
Antonio Petricca
  • 11.3k
  • 6
  • 47
  • 91

I've a strange problem with CMake.

I'm importing Curl into my project, so I write for you a simplified summary of my CMakeLists.txt file.

ADD_LIBRARY (libcurl **SHARED** IMPORTED)

SET_PROPERTY(TARGET libcurl PROPERTY IMPORTED_LOCATION ../lib/libcurl.lib)

ADD_LIBRARY (libcurl SHARED IMPORTED)

SET_PROPERTY(TARGET libcurl PROPERTY IMPORTED_LOCATION ../lib/libcurl.lib)

When I run CMake it generates the project files for MS VC++ (also for Linux). Then into the project file I find a wrong reference to curl library (libcurl-NOTFOUND)!

If I change my code into static import:

ADD_LIBRARY (libcurl **STATIC** IMPORTED)

SET_PROPERTY(TARGET libcurl PROPERTY IMPORTED_LOCATION ../lib/libcurl.lib)

ADD_LIBRARY (libcurl STATIC IMPORTED)

SET_PROPERTY(TARGET libcurl PROPERTY IMPORTED_LOCATION ../lib/libcurl.lib)

I find the right reference to ../lib/libcurl.lib.../lib/libcurl.lib.

Do you have any idea why this happens?

Thank you very much!

I've a strange problem with CMake.

I'm importing Curl into my project, so I write for you a simplified summary of my CMakeLists.txt file.

ADD_LIBRARY (libcurl **SHARED** IMPORTED)

SET_PROPERTY(TARGET libcurl PROPERTY IMPORTED_LOCATION ../lib/libcurl.lib)

When I run CMake it generates the project files for MS VC++ (also for Linux). Then into the project file I find a wrong reference to curl library (libcurl-NOTFOUND)!

If I change my code into static import:

ADD_LIBRARY (libcurl **STATIC** IMPORTED)

SET_PROPERTY(TARGET libcurl PROPERTY IMPORTED_LOCATION ../lib/libcurl.lib)

I find the right reference to ../lib/libcurl.lib.

Do you have any idea why this happens?

I've a strange problem with CMake.

I'm importing Curl into my project, so I write for you a simplified summary of my CMakeLists.txt file.

ADD_LIBRARY (libcurl SHARED IMPORTED)

SET_PROPERTY(TARGET libcurl PROPERTY IMPORTED_LOCATION ../lib/libcurl.lib)

When I run CMake it generates the project files for MS VC++ (also for Linux). Then into the project file I find a wrong reference to curl library (libcurl-NOTFOUND)!

If I change my code into static import:

ADD_LIBRARY (libcurl STATIC IMPORTED)

SET_PROPERTY(TARGET libcurl PROPERTY IMPORTED_LOCATION ../lib/libcurl.lib)

I find the right reference to ../lib/libcurl.lib.

Do you have any idea why this happens?

Thank you very much!

Removed the please help/thanks/greetings as per stackoverflow's policy. Fixed the formatting.
Source Link
Alexis Wilke
  • 21.2k
  • 11
  • 111
  • 183

I've a strange problem with CMake.

I'm importing Curl into my project, so I write for you a simplified summary of my CMakeLists.txt file.

ADD_LIBRARY (libcurl SHARED IMPORTED)

SET_PROPERTY(TARGET libcurl PROPERTY IMPORTED_LOCATION ../lib/libcurl.lib)

ADD_LIBRARY (libcurl **SHARED** IMPORTED)

SET_PROPERTY(TARGET libcurl PROPERTY IMPORTED_LOCATION ../lib/libcurl.lib)

When I run CMake it generates the project files for MS VC++ (also for Linux). Then into the project file I find a wrong reference to curl library (libcurl-NOTFOUND)!

If I change my code into static import:

ADD_LIBRARY (libcurl STATIC IMPORTED)

SET_PROPERTY(TARGET libcurl PROPERTY IMPORTED_LOCATION ../lib/libcurl.lib)

ADD_LIBRARY (libcurl **STATIC** IMPORTED)

SET_PROPERTY(TARGET libcurl PROPERTY IMPORTED_LOCATION ../lib/libcurl.lib)

I find the right reference to ../lib/libcurl.lib.../lib/libcurl.lib.

Do you have any idea why this happens?

Thank you very much!

I've a strange problem with CMake.

I'm importing Curl into my project, so I write for you a simplified summary of my CMakeLists.txt file.

ADD_LIBRARY (libcurl SHARED IMPORTED)

SET_PROPERTY(TARGET libcurl PROPERTY IMPORTED_LOCATION ../lib/libcurl.lib)

When I run CMake it generates the project files for MS VC++ (also for Linux). Then into the project file I find a wrong reference to curl library (libcurl-NOTFOUND)!

If I change my code into static import:

ADD_LIBRARY (libcurl STATIC IMPORTED)

SET_PROPERTY(TARGET libcurl PROPERTY IMPORTED_LOCATION ../lib/libcurl.lib)

I find the right reference to ../lib/libcurl.lib.

Do you have any idea why this happens?

Thank you very much!

I've a strange problem with CMake.

I'm importing Curl into my project, so I write for you a simplified summary of my CMakeLists.txt file.

ADD_LIBRARY (libcurl **SHARED** IMPORTED)

SET_PROPERTY(TARGET libcurl PROPERTY IMPORTED_LOCATION ../lib/libcurl.lib)

When I run CMake it generates the project files for MS VC++ (also for Linux). Then into the project file I find a wrong reference to curl library (libcurl-NOTFOUND)!

If I change my code into static import:

ADD_LIBRARY (libcurl **STATIC** IMPORTED)

SET_PROPERTY(TARGET libcurl PROPERTY IMPORTED_LOCATION ../lib/libcurl.lib)

I find the right reference to ../lib/libcurl.lib.

Do you have any idea why this happens?

Source Link
Antonio Petricca
  • 11.3k
  • 6
  • 47
  • 91

CMake imported library behaviour

I've a strange problem with CMake.

I'm importing Curl into my project, so I write for you a simplified summary of my CMakeLists.txt file.

ADD_LIBRARY (libcurl SHARED IMPORTED)

SET_PROPERTY(TARGET libcurl PROPERTY IMPORTED_LOCATION ../lib/libcurl.lib)

When I run CMake it generates the project files for MS VC++ (also for Linux). Then into the project file I find a wrong reference to curl library (libcurl-NOTFOUND)!

If I change my code into static import:

ADD_LIBRARY (libcurl STATIC IMPORTED)

SET_PROPERTY(TARGET libcurl PROPERTY IMPORTED_LOCATION ../lib/libcurl.lib)

I find the right reference to ../lib/libcurl.lib.

Do you have any idea why this happens?

Thank you very much!