grendizerufo / nvidia-texture-tools

Automatically exported from code.google.com/p/nvidia-texture-tools
Other
0 stars 0 forks source link

CMake with Visual Studio #111

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Cmake does not seem to be generating a solution that compiles in Visual
studio. 

By default, it seems that cmake is generating dlls for all the projects:
IF(NVTT_SHARED)
    SET(NVCORE_SHARED TRUE)
    SET(NVMATH_SHARED TRUE)
    SET(NVIMAGE_SHARED TRUE)
ENDIF(NVTT_SHARED)

However, the defines for the dlls are not being set in the generated
solution projects - therefore dlls with no exports are generated. 

Patch to add the "shared" defines:
\src\nvmath\CMakeLists.txt

IF(NVMATH_SHARED)
    ADD_DEFINITIONS(-DNVMATH_SHARED=1) 
    ADD_LIBRARY(nvmath SHARED ${MATH_SRCS})
ELSE(NVMATH_SHARED)
    ADD_LIBRARY(nvmath ${MATH_SRCS})
ENDIF(NVMATH_SHARED)

\src\nvimage\CMakeLists.txt
IF(NVIMAGE_SHARED)  
    ADD_DEFINITIONS(-DNVIMAGE_SHARED=1)
    ADD_LIBRARY(nvimage SHARED ${IMAGE_SRCS})
ELSE(NVIMAGE_SHARED)
    ADD_LIBRARY(nvimage ${IMAGE_SRCS})
ENDIF(NVIMAGE_SHARED)

\src\nvcore\CMakeLists.txt
IF(NVCORE_SHARED)
    ADD_DEFINITIONS(-DNVCORE_SHARED=1)
    ADD_LIBRARY(nvcore SHARED ${CORE_SRCS})
ELSE(NVCORE_SHARED)
    ADD_LIBRARY(nvcore ${CORE_SRCS})
ENDIF(NVCORE_SHARED)

(I am very new to cmake, so this may not be the best solution)

Original issue reported on code.google.com by dtrebi...@gmail.com on 2 Mar 2010 at 1:05

GoogleCodeExporter commented 9 years ago
Thanks for the bug report. I think that your proposal is most likely the best 
way to go.

Original comment by cast...@gmail.com on 2 Mar 2010 at 1:55

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r1052.

Original comment by cast...@gmail.com on 18 Mar 2010 at 12:12

GoogleCodeExporter commented 9 years ago
This is now fixed after revision 1054.

Original comment by cast...@gmail.com on 18 Mar 2010 at 12:14